Age | Commit message (Collapse) | Author |
|
Wrong subscript (subscript of digest should always be modulo
digest size [16 bytes]).
|
|
Various cryptography improvements
|
|
Also, correct the -DTACDEBUG_AT_RUNTIME scenario so that TACDEBUG()
binds correct when used in an if-body with an else following it, e.g.:
if (test)
TACDEBUG(LOG_DEBUG, "test is true");
else
return;
would previously have ended up as expanding to:
if (test)
if (tac_debug_enable) logmsg(LOG_DEBUG, "test is true");
else
return;
with the indent redone to reflect the nesting correctly. This now
expands (correctly) to:
if (test)
do { if (tac_debug_enable) logmsg(LOG_DEBUG, "test is true"); } while (0);
else
return;
|
|
This saves us having to marshall data and allocate a buffer for
the entire pad (bitstream cipher). We only need it in blocks of
16 bytes (the size of the MD5 digest), so let's compute it piecemeal
as we need it.
This has the added benefit of avoiding any calls to malloc() which
might be result in system calls (i.e. sbrk() to extend the heap).
|
|
Why make copies of the payload length to pass as parameters when
it's already present in the header?
|
|
MD5Update supports incremental digesting, so we can invoke it
multiple times to collect data rather than having to marshall it
into a contiguous buffer.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|