]> asedeno.scripts.mit.edu Git - PuTTY.git/blobdiff - sshsha.c
Unix Pageant: factor out have_controlling_tty().
[PuTTY.git] / sshsha.c
index 579bf4dea17f0d269e6e71b31dbcd24df0f76ba4..4870bba86ee2f0e04fb2b5afc33b91f35e552ef0 100644 (file)
--- a/sshsha.c
+++ b/sshsha.c
@@ -214,6 +214,7 @@ void SHA_Simple(const void *p, int len, unsigned char *output)
     SHA_Init(&s);
     SHA_Bytes(&s, p, len);
     SHA_Final(&s, output);
+    smemclr(&s, sizeof(s));
 }
 
 /*
@@ -241,6 +242,7 @@ static void sha1_final(void *handle, unsigned char *output)
     SHA_State *s = handle;
 
     SHA_Final(s, output);
+    smemclr(s, sizeof(*s));
     sfree(s);
 }
 
@@ -260,6 +262,7 @@ static void *sha1_make_context(void)
 
 static void sha1_free_context(void *handle)
 {
+    smemclr(handle, 3 * sizeof(SHA_State));
     sfree(handle);
 }