diff options
author | Theo Buehler <tb@cvs.openbsd.org> | 2021-04-20 17:12:44 +0000 |
---|---|---|
committer | Theo Buehler <tb@cvs.openbsd.org> | 2021-04-20 17:12:44 +0000 |
commit | ef1a834bd65a01c5858c96ef9d96917240c1e887 (patch) | |
tree | 48055e6bea598bb549778d01c8a7c2aa98b1f55d /lib/libcrypto/ec | |
parent | f28eea2539956a0c29461c9250e0739f56cf2d7c (diff) |
Simplify after EC_POINT_get_curve() addition
ok jsing
Diffstat (limited to 'lib/libcrypto/ec')
-rw-r--r-- | lib/libcrypto/ec/ec_asn1.c | 18 | ||||
-rw-r--r-- | lib/libcrypto/ec/eck_prn.c | 20 |
2 files changed, 8 insertions, 30 deletions
diff --git a/lib/libcrypto/ec/ec_asn1.c b/lib/libcrypto/ec/ec_asn1.c index 65bb007cae3..06320b65886 100644 --- a/lib/libcrypto/ec/ec_asn1.c +++ b/lib/libcrypto/ec/ec_asn1.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ec_asn1.c,v 1.32 2021/04/20 17:04:13 tb Exp $ */ +/* $OpenBSD: ec_asn1.c,v 1.33 2021/04/20 17:12:43 tb Exp $ */ /* * Written by Nils Larsch for the OpenSSL project. */ @@ -818,20 +818,10 @@ ec_asn1_group2curve(const EC_GROUP * group, X9_62_CURVE * curve) nid = EC_METHOD_get_field_type(EC_GROUP_method_of(group)); /* get a and b */ - if (nid == NID_X9_62_prime_field) { - if (!EC_GROUP_get_curve(group, NULL, tmp_1, tmp_2, NULL)) { - ECerror(ERR_R_EC_LIB); - goto err; - } - } -#ifndef OPENSSL_NO_EC2M - else { /* nid == NID_X9_62_characteristic_two_field */ - if (!EC_GROUP_get_curve(group, NULL, tmp_1, tmp_2, NULL)) { - ECerror(ERR_R_EC_LIB); - goto err; - } + if (!EC_GROUP_get_curve(group, NULL, tmp_1, tmp_2, NULL)) { + ECerror(ERR_R_EC_LIB); + goto err; } -#endif len_1 = (size_t) BN_num_bytes(tmp_1); len_2 = (size_t) BN_num_bytes(tmp_2); diff --git a/lib/libcrypto/ec/eck_prn.c b/lib/libcrypto/ec/eck_prn.c index b17908d7fa6..c2fd2ebc85b 100644 --- a/lib/libcrypto/ec/eck_prn.c +++ b/lib/libcrypto/ec/eck_prn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: eck_prn.c,v 1.16 2021/04/20 17:04:13 tb Exp $ */ +/* $OpenBSD: eck_prn.c,v 1.17 2021/04/20 17:12:43 tb Exp $ */ /* * Written by Nils Larsch for the OpenSSL project. */ @@ -64,8 +64,6 @@ #include <stdio.h> #include <string.h> -#include <openssl/opensslconf.h> - #include <openssl/bn.h> #include <openssl/ec.h> #include <openssl/err.h> @@ -214,19 +212,9 @@ ECPKParameters_print(BIO * bp, const EC_GROUP * x, int off) reason = ERR_R_MALLOC_FAILURE; goto err; } -#ifndef OPENSSL_NO_EC2M - if (is_char_two) { - if (!EC_GROUP_get_curve(x, p, a, b, ctx)) { - reason = ERR_R_EC_LIB; - goto err; - } - } else /* prime field */ -#endif - { - if (!EC_GROUP_get_curve(x, p, a, b, ctx)) { - reason = ERR_R_EC_LIB; - goto err; - } + if (!EC_GROUP_get_curve(x, p, a, b, ctx)) { + reason = ERR_R_EC_LIB; + goto err; } if ((point = EC_GROUP_get0_generator(x)) == NULL) { |