aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/hmac/hmac.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/hmac/hmac.c')
-rw-r--r--crypto/hmac/hmac.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/crypto/hmac/hmac.c b/crypto/hmac/hmac.c
index e1ec79e0933..23b7c98f8fa 100644
--- a/crypto/hmac/hmac.c
+++ b/crypto/hmac/hmac.c
@@ -88,11 +88,9 @@ 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)