diff options
author | Matt Caswell <matt@openssl.org> | 2015-02-10 13:15:05 +0000 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2015-03-25 12:58:56 +0000 |
commit | e7c2ad508d50144bc0ba480c75a2ee3367e98ee4 (patch) | |
tree | e1c4a8e41c28990908f4e44b57e19d558752fdf6 /crypto/hmac | |
parent | 929b0d70c19f60227f89fac63f22a21f21950823 (diff) | |
download | openssl-e7c2ad508d50144bc0ba480c75a2ee3367e98ee4.tar.gz |
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.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++; |