diff options
author | tb <> | 2021-12-29 22:58:40 +0000 |
---|---|---|
committer | tb <> | 2021-12-29 22:58:40 +0000 |
commit | 9616fd789c841deeb17ee9d251213a58f93bef7e (patch) | |
tree | 9a8abf870ff4b59e94b7461cf56948c5a4766b66 | |
parent | 3e79866491e194452b6551e045ebd2ae511ed394 (diff) | |
download | openbsd-9616fd789c841deeb17ee9d251213a58f93bef7e.tar.gz openbsd-9616fd789c841deeb17ee9d251213a58f93bef7e.tar.bz2 openbsd-9616fd789c841deeb17ee9d251213a58f93bef7e.zip |
Minor cleanup after EC_POINT_get_affine_coordinates() unified the
_GFp and _GF2m variants.
CID 345155
-rw-r--r-- | src/regress/lib/libcrypto/ecdh/ecdhtest.c | 29 |
1 files changed, 6 insertions, 23 deletions
diff --git a/src/regress/lib/libcrypto/ecdh/ecdhtest.c b/src/regress/lib/libcrypto/ecdh/ecdhtest.c index 81ba5a4710..b3470cec5b 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.11 2021/04/20 17:21:27 tb Exp $ */ | 1 | /* $OpenBSD: ecdhtest.c,v 1.12 2021/12/29 22:58:40 tb Exp $ */ |
2 | /* ==================================================================== | 2 | /* ==================================================================== |
3 | * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. | 3 | * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. |
4 | * | 4 | * |
@@ -130,34 +130,17 @@ test_ecdh_curve(int nid, const char *text, BN_CTX *ctx, BIO *out) | |||
130 | if (!EC_KEY_generate_key(a)) | 130 | if (!EC_KEY_generate_key(a)) |
131 | goto err; | 131 | goto err; |
132 | 132 | ||
133 | if (EC_METHOD_get_field_type(EC_GROUP_method_of(group)) == | 133 | if (!EC_POINT_get_affine_coordinates(group, |
134 | NID_X9_62_prime_field) { | 134 | EC_KEY_get0_public_key(a), x_a, y_a, ctx)) goto err; |
135 | if (!EC_POINT_get_affine_coordinates(group, | 135 | |
136 | EC_KEY_get0_public_key(a), x_a, y_a, ctx)) goto err; | ||
137 | } | ||
138 | #ifndef OPENSSL_NO_EC2M | ||
139 | else { | ||
140 | if (!EC_POINT_get_affine_coordinates(group, | ||
141 | EC_KEY_get0_public_key(a), x_a, y_a, ctx)) goto err; | ||
142 | } | ||
143 | #endif | ||
144 | BIO_printf(out, " ."); | 136 | BIO_printf(out, " ."); |
145 | (void)BIO_flush(out); | 137 | (void)BIO_flush(out); |
146 | 138 | ||
147 | if (!EC_KEY_generate_key(b)) | 139 | if (!EC_KEY_generate_key(b)) |
148 | goto err; | 140 | goto err; |
149 | 141 | ||
150 | if (EC_METHOD_get_field_type(EC_GROUP_method_of(group)) == | 142 | if (!EC_POINT_get_affine_coordinates(group, |
151 | NID_X9_62_prime_field) { | 143 | EC_KEY_get0_public_key(b), x_b, y_b, ctx)) goto err; |
152 | if (!EC_POINT_get_affine_coordinates(group, | ||
153 | EC_KEY_get0_public_key(b), x_b, y_b, ctx)) goto err; | ||
154 | } | ||
155 | #ifndef OPENSSL_NO_EC2M | ||
156 | else { | ||
157 | if (!EC_POINT_get_affine_coordinates(group, | ||
158 | EC_KEY_get0_public_key(b), x_b, y_b, ctx)) goto err; | ||
159 | } | ||
160 | #endif | ||
161 | 144 | ||
162 | BIO_printf(out, "."); | 145 | BIO_printf(out, "."); |
163 | (void)BIO_flush(out); | 146 | (void)BIO_flush(out); |