diff options
Diffstat (limited to 'src/lib/libcrypto/hmac/hmac.c')
-rw-r--r-- | src/lib/libcrypto/hmac/hmac.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/libcrypto/hmac/hmac.c b/src/lib/libcrypto/hmac/hmac.c index 23b7c98f8f..e1ec79e093 100644 --- a/src/lib/libcrypto/hmac/hmac.c +++ b/src/lib/libcrypto/hmac/hmac.c | |||
@@ -88,9 +88,11 @@ void HMAC_Init(HMAC_CTX *ctx, const void *key, int len, | |||
88 | else | 88 | else |
89 | { | 89 | { |
90 | memcpy(ctx->key,key,len); | 90 | memcpy(ctx->key,key,len); |
91 | memset(&(ctx->key[len]),0,sizeof(ctx->key)-len); | ||
92 | ctx->key_length=len; | 91 | ctx->key_length=len; |
93 | } | 92 | } |
93 | if(ctx->key_length != HMAC_MAX_MD_CBLOCK) | ||
94 | memset(&ctx->key[ctx->key_length], 0, | ||
95 | HMAC_MAX_MD_CBLOCK - ctx->key_length); | ||
94 | } | 96 | } |
95 | 97 | ||
96 | if (reset) | 98 | if (reset) |