SHA_Init(&s);
SHA_Bytes(&s, p, len);
SHA_Final(&s, output);
+ smemclr(&s, sizeof(s));
}
/*
return s;
}
-static void sha1_bytes(void *handle, void *p, int len)
+static void sha1_bytes(void *handle, const void *p, int len)
{
SHA_State *s = handle;
SHA_State *s = handle;
SHA_Final(s, output);
+ smemclr(s, sizeof(*s));
sfree(s);
}
* HMAC wrapper on it.
*/
-static void *sha1_make_context(void)
+static void *sha1_make_context(void *cipher_ctx)
{
return snewn(3, SHA_State);
}
static void sha1_free_context(void *handle)
{
+ smemclr(handle, 3 * sizeof(SHA_State));
sfree(handle);
}