From e68ca11e376f4237fb9f8c10487e2d7b7dbfe585 Mon Sep 17 00:00:00 2001 From: tb <> Date: Fri, 28 Jul 2023 10:21:01 +0000 Subject: Remove ERR_{get,set}_implementation() Much like ex_data, applications can make the library use their own error stack implementation. Well, except as of right now they no longer can. ok jsing --- src/lib/libcrypto/err/err.c | 31 +++---------------------------- src/lib/libcrypto/err/err.h | 11 +---------- 2 files changed, 4 insertions(+), 38 deletions(-) (limited to 'src/lib/libcrypto/err') diff --git a/src/lib/libcrypto/err/err.c b/src/lib/libcrypto/err/err.c index 8fbeea715e..8beb29543a 100644 --- a/src/lib/libcrypto/err/err.c +++ b/src/lib/libcrypto/err/err.c @@ -1,4 +1,4 @@ -/* $OpenBSD: err.c,v 1.54 2023/07/07 19:37:53 beck Exp $ */ +/* $OpenBSD: err.c,v 1.55 2023/07/28 10:21:01 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -125,6 +125,8 @@ DECLARE_LHASH_OF(ERR_STRING_DATA); DECLARE_LHASH_OF(ERR_STATE); +typedef struct st_ERR_FNS ERR_FNS; + static void err_load_strings(int lib, ERR_STRING_DATA *str); static void ERR_STATE_free(ERR_STATE *s); @@ -300,33 +302,6 @@ err_fns_check(void) CRYPTO_w_unlock(CRYPTO_LOCK_ERR); } -/* API functions to get or set the underlying ERR functions. */ - -const ERR_FNS * -ERR_get_implementation(void) -{ - err_fns_check(); - return err_fns; -} -LCRYPTO_ALIAS(ERR_get_implementation); - -int -ERR_set_implementation(const ERR_FNS *fns) -{ - int ret = 0; - - CRYPTO_w_lock(CRYPTO_LOCK_ERR); - /* It's too late if 'err_fns' is non-NULL. BTW: not much point setting - * an error is there?! */ - if (!err_fns) { - err_fns = fns; - ret = 1; - } - CRYPTO_w_unlock(CRYPTO_LOCK_ERR); - return ret; -} -LCRYPTO_ALIAS(ERR_set_implementation); - /* These are the callbacks provided to "lh_new()" when creating the LHASH tables * internal to the "err_defaults" implementation. */ diff --git a/src/lib/libcrypto/err/err.h b/src/lib/libcrypto/err/err.h index b61599d508..703817be33 100644 --- a/src/lib/libcrypto/err/err.h +++ b/src/lib/libcrypto/err/err.h @@ -1,4 +1,4 @@ -/* $OpenBSD: err.h,v 1.29 2023/04/09 19:10:23 tb Exp $ */ +/* $OpenBSD: err.h,v 1.30 2023/07/28 10:21:01 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -410,15 +410,6 @@ int ERR_get_next_error_library(void); int ERR_set_mark(void); int ERR_pop_to_mark(void); -/* Already defined in ossl_typ.h */ -/* typedef struct st_ERR_FNS ERR_FNS; */ -/* An application can use this function and provide the return value to loaded - * modules that should use the application's ERR state/functionality */ -const ERR_FNS *ERR_get_implementation(void); -/* A loaded module should call this function prior to any ERR operations using - * the application's "ERR_FNS". */ -int ERR_set_implementation(const ERR_FNS *fns); - #ifdef __cplusplus } #endif -- cgit v1.2.3-55-g6feb