diff options
author | tb <> | 2021-11-18 20:11:55 +0000 |
---|---|---|
committer | tb <> | 2021-11-18 20:11:55 +0000 |
commit | 6e5c258fc17bbeef678a0be5be47f6bfaceba2a1 (patch) | |
tree | 9e2bbe142e6f63cd67df1842908d4b2363f91ee2 /src | |
parent | 58175e21c12af8434a78b20b0082eb53e658dfb9 (diff) | |
download | openbsd-6e5c258fc17bbeef678a0be5be47f6bfaceba2a1.tar.gz openbsd-6e5c258fc17bbeef678a0be5be47f6bfaceba2a1.tar.bz2 openbsd-6e5c258fc17bbeef678a0be5be47f6bfaceba2a1.zip |
Use HMAC_CTX_reset() instead of HMAC_CTX_cleanup() + HMAC_CTX_init()
Diffstat (limited to 'src')
-rw-r--r-- | src/regress/lib/libcrypto/hmac/hmactest.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/regress/lib/libcrypto/hmac/hmactest.c b/src/regress/lib/libcrypto/hmac/hmactest.c index 58fa9f593b..f61a177e1b 100644 --- a/src/regress/lib/libcrypto/hmac/hmactest.c +++ b/src/regress/lib/libcrypto/hmac/hmactest.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: hmactest.c,v 1.6 2021/11/18 15:20:33 tb Exp $ */ | 1 | /* $OpenBSD: hmactest.c,v 1.7 2021/11/18 20:11:55 tb Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -192,8 +192,7 @@ main(int argc, char *argv[]) | |||
192 | } | 192 | } |
193 | printf("test 4 ok\n"); | 193 | printf("test 4 ok\n"); |
194 | test5: | 194 | test5: |
195 | HMAC_CTX_cleanup(ctx); | 195 | HMAC_CTX_reset(ctx); |
196 | HMAC_CTX_init(ctx); | ||
197 | if (HMAC_Init_ex(ctx, test[4].key, test[4].key_len, NULL, NULL)) { | 196 | if (HMAC_Init_ex(ctx, test[4].key, test[4].key_len, NULL, NULL)) { |
198 | printf("Should fail to initialise HMAC with empty MD (test 5)\n"); | 197 | printf("Should fail to initialise HMAC with empty MD (test 5)\n"); |
199 | err++; | 198 | err++; |
@@ -282,8 +281,7 @@ main(int argc, char *argv[]) | |||
282 | printf("test 5 ok\n"); | 281 | printf("test 5 ok\n"); |
283 | } | 282 | } |
284 | test6: | 283 | test6: |
285 | HMAC_CTX_cleanup(ctx); | 284 | HMAC_CTX_reset(ctx); |
286 | HMAC_CTX_init(ctx); | ||
287 | if (!HMAC_Init_ex(ctx, test[7].key, test[7].key_len, EVP_sha1(), NULL)) { | 285 | if (!HMAC_Init_ex(ctx, test[7].key, test[7].key_len, EVP_sha1(), NULL)) { |
288 | printf("Failed to initialise HMAC (test 6)\n"); | 286 | printf("Failed to initialise HMAC (test 6)\n"); |
289 | err++; | 287 | err++; |