Add HMAC test for invalid key len
Reviewed-by: Richard Levitte <levitte@openssl.org>
This commit is contained in:
parent
929b0d70c1
commit
e7c2ad508d
@ -206,6 +206,11 @@ test5:
|
|||||||
err++;
|
err++;
|
||||||
goto test6;
|
goto test6;
|
||||||
}
|
}
|
||||||
|
if(HMAC_Init_ex(&ctx, test[4].key, -1, EVP_sha1(), NULL)) {
|
||||||
|
printf("Should fail to initialise HMAC with invalid key len(test 5)\n");
|
||||||
|
err++;
|
||||||
|
goto test6;
|
||||||
|
}
|
||||||
if(!HMAC_Init_ex(&ctx, test[4].key, test[4].key_len, EVP_sha1(), NULL)) {
|
if(!HMAC_Init_ex(&ctx, test[4].key, test[4].key_len, EVP_sha1(), NULL)) {
|
||||||
printf("Failed to initialise HMAC (test 5)\n");
|
printf("Failed to initialise HMAC (test 5)\n");
|
||||||
err++;
|
err++;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user