From 801832bf59d216742be76eed86a19fa93993a405 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Wed, 18 Dec 2002 09:54:55 +0000 Subject: [PATCH] `Leonid' points out a stupid mistake in MD5 HMAC initialisation: we should initialise _both_ MD5 states, not the same one twice. [originally from svn r2341] --- sshmd5.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sshmd5.c b/sshmd5.c index 22c3e650..05867408 100644 --- 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 */ }