aboutsummaryrefslogtreecommitdiffstats
path: root/test/hmactest.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2015-06-12 13:08:04 +0100
committerMatt Caswell <matt@openssl.org>2015-06-12 13:16:09 +0100
commit4b464e7b46682f568a5df550426b0cf4b22e2485 (patch)
treee68dd3b990976cb8201b2f76d758272ab014213c /test/hmactest.c
parent063dccd027033401912d8c5e3f0f25b1f13de64b (diff)
downloadopenssl-4b464e7b46682f568a5df550426b0cf4b22e2485.tar.gz
Fix ABI break with HMAC
Recent HMAC changes broke ABI compatibility due to a new field in HMAC_CTX. This backs that change out, and does it a different way. Thanks to Timo Teras for the concept. Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'test/hmactest.c')
-rw-r--r--test/hmactest.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/hmactest.c b/test/hmactest.c
index 13344d69e5..a9b829d078 100644
--- a/test/hmactest.c
+++ b/test/hmactest.c
@@ -226,7 +226,12 @@ test5:
err++;
goto test6;
}
- if (!HMAC_Init_ex(&ctx, NULL, 0, EVP_sha256(), NULL)) {
+ if (HMAC_Init_ex(&ctx, NULL, 0, EVP_sha256(), NULL)) {
+ printf("Should disallow changing MD without a new key (test 5)\n");
+ err++;
+ goto test6;
+ }
+ if (!HMAC_Init_ex(&ctx, test[4].key, test[4].key_len, EVP_sha256(), NULL)) {
printf("Failed to reinitialise HMAC (test 5)\n");
err++;
goto test6;