`Leonid' points out a stupid mistake in MD5 HMAC initialisation: we
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Wed, 18 Dec 2002 09:54:55 +0000 (09:54 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Wed, 18 Dec 2002 09:54:55 +0000 (09:54 +0000)
should initialise _both_ MD5 states, not the same one twice.

git-svn-id: svn://svn.tartarus.org/sgt/putty@2341 cda61777-01e9-0310-a592-d414129be87e

sshmd5.c

index 22c3e65..0586740 100644 (file)
--- a/sshmd5.c
+++ b/sshmd5.c
@@ -233,8 +233,8 @@ static void md5_key_internal(void *handle, unsigned char *key, int len)
     memset(foo, 0x5C, 64);
     for (i = 0; i < len && i < 64; i++)
        foo[i] ^= key[i];
-    MD5Init(&keys[0]);
-    MD5Update(&keys[0], foo, 64);
+    MD5Init(&keys[1]);
+    MD5Update(&keys[1], foo, 64);
 
     memset(foo, 0, 64);                       /* burn the evidence */
 }