Fix HMAC to pass invalid key len test
Reviewed-by: Richard Levitte <levitte@openssl.org>
This commit is contained in:
parent
4ebc70cc51
commit
42c9c7103c
@ -113,7 +113,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…
x
Reference in New Issue
Block a user