diff options
author | tb <> | 2024-01-13 11:55:31 +0000 |
---|---|---|
committer | tb <> | 2024-01-13 11:55:31 +0000 |
commit | 3e40db59bc417c351940e6542d8cc88dffa655a6 (patch) | |
tree | d123a927b79b922142d67475805b96d646e0ae32 /src | |
parent | 0b0d2fb3ead1da1ee4092b73cbcb12a10ca570ef (diff) | |
download | openbsd-3e40db59bc417c351940e6542d8cc88dffa655a6.tar.gz openbsd-3e40db59bc417c351940e6542d8cc88dffa655a6.tar.bz2 openbsd-3e40db59bc417c351940e6542d8cc88dffa655a6.zip |
Garbage collect check_defer()
This was a mechanism to ensure that OBJ_cleanup() doesn't remove the
ASN1_OBJECT associated with a custom cipher or digest (that was added
with EVP_add_{cipher,digest}(), while the latter is still referenced
in the OBJ_NAME table.
It had the effect that OBJ_cleanup() wasn't actually called ever from
OPENSSL_cleanup() (it is only called if you load the OID conf module).
Oh, and of course it was once part of the public API. I fixed that two
years ago, almost exactly to the day. Still mentioned in OBJ_create.3.
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libcrypto/evp/names.c | 3 | ||||
-rw-r--r-- | src/lib/libcrypto/objects/obj_dat.c | 9 |
2 files changed, 2 insertions, 10 deletions
diff --git a/src/lib/libcrypto/evp/names.c b/src/lib/libcrypto/evp/names.c index 6ef061a2cb..7dc9457c3e 100644 --- a/src/lib/libcrypto/evp/names.c +++ b/src/lib/libcrypto/evp/names.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: names.c,v 1.27 2024/01/13 11:48:16 tb Exp $ */ | 1 | /* $OpenBSD: names.c,v 1.28 2024/01/13 11:55:31 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 | * |
@@ -65,7 +65,6 @@ | |||
65 | #include "evp_local.h" | 65 | #include "evp_local.h" |
66 | 66 | ||
67 | extern int obj_cleanup_defer; | 67 | extern int obj_cleanup_defer; |
68 | void check_defer(int nid); | ||
69 | 68 | ||
70 | int | 69 | int |
71 | EVP_add_cipher(const EVP_CIPHER *c) | 70 | EVP_add_cipher(const EVP_CIPHER *c) |
diff --git a/src/lib/libcrypto/objects/obj_dat.c b/src/lib/libcrypto/objects/obj_dat.c index e72598ef61..be80420702 100644 --- a/src/lib/libcrypto/objects/obj_dat.c +++ b/src/lib/libcrypto/objects/obj_dat.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: obj_dat.c,v 1.82 2023/12/15 01:51:23 tb Exp $ */ | 1 | /* $OpenBSD: obj_dat.c,v 1.83 2024/01/13 11:55:31 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 | * |
@@ -191,13 +191,6 @@ static IMPLEMENT_LHASH_DOALL_FN(cleanup3, ADDED_OBJ) | |||
191 | int obj_cleanup_defer = 0; | 191 | int obj_cleanup_defer = 0; |
192 | 192 | ||
193 | void | 193 | void |
194 | check_defer(int nid) | ||
195 | { | ||
196 | if (!obj_cleanup_defer && nid >= NUM_NID) | ||
197 | obj_cleanup_defer = 1; | ||
198 | } | ||
199 | |||
200 | void | ||
201 | OBJ_cleanup(void) | 194 | OBJ_cleanup(void) |
202 | { | 195 | { |
203 | if (obj_cleanup_defer) { | 196 | if (obj_cleanup_defer) { |