]> asedeno.scripts.mit.edu Git - PuTTY.git/blobdiff - sshmd5.c
Bump version number for 0.65 release.
[PuTTY.git] / sshmd5.c
index 2fdb5900703327cf065a5455b38b40d66e084821..ca5c426cc4de9b4290b1106917922b42b2ae3f11 100644 (file)
--- a/sshmd5.c
+++ b/sshmd5.c
@@ -210,6 +210,7 @@ void MD5Simple(void const *p, unsigned len, unsigned char output[16])
     MD5Init(&s);
     MD5Update(&s, (unsigned char const *)p, len);
     MD5Final(output, &s);
+    smemclr(&s, sizeof(s));
 }
 
 /* ----------------------------------------------------------------------
@@ -227,6 +228,7 @@ void *hmacmd5_make_context(void)
 
 void hmacmd5_free_context(void *handle)
 {
+    smemclr(handle, 3*sizeof(struct MD5Context));
     sfree(handle);
 }
 
@@ -287,7 +289,7 @@ static int hmacmd5_verresult(void *handle, unsigned char const *hmac)
 {
     unsigned char correct[16];
     hmacmd5_genresult(handle, correct);
-    return !memcmp(correct, hmac, 16);
+    return smemeq(correct, hmac, 16);
 }
 
 static void hmacmd5_do_hmac_internal(void *handle,
@@ -327,7 +329,7 @@ static int hmacmd5_verify(void *handle, unsigned char *blk, int len,
 {
     unsigned char correct[16];
     hmacmd5_do_hmac_ssh(handle, blk, len, seq, correct);
-    return !memcmp(correct, blk + len, 16);
+    return smemeq(correct, blk + len, 16);
 }
 
 const struct ssh_mac ssh_hmac_md5 = {