/*
- * SHA1 hash algorithm. Used in SSH2 as a MAC, and the transform is
+ * SHA1 hash algorithm. Used in SSH-2 as a MAC, and the transform is
* also used as a `stirring' function for the PuTTY random number
* pool. Implemented directly from the specification by Simon
* Tatham.
static void *sha1_make_context(void)
{
- return smalloc(2*sizeof(SHA_State));
+ return snewn(2, SHA_State);
}
static void sha1_free_context(void *handle)
SHA_Final(&states[1], output);
}
-const struct ssh_mac ssh_sha1 = {
+const struct ssh_mac ssh_hmac_sha1 = {
sha1_make_context, sha1_free_context, sha1_key,
sha1_generate, sha1_verify,
"hmac-sha1",
- 20
+ 20,
+ "HMAC-SHA1"
};
-const struct ssh_mac ssh_sha1_buggy = {
+const struct ssh_mac ssh_hmac_sha1_buggy = {
sha1_make_context, sha1_free_context, sha1_key_buggy,
sha1_generate, sha1_verify,
"hmac-sha1",
- 20
+ 20,
+ "bug-compatible HMAC-SHA1"
};