diff options
author | tb <> | 2023-06-25 18:27:38 +0000 |
---|---|---|
committer | tb <> | 2023-06-25 18:27:38 +0000 |
commit | 93a17583d912ca338be885974e669a9eb871c489 (patch) | |
tree | bb6e356d1d375cfa880793f31be33367ff221d48 | |
parent | 00a8f40a4141146dcf69a6d3d6bc5561b75a55a4 (diff) | |
download | openbsd-93a17583d912ca338be885974e669a9eb871c489.tar.gz openbsd-93a17583d912ca338be885974e669a9eb871c489.tar.bz2 openbsd-93a17583d912ca338be885974e669a9eb871c489.zip |
Make ECDH and ECDSA ex_data handlers always fail
They will be removed in the next major bump. No port uses them. They use
code that is in the way of upcoming surgery. Only libtls and smtpd used
to use the ECDSA version.
ok jsing
-rw-r--r-- | src/lib/libcrypto/ecdh/ech_lib.c | 17 | ||||
-rw-r--r-- | src/lib/libcrypto/ecdsa/ecs_lib.c | 17 |
2 files changed, 8 insertions, 26 deletions
diff --git a/src/lib/libcrypto/ecdh/ech_lib.c b/src/lib/libcrypto/ecdh/ech_lib.c index 90e14e1108..6e12126034 100644 --- a/src/lib/libcrypto/ecdh/ech_lib.c +++ b/src/lib/libcrypto/ecdh/ech_lib.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ech_lib.c,v 1.17 2023/06/25 18:24:33 tb Exp $ */ | 1 | /* $OpenBSD: ech_lib.c,v 1.18 2023/06/25 18:27:38 tb Exp $ */ |
2 | /* ==================================================================== | 2 | /* ==================================================================== |
3 | * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. | 3 | * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. |
4 | * | 4 | * |
@@ -201,28 +201,19 @@ int | |||
201 | ECDH_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, | 201 | ECDH_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, |
202 | CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func) | 202 | CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func) |
203 | { | 203 | { |
204 | return CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_ECDH, argl, argp, | 204 | return -1; |
205 | new_func, dup_func, free_func); | ||
206 | } | 205 | } |
207 | 206 | ||
208 | int | 207 | int |
209 | ECDH_set_ex_data(EC_KEY *d, int idx, void *arg) | 208 | ECDH_set_ex_data(EC_KEY *d, int idx, void *arg) |
210 | { | 209 | { |
211 | ECDH_DATA *ecdh; | 210 | return 0; |
212 | ecdh = ecdh_check(d); | ||
213 | if (ecdh == NULL) | ||
214 | return 0; | ||
215 | return (CRYPTO_set_ex_data(&ecdh->ex_data, idx, arg)); | ||
216 | } | 211 | } |
217 | 212 | ||
218 | void * | 213 | void * |
219 | ECDH_get_ex_data(EC_KEY *d, int idx) | 214 | ECDH_get_ex_data(EC_KEY *d, int idx) |
220 | { | 215 | { |
221 | ECDH_DATA *ecdh; | 216 | return NULL; |
222 | ecdh = ecdh_check(d); | ||
223 | if (ecdh == NULL) | ||
224 | return NULL; | ||
225 | return (CRYPTO_get_ex_data(&ecdh->ex_data, idx)); | ||
226 | } | 217 | } |
227 | 218 | ||
228 | int | 219 | int |
diff --git a/src/lib/libcrypto/ecdsa/ecs_lib.c b/src/lib/libcrypto/ecdsa/ecs_lib.c index caebeeb1f9..9ba5db2fca 100644 --- a/src/lib/libcrypto/ecdsa/ecs_lib.c +++ b/src/lib/libcrypto/ecdsa/ecs_lib.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ecs_lib.c,v 1.18 2023/06/25 18:24:33 tb Exp $ */ | 1 | /* $OpenBSD: ecs_lib.c,v 1.19 2023/06/25 18:27:38 tb Exp $ */ |
2 | /* ==================================================================== | 2 | /* ==================================================================== |
3 | * Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved. | 3 | * Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved. |
4 | * | 4 | * |
@@ -219,26 +219,17 @@ int | |||
219 | ECDSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, | 219 | ECDSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, |
220 | CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func) | 220 | CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func) |
221 | { | 221 | { |
222 | return CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_ECDSA, argl, argp, | 222 | return -1; |
223 | new_func, dup_func, free_func); | ||
224 | } | 223 | } |
225 | 224 | ||
226 | int | 225 | int |
227 | ECDSA_set_ex_data(EC_KEY *d, int idx, void *arg) | 226 | ECDSA_set_ex_data(EC_KEY *d, int idx, void *arg) |
228 | { | 227 | { |
229 | ECDSA_DATA *ecdsa; | 228 | return 0; |
230 | ecdsa = ecdsa_check(d); | ||
231 | if (ecdsa == NULL) | ||
232 | return 0; | ||
233 | return (CRYPTO_set_ex_data(&ecdsa->ex_data, idx, arg)); | ||
234 | } | 229 | } |
235 | 230 | ||
236 | void * | 231 | void * |
237 | ECDSA_get_ex_data(EC_KEY *d, int idx) | 232 | ECDSA_get_ex_data(EC_KEY *d, int idx) |
238 | { | 233 | { |
239 | ECDSA_DATA *ecdsa; | 234 | return NULL; |
240 | ecdsa = ecdsa_check(d); | ||
241 | if (ecdsa == NULL) | ||
242 | return NULL; | ||
243 | return (CRYPTO_get_ex_data(&ecdsa->ex_data, idx)); | ||
244 | } | 235 | } |