diff options
| author | tb <> | 2023-07-28 10:21:01 +0000 |
|---|---|---|
| committer | tb <> | 2023-07-28 10:21:01 +0000 |
| commit | 6f0a25f56e69a07f9a33663b857ea58bc32efba0 (patch) | |
| tree | f5135e3be73a200e3de6c7653f8573224f325770 /src/lib/libcrypto/err/err.c | |
| parent | df077cec5ce229b03845385f6f75dbe7cd5f7080 (diff) | |
| download | openbsd-6f0a25f56e69a07f9a33663b857ea58bc32efba0.tar.gz openbsd-6f0a25f56e69a07f9a33663b857ea58bc32efba0.tar.bz2 openbsd-6f0a25f56e69a07f9a33663b857ea58bc32efba0.zip | |
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
Diffstat (limited to 'src/lib/libcrypto/err/err.c')
| -rw-r--r-- | src/lib/libcrypto/err/err.c | 31 |
1 files changed, 3 insertions, 28 deletions
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 @@ | |||
| 1 | /* $OpenBSD: err.c,v 1.54 2023/07/07 19:37:53 beck Exp $ */ | 1 | /* $OpenBSD: err.c,v 1.55 2023/07/28 10:21:01 tb Exp $ */ |
| 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
| 3 | * All rights reserved. | 3 | * All rights reserved. |
| 4 | * | 4 | * |
| @@ -125,6 +125,8 @@ | |||
| 125 | DECLARE_LHASH_OF(ERR_STRING_DATA); | 125 | DECLARE_LHASH_OF(ERR_STRING_DATA); |
| 126 | DECLARE_LHASH_OF(ERR_STATE); | 126 | DECLARE_LHASH_OF(ERR_STATE); |
| 127 | 127 | ||
| 128 | typedef struct st_ERR_FNS ERR_FNS; | ||
| 129 | |||
| 128 | static void err_load_strings(int lib, ERR_STRING_DATA *str); | 130 | static void err_load_strings(int lib, ERR_STRING_DATA *str); |
| 129 | 131 | ||
| 130 | static void ERR_STATE_free(ERR_STATE *s); | 132 | static void ERR_STATE_free(ERR_STATE *s); |
| @@ -300,33 +302,6 @@ err_fns_check(void) | |||
| 300 | CRYPTO_w_unlock(CRYPTO_LOCK_ERR); | 302 | CRYPTO_w_unlock(CRYPTO_LOCK_ERR); |
| 301 | } | 303 | } |
| 302 | 304 | ||
| 303 | /* API functions to get or set the underlying ERR functions. */ | ||
| 304 | |||
| 305 | const ERR_FNS * | ||
| 306 | ERR_get_implementation(void) | ||
| 307 | { | ||
| 308 | err_fns_check(); | ||
| 309 | return err_fns; | ||
| 310 | } | ||
| 311 | LCRYPTO_ALIAS(ERR_get_implementation); | ||
| 312 | |||
| 313 | int | ||
| 314 | ERR_set_implementation(const ERR_FNS *fns) | ||
| 315 | { | ||
| 316 | int ret = 0; | ||
| 317 | |||
| 318 | CRYPTO_w_lock(CRYPTO_LOCK_ERR); | ||
| 319 | /* It's too late if 'err_fns' is non-NULL. BTW: not much point setting | ||
| 320 | * an error is there?! */ | ||
| 321 | if (!err_fns) { | ||
| 322 | err_fns = fns; | ||
| 323 | ret = 1; | ||
| 324 | } | ||
| 325 | CRYPTO_w_unlock(CRYPTO_LOCK_ERR); | ||
| 326 | return ret; | ||
| 327 | } | ||
| 328 | LCRYPTO_ALIAS(ERR_set_implementation); | ||
| 329 | |||
| 330 | /* These are the callbacks provided to "lh_new()" when creating the LHASH tables | 305 | /* These are the callbacks provided to "lh_new()" when creating the LHASH tables |
| 331 | * internal to the "err_defaults" implementation. */ | 306 | * internal to the "err_defaults" implementation. */ |
| 332 | 307 | ||
