X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=sshmd5.c;h=b39dfd3e52dba4a399706c3769193c05ff738168;hb=7e9cb921f6024a9de567cc509974bf7388230f0f;hp=493db12cb68ac7233e4097de8841f48b2aba9272;hpb=26d3ccdfc5500a8afdbd54938677ef4ef985caaa;p=PuTTY.git diff --git a/sshmd5.c b/sshmd5.c index 493db12c..b39dfd3e 100644 --- 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)); } /* ---------------------------------------------------------------------- @@ -220,13 +221,14 @@ void MD5Simple(void const *p, unsigned len, unsigned char output[16]) * useful elsewhere (SOCKS5 CHAP authentication uses HMAC-MD5). */ -void *hmacmd5_make_context(void) +void *hmacmd5_make_context(void *cipher_ctx) { return snewn(3, struct MD5Context); } void hmacmd5_free_context(void *handle) { + smemclr(handle, 3*sizeof(struct MD5Context)); sfree(handle); } @@ -334,7 +336,7 @@ const struct ssh_mac ssh_hmac_md5 = { hmacmd5_make_context, hmacmd5_free_context, hmacmd5_key_16, hmacmd5_generate, hmacmd5_verify, hmacmd5_start, hmacmd5_bytes, hmacmd5_genresult, hmacmd5_verresult, - "hmac-md5", - 16, + "hmac-md5", "hmac-md5-etm@openssh.com", + 16, 16, "HMAC-MD5" };