Skip to content

Commit

Permalink
Correct (I think) MD4 padding count for NTLM
Browse files Browse the repository at this point in the history
RFC1320 §1.3 says there is always at least one bit of padding, but this
implementation (inherited from libsoup via evolution-data-server) doesn't
seem to get that right.

cf. https://bugzilla.gnome.org/show_bug.cgi?id=732087

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Jun 23, 2014
1 parent 5be3de0 commit 1d4a71e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ntlm.c
Expand Up @@ -188,7 +188,8 @@ static int md4sum (struct oc_text_buf *buf, unsigned char digest[16])
uint32_t A, B, C, D, AA, BB, CC, DD, X[16];
int pbytes, nbits = nbytes * 8, i, j;

pbytes = (120 - (nbytes % 64)) % 64;
/* There is *always* padding of at least one bit. */
pbytes = ((119 - (nbytes % 64)) % 64) + 1;

if (buf_ensure_space (buf, pbytes + 8))
return -ENOMEM;
Expand Down

0 comments on commit 1d4a71e

Please sign in to comment.