diff options
author | tb <> | 2023-06-27 07:28:57 +0000 |
---|---|---|
committer | tb <> | 2023-06-27 07:28:57 +0000 |
commit | 47d329e117fd979837c817f1ee34eca6575c342f (patch) | |
tree | 47b781973c3787ffabb85c1566cf52d39e3597a4 | |
parent | f45c5c5b98a2815b6102dac200d0a9880ba26676 (diff) | |
download | openbsd-47d329e117fd979837c817f1ee34eca6575c342f.tar.gz openbsd-47d329e117fd979837c817f1ee34eca6575c342f.tar.bz2 openbsd-47d329e117fd979837c817f1ee34eca6575c342f.zip |
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-- | src/lib/libcrypto/ec/ec_asn1.c | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/src/lib/libcrypto/ec/ec_asn1.c b/src/lib/libcrypto/ec/ec_asn1.c index 36a413a994..6aedab9774 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.45 2023/05/04 05:59:38 tb Exp $ */ | 1 | /* $OpenBSD: ec_asn1.c,v 1.46 2023/06/27 07:28:57 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Written by Nils Larsch for the OpenSSL project. | 3 | * Written by Nils Larsch for the OpenSSL project. |
4 | */ | 4 | */ |
@@ -70,23 +70,7 @@ | |||
70 | int | 70 | int |
71 | EC_GROUP_get_basis_type(const EC_GROUP *group) | 71 | EC_GROUP_get_basis_type(const EC_GROUP *group) |
72 | { | 72 | { |
73 | int i = 0; | 73 | return 0; |
74 | |||
75 | if (EC_METHOD_get_field_type(EC_GROUP_method_of(group)) != | ||
76 | NID_X9_62_characteristic_two_field) | ||
77 | /* everything else is currently not supported */ | ||
78 | return 0; | ||
79 | |||
80 | while (group->poly[i] != 0) | ||
81 | i++; | ||
82 | |||
83 | if (i == 4) | ||
84 | return NID_X9_62_ppBasis; | ||
85 | else if (i == 2) | ||
86 | return NID_X9_62_tpBasis; | ||
87 | else | ||
88 | /* everything else is currently not supported */ | ||
89 | return 0; | ||
90 | } | 74 | } |
91 | 75 | ||
92 | /* some structures needed for the asn1 encoding */ | 76 | /* some structures needed for the asn1 encoding */ |