[evolution-data-server/gnome-3-10] Fix handling of NTLM passwords of 28 characters



commit 1b1e0aec25add687882da4c2d183c879a6301b26
Author: David Woodhouse <David Woodhouse intel com>
Date:   Tue Jun 24 18:42:09 2014 +0100

    Fix handling of NTLM passwords of 28 characters
    
    See libsoup bug 732087.
    
    (cherry picked from commit 6a2b8736e0a0c93f38b5fedf2fa956f6980a710d)

 camel/camel-sasl-ntlm.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/camel/camel-sasl-ntlm.c b/camel/camel-sasl-ntlm.c
index 96b74bb..6be9007 100644
--- a/camel/camel-sasl-ntlm.c
+++ b/camel/camel-sasl-ntlm.c
@@ -254,7 +254,8 @@ md4sum (const guchar *in,
        guint32 A, B, C, D, AA, BB, CC, DD, X[16];
        gint 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;
        M = alloca (nbytes + pbytes + 8);
        memcpy (M, in, nbytes);
        memset (M + nbytes, 0, pbytes + 8);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]