diff options
author | Theo Buehler <tb@cvs.openbsd.org> | 2023-07-16 00:16:43 +0000 |
---|---|---|
committer | Theo Buehler <tb@cvs.openbsd.org> | 2023-07-16 00:16:43 +0000 |
commit | bd9dad630f084227d73706a0f0a3e373d987c764 (patch) | |
tree | fcf410b14eeb65dcfe5c4523dbed29636b04f273 /regress/lib | |
parent | 1b7f3d7aaa59649b974028744c14356a6677d6e1 (diff) |
ecdhtest: fix a couple bugs plus some cosmetic tweaks
Diffstat (limited to 'regress/lib')
-rw-r--r-- | regress/lib/libcrypto/ecdh/ecdhtest.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/regress/lib/libcrypto/ecdh/ecdhtest.c b/regress/lib/libcrypto/ecdh/ecdhtest.c index fc534f14bd8..bf9e9c007c2 100644 --- a/regress/lib/libcrypto/ecdh/ecdhtest.c +++ b/regress/lib/libcrypto/ecdh/ecdhtest.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ecdhtest.c,v 1.18 2023/07/15 23:35:02 tb Exp $ */ +/* $OpenBSD: ecdhtest.c,v 1.19 2023/07/16 00:16:42 tb Exp $ */ /* ==================================================================== * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. * @@ -149,10 +149,9 @@ ecdh_keygen_test(int nid) printf(" shared secret:\n"); hexdump(abuf, len); - printf("key b:\n"); EC_KEY_print_fp(stdout, keyb, 1); printf(" shared secret:\n"); - hexdump(abuf, len); + hexdump(bbuf, len); fprintf(stderr, "Error in ECDH routines\n"); @@ -160,6 +159,7 @@ ecdh_keygen_test(int nid) } failed = 0; + err: ERR_print_errors_fp(stderr); @@ -338,7 +338,7 @@ ecdh_kat(const struct ecdh_kat_test *kat) BIGNUM *z = NULL; unsigned char *want = NULL, *got = NULL; int len = 0; - int failed = 0; + int failed = 1; if ((keya = mk_eckey(kat->nid, kat->keya)) == NULL) goto err; @@ -380,7 +380,7 @@ ecdh_kat(const struct ecdh_kat_test *kat) err: if (failed) { - printf("ECDH shared secret with %s failed", OBJ_nid2sn(kat->nid)); + printf("shared secret with %s failed", OBJ_nid2sn(kat->nid)); fprintf(stderr, "Error in ECDH routines\n"); ERR_print_errors_fp(stderr); @@ -396,7 +396,7 @@ ecdh_kat(const struct ecdh_kat_test *kat) } int -main(int argc, char *argv[]) +main(void) { EC_builtin_curve *curves = NULL; size_t i, n_curves; |