Fix for HMAC.
This commit is contained in:
parent
617d71bc12
commit
b475baffb2
4
CHANGES
4
CHANGES
@ -4,6 +4,10 @@
|
||||
|
||||
Changes between 0.9.5 and 0.9.5a [XX XXX 2000]
|
||||
|
||||
*) Fix for HMAC. It wasn't zeroing the rest of the block if the key length
|
||||
was larger than the MD block size.
|
||||
[Steve Henson, pointed out by Yost William <YostW@tce.com>]
|
||||
|
||||
*) Modernise PKCS12_parse() so it uses STACK_OF(X509) for its ca argument
|
||||
fix a leak when the ca argument was passed as NULL. Stop X509_PUBKEY_set()
|
||||
using the passed key: if the passed key was a private key the result
|
||||
|
@ -88,9 +88,11 @@ void HMAC_Init(HMAC_CTX *ctx, const void *key, int len,
|
||||
else
|
||||
{
|
||||
memcpy(ctx->key,key,len);
|
||||
memset(&(ctx->key[len]),0,sizeof(ctx->key)-len);
|
||||
ctx->key_length=len;
|
||||
}
|
||||
if(ctx->key_length != HMAC_MAX_MD_CBLOCK)
|
||||
memset(&ctx->key[ctx->key_length], 0,
|
||||
HMAC_MAX_MD_CBLOCK - ctx->key_length);
|
||||
}
|
||||
|
||||
if (reset)
|
||||
|
Loading…
x
Reference in New Issue
Block a user