diff options
author | jsing <> | 2023-06-24 17:49:44 +0000 |
---|---|---|
committer | jsing <> | 2023-06-24 17:49:44 +0000 |
commit | 7f15e5a3e5c10e4517df9decdb2e27dcf9550d6c (patch) | |
tree | 668a9ce3c8e1082d03e94389c51d3f971147b538 /src/lib/libcrypto/ec/ec_lib.c | |
parent | 929c71e96837b9af0aab24ea7bacc4159d89cc64 (diff) | |
download | openbsd-7f15e5a3e5c10e4517df9decdb2e27dcf9550d6c.tar.gz openbsd-7f15e5a3e5c10e4517df9decdb2e27dcf9550d6c.tar.bz2 openbsd-7f15e5a3e5c10e4517df9decdb2e27dcf9550d6c.zip |
Mop up EC_GROUP precomp machinery.
Since there are now no EC implementations that perform pre-computation at
the EC_GROUP level, remove all of the precomp machinery, including the
extra_data EC_GROUP member.
The ec_wNAF_mul() code is horrific - simply cut out the precomp code,
rather than trying to rewrite it (that's a project for another day).
ok tb@
Diffstat (limited to '')
-rw-r--r-- | src/lib/libcrypto/ec/ec_lib.c | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/src/lib/libcrypto/ec/ec_lib.c b/src/lib/libcrypto/ec/ec_lib.c index 817b0239be..93a9065129 100644 --- a/src/lib/libcrypto/ec/ec_lib.c +++ b/src/lib/libcrypto/ec/ec_lib.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ec_lib.c,v 1.58 2023/06/20 14:37:15 tb Exp $ */ | 1 | /* $OpenBSD: ec_lib.c,v 1.59 2023/06/24 17:49:44 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * Originally written by Bodo Moeller for the OpenSSL project. | 3 | * Originally written by Bodo Moeller for the OpenSSL project. |
4 | */ | 4 | */ |
@@ -93,8 +93,6 @@ EC_GROUP_new(const EC_METHOD *meth) | |||
93 | } | 93 | } |
94 | ret->meth = meth; | 94 | ret->meth = meth; |
95 | 95 | ||
96 | ret->extra_data = NULL; | ||
97 | |||
98 | ret->generator = NULL; | 96 | ret->generator = NULL; |
99 | BN_init(&ret->order); | 97 | BN_init(&ret->order); |
100 | BN_init(&ret->cofactor); | 98 | BN_init(&ret->cofactor); |
@@ -123,8 +121,6 @@ EC_GROUP_free(EC_GROUP *group) | |||
123 | if (group->meth->group_finish != NULL) | 121 | if (group->meth->group_finish != NULL) |
124 | group->meth->group_finish(group); | 122 | group->meth->group_finish(group); |
125 | 123 | ||
126 | EC_EX_DATA_clear_free_all_data(&group->extra_data); | ||
127 | |||
128 | EC_POINT_free(group->generator); | 124 | EC_POINT_free(group->generator); |
129 | BN_free(&group->order); | 125 | BN_free(&group->order); |
130 | BN_free(&group->cofactor); | 126 | BN_free(&group->cofactor); |
@@ -142,8 +138,6 @@ EC_GROUP_clear_free(EC_GROUP *group) | |||
142 | int | 138 | int |
143 | EC_GROUP_copy(EC_GROUP *dest, const EC_GROUP *src) | 139 | EC_GROUP_copy(EC_GROUP *dest, const EC_GROUP *src) |
144 | { | 140 | { |
145 | EC_EXTRA_DATA *d; | ||
146 | |||
147 | if (dest->meth->group_copy == NULL) { | 141 | if (dest->meth->group_copy == NULL) { |
148 | ECerror(ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); | 142 | ECerror(ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); |
149 | return 0; | 143 | return 0; |
@@ -155,18 +149,6 @@ EC_GROUP_copy(EC_GROUP *dest, const EC_GROUP *src) | |||
155 | if (dest == src) | 149 | if (dest == src) |
156 | return 1; | 150 | return 1; |
157 | 151 | ||
158 | EC_EX_DATA_free_all_data(&dest->extra_data); | ||
159 | |||
160 | for (d = src->extra_data; d != NULL; d = d->next) { | ||
161 | void *t = d->dup_func(d->data); | ||
162 | |||
163 | if (t == NULL) | ||
164 | return 0; | ||
165 | if (!EC_EX_DATA_set_data(&dest->extra_data, t, d->dup_func, | ||
166 | d->free_func, d->clear_free_func)) | ||
167 | return 0; | ||
168 | } | ||
169 | |||
170 | if (src->generator != NULL) { | 152 | if (src->generator != NULL) { |
171 | if (dest->generator == NULL) { | 153 | if (dest->generator == NULL) { |
172 | dest->generator = EC_POINT_new(dest); | 154 | dest->generator = EC_POINT_new(dest); |