From: Matt Caswell Date: Tue, 10 Feb 2015 13:15:05 +0000 (+0000) Subject: Add HMAC test for invalid key len X-Git-Tag: OpenSSL_1_0_1n~111 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=4ebc70cc5148d6ffbf539faca249469778c12f96;p=oweals%2Fopenssl.git Add HMAC test for invalid key len Reviewed-by: Richard Levitte --- 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++;