summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/ec/ec_asn1.c18
-rw-r--r--src/lib/libcrypto/ec/eck_prn.c20
2 files changed, 8 insertions, 30 deletions
diff --git a/src/lib/libcrypto/ec/ec_asn1.c b/src/lib/libcrypto/ec/ec_asn1.c
index 65bb007cae..06320b6588 100644
--- a/src/lib/libcrypto/ec/ec_asn1.c
+++ b/src/lib/libcrypto/ec/ec_asn1.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ec_asn1.c,v 1.32 2021/04/20 17:04:13 tb Exp $ */ 1/* $OpenBSD: ec_asn1.c,v 1.33 2021/04/20 17:12:43 tb Exp $ */
2/* 2/*
3 * Written by Nils Larsch for the OpenSSL project. 3 * Written by Nils Larsch for the OpenSSL project.
4 */ 4 */
@@ -818,20 +818,10 @@ ec_asn1_group2curve(const EC_GROUP * group, X9_62_CURVE * curve)
818 nid = EC_METHOD_get_field_type(EC_GROUP_method_of(group)); 818 nid = EC_METHOD_get_field_type(EC_GROUP_method_of(group));
819 819
820 /* get a and b */ 820 /* get a and b */
821 if (nid == NID_X9_62_prime_field) { 821 if (!EC_GROUP_get_curve(group, NULL, tmp_1, tmp_2, NULL)) {
822 if (!EC_GROUP_get_curve(group, NULL, tmp_1, tmp_2, NULL)) { 822 ECerror(ERR_R_EC_LIB);
823 ECerror(ERR_R_EC_LIB); 823 goto err;
824 goto err;
825 }
826 }
827#ifndef OPENSSL_NO_EC2M
828 else { /* nid == NID_X9_62_characteristic_two_field */
829 if (!EC_GROUP_get_curve(group, NULL, tmp_1, tmp_2, NULL)) {
830 ECerror(ERR_R_EC_LIB);
831 goto err;
832 }
833 } 824 }
834#endif
835 len_1 = (size_t) BN_num_bytes(tmp_1); 825 len_1 = (size_t) BN_num_bytes(tmp_1);
836 len_2 = (size_t) BN_num_bytes(tmp_2); 826 len_2 = (size_t) BN_num_bytes(tmp_2);
837 827
diff --git a/src/lib/libcrypto/ec/eck_prn.c b/src/lib/libcrypto/ec/eck_prn.c
index b17908d7fa..c2fd2ebc85 100644
--- a/src/lib/libcrypto/ec/eck_prn.c
+++ b/src/lib/libcrypto/ec/eck_prn.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: eck_prn.c,v 1.16 2021/04/20 17:04:13 tb Exp $ */ 1/* $OpenBSD: eck_prn.c,v 1.17 2021/04/20 17:12:43 tb Exp $ */
2/* 2/*
3 * Written by Nils Larsch for the OpenSSL project. 3 * Written by Nils Larsch for the OpenSSL project.
4 */ 4 */
@@ -64,8 +64,6 @@
64#include <stdio.h> 64#include <stdio.h>
65#include <string.h> 65#include <string.h>
66 66
67#include <openssl/opensslconf.h>
68
69#include <openssl/bn.h> 67#include <openssl/bn.h>
70#include <openssl/ec.h> 68#include <openssl/ec.h>
71#include <openssl/err.h> 69#include <openssl/err.h>
@@ -214,19 +212,9 @@ ECPKParameters_print(BIO * bp, const EC_GROUP * x, int off)
214 reason = ERR_R_MALLOC_FAILURE; 212 reason = ERR_R_MALLOC_FAILURE;
215 goto err; 213 goto err;
216 } 214 }
217#ifndef OPENSSL_NO_EC2M 215 if (!EC_GROUP_get_curve(x, p, a, b, ctx)) {
218 if (is_char_two) { 216 reason = ERR_R_EC_LIB;
219 if (!EC_GROUP_get_curve(x, p, a, b, ctx)) { 217 goto err;
220 reason = ERR_R_EC_LIB;
221 goto err;
222 }
223 } else /* prime field */
224#endif
225 {
226 if (!EC_GROUP_get_curve(x, p, a, b, ctx)) {
227 reason = ERR_R_EC_LIB;
228 goto err;
229 }
230 } 218 }
231 219
232 if ((point = EC_GROUP_get0_generator(x)) == NULL) { 220 if ((point = EC_GROUP_get0_generator(x)) == NULL) {