-/* $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.
*/
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);
-/* $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.
*/
#include <stdio.h>
#include <string.h>
-#include <openssl/opensslconf.h>
-
#include <openssl/bn.h>
#include <openssl/ec.h>
#include <openssl/err.h>
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) {