diff options
| author | tb <> | 2023-07-16 00:16:42 +0000 |
|---|---|---|
| committer | tb <> | 2023-07-16 00:16:42 +0000 |
| commit | f6ddbdf16aa2bb8dd188a3e99691cb94716e4dfb (patch) | |
| tree | 79076c3b4e3986393e7cfb10ea820046f743dc39 /src | |
| parent | 763925c42c273ae828b3f88c29e2cb6cec205ee4 (diff) | |
| download | openbsd-f6ddbdf16aa2bb8dd188a3e99691cb94716e4dfb.tar.gz openbsd-f6ddbdf16aa2bb8dd188a3e99691cb94716e4dfb.tar.bz2 openbsd-f6ddbdf16aa2bb8dd188a3e99691cb94716e4dfb.zip | |
ecdhtest: fix a couple bugs plus some cosmetic tweaks
Diffstat (limited to 'src')
| -rw-r--r-- | src/regress/lib/libcrypto/ecdh/ecdhtest.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/regress/lib/libcrypto/ecdh/ecdhtest.c b/src/regress/lib/libcrypto/ecdh/ecdhtest.c index fc534f14bd..bf9e9c007c 100644 --- a/src/regress/lib/libcrypto/ecdh/ecdhtest.c +++ b/src/regress/lib/libcrypto/ecdh/ecdhtest.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: ecdhtest.c,v 1.18 2023/07/15 23:35:02 tb Exp $ */ | 1 | /* $OpenBSD: ecdhtest.c,v 1.19 2023/07/16 00:16:42 tb Exp $ */ |
| 2 | /* ==================================================================== | 2 | /* ==================================================================== |
| 3 | * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. | 3 | * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. |
| 4 | * | 4 | * |
| @@ -149,10 +149,9 @@ ecdh_keygen_test(int nid) | |||
| 149 | printf(" shared secret:\n"); | 149 | printf(" shared secret:\n"); |
| 150 | hexdump(abuf, len); | 150 | hexdump(abuf, len); |
| 151 | 151 | ||
| 152 | printf("key b:\n"); | ||
| 153 | EC_KEY_print_fp(stdout, keyb, 1); | 152 | EC_KEY_print_fp(stdout, keyb, 1); |
| 154 | printf(" shared secret:\n"); | 153 | printf(" shared secret:\n"); |
| 155 | hexdump(abuf, len); | 154 | hexdump(bbuf, len); |
| 156 | 155 | ||
| 157 | fprintf(stderr, "Error in ECDH routines\n"); | 156 | fprintf(stderr, "Error in ECDH routines\n"); |
| 158 | 157 | ||
| @@ -160,6 +159,7 @@ ecdh_keygen_test(int nid) | |||
| 160 | } | 159 | } |
| 161 | 160 | ||
| 162 | failed = 0; | 161 | failed = 0; |
| 162 | |||
| 163 | err: | 163 | err: |
| 164 | ERR_print_errors_fp(stderr); | 164 | ERR_print_errors_fp(stderr); |
| 165 | 165 | ||
| @@ -338,7 +338,7 @@ ecdh_kat(const struct ecdh_kat_test *kat) | |||
| 338 | BIGNUM *z = NULL; | 338 | BIGNUM *z = NULL; |
| 339 | unsigned char *want = NULL, *got = NULL; | 339 | unsigned char *want = NULL, *got = NULL; |
| 340 | int len = 0; | 340 | int len = 0; |
| 341 | int failed = 0; | 341 | int failed = 1; |
| 342 | 342 | ||
| 343 | if ((keya = mk_eckey(kat->nid, kat->keya)) == NULL) | 343 | if ((keya = mk_eckey(kat->nid, kat->keya)) == NULL) |
| 344 | goto err; | 344 | goto err; |
| @@ -380,7 +380,7 @@ ecdh_kat(const struct ecdh_kat_test *kat) | |||
| 380 | 380 | ||
| 381 | err: | 381 | err: |
| 382 | if (failed) { | 382 | if (failed) { |
| 383 | printf("ECDH shared secret with %s failed", OBJ_nid2sn(kat->nid)); | 383 | printf("shared secret with %s failed", OBJ_nid2sn(kat->nid)); |
| 384 | 384 | ||
| 385 | fprintf(stderr, "Error in ECDH routines\n"); | 385 | fprintf(stderr, "Error in ECDH routines\n"); |
| 386 | ERR_print_errors_fp(stderr); | 386 | ERR_print_errors_fp(stderr); |
| @@ -396,7 +396,7 @@ ecdh_kat(const struct ecdh_kat_test *kat) | |||
| 396 | } | 396 | } |
| 397 | 397 | ||
| 398 | int | 398 | int |
| 399 | main(int argc, char *argv[]) | 399 | main(void) |
| 400 | { | 400 | { |
| 401 | EC_builtin_curve *curves = NULL; | 401 | EC_builtin_curve *curves = NULL; |
| 402 | size_t i, n_curves; | 402 | size_t i, n_curves; |
