From 93a17583d912ca338be885974e669a9eb871c489 Mon Sep 17 00:00:00 2001 From: tb <> Date: Sun, 25 Jun 2023 18:27:38 +0000 Subject: 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 --- src/lib/libcrypto/ecdh/ech_lib.c | 17 ++++------------- 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 @@ -/* $OpenBSD: ech_lib.c,v 1.17 2023/06/25 18:24:33 tb Exp $ */ +/* $OpenBSD: ech_lib.c,v 1.18 2023/06/25 18:27:38 tb Exp $ */ /* ==================================================================== * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. * @@ -201,28 +201,19 @@ int ECDH_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func) { - return CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_ECDH, argl, argp, - new_func, dup_func, free_func); + return -1; } int ECDH_set_ex_data(EC_KEY *d, int idx, void *arg) { - ECDH_DATA *ecdh; - ecdh = ecdh_check(d); - if (ecdh == NULL) - return 0; - return (CRYPTO_set_ex_data(&ecdh->ex_data, idx, arg)); + return 0; } void * ECDH_get_ex_data(EC_KEY *d, int idx) { - ECDH_DATA *ecdh; - ecdh = ecdh_check(d); - if (ecdh == NULL) - return NULL; - return (CRYPTO_get_ex_data(&ecdh->ex_data, idx)); + return NULL; } 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 @@ -/* $OpenBSD: ecs_lib.c,v 1.18 2023/06/25 18:24:33 tb Exp $ */ +/* $OpenBSD: ecs_lib.c,v 1.19 2023/06/25 18:27:38 tb Exp $ */ /* ==================================================================== * Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved. * @@ -219,26 +219,17 @@ int ECDSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func) { - return CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_ECDSA, argl, argp, - new_func, dup_func, free_func); + return -1; } int ECDSA_set_ex_data(EC_KEY *d, int idx, void *arg) { - ECDSA_DATA *ecdsa; - ecdsa = ecdsa_check(d); - if (ecdsa == NULL) - return 0; - return (CRYPTO_set_ex_data(&ecdsa->ex_data, idx, arg)); + return 0; } void * ECDSA_get_ex_data(EC_KEY *d, int idx) { - ECDSA_DATA *ecdsa; - ecdsa = ecdsa_check(d); - if (ecdsa == NULL) - return NULL; - return (CRYPTO_get_ex_data(&ecdsa->ex_data, idx)); + return NULL; } -- cgit v1.2.3-55-g6feb