summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2000-03-27 00:53:27 +0000
committerDr. Stephen Henson <steve@openssl.org>2000-03-27 00:53:27 +0000
commitb475baffb27fdb8342c717bc89e1c1dec0e6c0f1 (patch)
tree001a8354c69f9491eb75d6ff06a904f2bef633f7 /crypto
parent617d71bc12446296656a937031efdfcc8237e5f5 (diff)
Fix for HMAC.
Diffstat (limited to 'crypto')
-rw-r--r--crypto/hmac/hmac.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/crypto/hmac/hmac.c b/crypto/hmac/hmac.c
index 23b7c98f8f..e1ec79e093 100644
--- a/crypto/hmac/hmac.c
+++ b/crypto/hmac/hmac.c
@@ -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)