diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/regress/lib/libcrypto/aead/Makefile | 4 | ||||
| -rw-r--r-- | src/regress/lib/libcrypto/aead/aeadtest.c | 16 |
2 files changed, 12 insertions, 8 deletions
diff --git a/src/regress/lib/libcrypto/aead/Makefile b/src/regress/lib/libcrypto/aead/Makefile index c7ee88bf6a..cc58fc17f5 100644 --- a/src/regress/lib/libcrypto/aead/Makefile +++ b/src/regress/lib/libcrypto/aead/Makefile | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | # $OpenBSD: Makefile,v 1.5 2022/01/14 09:38:50 tb Exp $ | 1 | # $OpenBSD: Makefile,v 1.6 2022/07/30 16:30:42 jsing Exp $ |
| 2 | 2 | ||
| 3 | PROG= aeadtest | 3 | PROG= aeadtest |
| 4 | LDADD= -lcrypto | 4 | LDADD= -lcrypto |
| @@ -9,6 +9,6 @@ CFLAGS+= -DLIBRESSL_INTERNAL -Werror | |||
| 9 | REGRESS_TARGETS=regress-aeadtest | 9 | REGRESS_TARGETS=regress-aeadtest |
| 10 | 10 | ||
| 11 | regress-aeadtest: ${PROG} | 11 | regress-aeadtest: ${PROG} |
| 12 | ./${PROG} ${.CURDIR}/aeadtests.txt | 12 | ./${PROG} aead ${.CURDIR}/aeadtests.txt |
| 13 | 13 | ||
| 14 | .include <bsd.regress.mk> | 14 | .include <bsd.regress.mk> |
diff --git a/src/regress/lib/libcrypto/aead/aeadtest.c b/src/regress/lib/libcrypto/aead/aeadtest.c index bd6192324b..189cece6a4 100644 --- a/src/regress/lib/libcrypto/aead/aeadtest.c +++ b/src/regress/lib/libcrypto/aead/aeadtest.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: aeadtest.c,v 1.19 2022/07/30 16:17:22 jsing Exp $ */ | 1 | /* $OpenBSD: aeadtest.c,v 1.20 2022/07/30 16:30:42 jsing Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2014, Google Inc. | 3 | * Copyright (c) 2014, Google Inc. |
| 4 | * | 4 | * |
| @@ -392,14 +392,14 @@ main(int argc, char **argv) | |||
| 392 | unsigned int line_no = 0, num_tests = 0, j; | 392 | unsigned int line_no = 0, num_tests = 0, j; |
| 393 | unsigned char bufs[NUM_TYPES][BUF_MAX]; | 393 | unsigned char bufs[NUM_TYPES][BUF_MAX]; |
| 394 | unsigned int lengths[NUM_TYPES]; | 394 | unsigned int lengths[NUM_TYPES]; |
| 395 | const char *aeadname; | ||
| 395 | 396 | ||
| 396 | if (argc != 2) { | 397 | if (argc != 3) { |
| 397 | fprintf(stderr, "%s <test file.txt>\n", argv[0]); | 398 | fprintf(stderr, "%s <aead> <test file.txt>\n", argv[0]); |
| 398 | return 1; | 399 | return 1; |
| 399 | } | 400 | } |
| 400 | 401 | ||
| 401 | f = fopen(argv[1], "r"); | 402 | if ((f = fopen(argv[2], "r")) == NULL) { |
| 402 | if (f == NULL) { | ||
| 403 | perror("failed to open input"); | 403 | perror("failed to open input"); |
| 404 | return 1; | 404 | return 1; |
| 405 | } | 405 | } |
| @@ -434,7 +434,11 @@ main(int argc, char **argv) | |||
| 434 | if (!any_values_set) | 434 | if (!any_values_set) |
| 435 | continue; | 435 | continue; |
| 436 | 436 | ||
| 437 | if (!aead_from_name(&aead, &cipher, bufs[AEAD])) { | 437 | aeadname = argv[1]; |
| 438 | if (lengths[AEAD] != 0) | ||
| 439 | aeadname = bufs[AEAD]; | ||
| 440 | |||
| 441 | if (!aead_from_name(&aead, &cipher, aeadname)) { | ||
| 438 | fprintf(stderr, "Aborting...\n"); | 442 | fprintf(stderr, "Aborting...\n"); |
| 439 | return 4; | 443 | return 4; |
| 440 | } | 444 | } |
