summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2023-06-27 07:28:58 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2023-06-27 07:28:58 +0000
commitdcde6d1f126706442d65c657ba2dc0e993028c02 (patch)
tree83bdd114b50d5f7db29861ccbafb5874e7bf91e5
parent3f4232ab6b56b1ce1a9c1f391cda7957161c1a4d (diff)
Simplify EC_GROUP_get_basis_type()
The remaining EC_METHODs in libcrypto all have a field type of NID_X9_62_prime_field, so this function always returns 0. Make that more obvious. ok jsing
-rw-r--r--lib/libcrypto/ec/ec_asn1.c20
1 files changed, 2 insertions, 18 deletions
diff --git a/lib/libcrypto/ec/ec_asn1.c b/lib/libcrypto/ec/ec_asn1.c
index 36a413a9946..6aedab97747 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.45 2023/05/04 05:59:38 tb Exp $ */
+/* $OpenBSD: ec_asn1.c,v 1.46 2023/06/27 07:28:57 tb Exp $ */
/*
* Written by Nils Larsch for the OpenSSL project.
*/
@@ -70,23 +70,7 @@
int
EC_GROUP_get_basis_type(const EC_GROUP *group)
{
- int i = 0;
-
- if (EC_METHOD_get_field_type(EC_GROUP_method_of(group)) !=
- NID_X9_62_characteristic_two_field)
- /* everything else is currently not supported */
- return 0;
-
- while (group->poly[i] != 0)
- i++;
-
- if (i == 4)
- return NID_X9_62_ppBasis;
- else if (i == 2)
- return NID_X9_62_tpBasis;
- else
- /* everything else is currently not supported */
- return 0;
+ return 0;
}
/* some structures needed for the asn1 encoding */