Fix HMAC to pass invalid key len test
Reviewed-by: Richard Levitte <levitte@openssl.org>
This commit is contained in:
parent
e7c2ad508d
commit
ddbf312fb4
1 changed files with 2 additions and 1 deletions
|
@ -123,7 +123,8 @@ int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len,
|
|||
&ctx->key_length))
|
||||
goto err;
|
||||
} else {
|
||||
OPENSSL_assert(len >= 0 && len <= (int)sizeof(ctx->key));
|
||||
if(len < 0 || len > (int)sizeof(ctx->key))
|
||||
return 0;
|
||||
memcpy(ctx->key, key, len);
|
||||
ctx->key_length = len;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue