aboutsummaryrefslogtreecommitdiff
path: root/crypto/hmac
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2015-02-10 13:15:05 +0000
committerMatt Caswell <matt@openssl.org>2015-03-25 12:54:18 +0000
commitb352160f816585d2be1bcd8862efae647968f406 (patch)
tree423a492f392d152eee8da0df280b24e23ee2bdaf /crypto/hmac
parente2095c6531da1207a936b65730db0222831a93ed (diff)
downloadopenssl-b352160f816585d2be1bcd8862efae647968f406.zip
openssl-b352160f816585d2be1bcd8862efae647968f406.tar.gz
openssl-b352160f816585d2be1bcd8862efae647968f406.tar.bz2
Add HMAC test for invalid key len
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto/hmac')
-rw-r--r--crypto/hmac/hmactest.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/crypto/hmac/hmactest.c b/crypto/hmac/hmactest.c
index 3db712a..5e90dba 100644
--- a/crypto/hmac/hmactest.c
+++ b/crypto/hmac/hmactest.c
@@ -199,6 +199,11 @@ test5:
err++;
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)) {
printf("Failed to initialise HMAC (test 5)\n");
err++;