Mercurial > dropbear
diff libtomcrypt/src/mac/hmac/hmac_init.c @ 1069:2fa71c3b2827 pam
merge pam branch up to date
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Mon, 16 Mar 2015 21:34:05 +0800 |
parents | a2bfd4374878 |
children | f849a5ca2efc |
line wrap: on
line diff
--- a/libtomcrypt/src/mac/hmac/hmac_init.c Fri Jan 23 22:32:49 2015 +0800 +++ b/libtomcrypt/src/mac/hmac/hmac_init.c Mon Mar 16 21:34:05 2015 +0800 @@ -29,7 +29,7 @@ */ int hmac_init(hmac_state *hmac, int hash, const unsigned char *key, unsigned long keylen) { - unsigned char *buf; + unsigned char buf[MAXBLOCKSIZE]; unsigned long hashsize; unsigned long i, z; int err; @@ -49,16 +49,9 @@ return CRYPT_INVALID_KEYSIZE; } - /* allocate ram for buf */ - buf = XMALLOC(HMAC_BLOCKSIZE); - if (buf == NULL) { - return CRYPT_MEM; - } - /* allocate memory for key */ hmac->key = XMALLOC(HMAC_BLOCKSIZE); if (hmac->key == NULL) { - XFREE(buf); return CRYPT_MEM; } @@ -101,7 +94,6 @@ zeromem(buf, HMAC_BLOCKSIZE); #endif - XFREE(buf); return err; }