projects
/
oweals
/
openssl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e2095c6
)
Add HMAC test for invalid key len
author
Matt Caswell
<matt@openssl.org>
Tue, 10 Feb 2015 13:15:05 +0000
(13:15 +0000)
committer
Matt Caswell
<matt@openssl.org>
Wed, 25 Mar 2015 12:54:18 +0000
(12:54 +0000)
Reviewed-by: Richard Levitte <levitte@openssl.org>
crypto/hmac/hmactest.c
patch
|
blob
|
history
diff --git
a/crypto/hmac/hmactest.c
b/crypto/hmac/hmactest.c
index 3db712a776c6145b2bf031ba45671df93be75db5..5e90dba55af9b1ef90a4a4acc3219a8c8016db20 100644
(file)
--- 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++;