diff options
author | Matt Caswell <matt@openssl.org> | 2015-02-10 13:15:05 +0000 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2015-03-25 13:01:04 +0000 |
commit | 4ebc70cc5148d6ffbf539faca249469778c12f96 (patch) | |
tree | b51c6381d8c9cf7ce659fb9b8f525fd2629bddde | |
parent | 2674af2f790aa1c869dcf5f2024e9eb6758edf56 (diff) |
Add HMAC test for invalid key len
Reviewed-by: Richard Levitte <levitte@openssl.org>
-rw-r--r-- | crypto/hmac/hmactest.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/crypto/hmac/hmactest.c b/crypto/hmac/hmactest.c index f9c84a725a..5c8ec4c615 100644 --- a/crypto/hmac/hmactest.c +++ b/crypto/hmac/hmactest.c @@ -206,6 +206,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++; |