X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/e0e1a00d471c4970f88b2a87f7f54d6c2c97c7f4..0980c4f28e5909a05be74af88732fddd7086f2f6:/sshsha.c diff --git a/sshsha.c b/sshsha.c index 4bac4fdc..c17149ee 100644 --- a/sshsha.c +++ b/sshsha.c @@ -1,5 +1,5 @@ /* - * 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. @@ -13,7 +13,7 @@ #define rol(x,y) ( ((x) << (y)) | (((uint32)x) >> (32-y)) ) -void SHA_Core_Init(uint32 h[5]) +static void SHA_Core_Init(uint32 h[5]) { h[0] = 0x67452301; h[1] = 0xefcdab89; @@ -195,7 +195,7 @@ void SHA_Simple(void *p, int len, unsigned char *output) static void *sha1_make_context(void) { - return smalloc(2*sizeof(SHA_State)); + return snewn(2, SHA_State); } static void sha1_free_context(void *handle) @@ -286,12 +286,14 @@ const struct ssh_mac ssh_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 = { sha1_make_context, sha1_free_context, sha1_key_buggy, sha1_generate, sha1_verify, "hmac-sha1", - 20 + 20, + "bug-compatible HMAC-SHA1" };