summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortb <>2024-08-28 08:43:55 +0000
committertb <>2024-08-28 08:43:55 +0000
commitabebdb0622c880c0c16ea2149519079244a0bb1c (patch)
treed198976bcf448c72e5356d8917641d823c0eda2e
parentd681db212ab923b3f985f9a9b30b122bd2793574 (diff)
downloadopenbsd-abebdb0622c880c0c16ea2149519079244a0bb1c.tar.gz
openbsd-abebdb0622c880c0c16ea2149519079244a0bb1c.tar.bz2
openbsd-abebdb0622c880c0c16ea2149519079244a0bb1c.zip
Turn X509V3_set_conf_lhash() into a noop
Another legacy turd that was only used by PHP 7.4 and 8.0. ok beck jsing
-rw-r--r--src/lib/libcrypto/hidden/openssl/x509v3.h4
-rw-r--r--src/lib/libcrypto/x509/x509_conf.c27
2 files changed, 3 insertions, 28 deletions
diff --git a/src/lib/libcrypto/hidden/openssl/x509v3.h b/src/lib/libcrypto/hidden/openssl/x509v3.h
index c2293d8ea0..f0db675e48 100644
--- a/src/lib/libcrypto/hidden/openssl/x509v3.h
+++ b/src/lib/libcrypto/hidden/openssl/x509v3.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509v3.h,v 1.10 2024/08/28 08:33:06 tb Exp $ */ 1/* $OpenBSD: x509v3.h,v 1.11 2024/08/28 08:43:55 tb Exp $ */
2/* 2/*
3 * Copyright (c) 2022 Bob Beck <beck@openbsd.org> 3 * Copyright (c) 2022 Bob Beck <beck@openbsd.org>
4 * 4 *
@@ -146,7 +146,7 @@ LCRYPTO_USED(X509V3_add_value_bool_nf);
146LCRYPTO_USED(X509V3_get_value_bool); 146LCRYPTO_USED(X509V3_get_value_bool);
147LCRYPTO_USED(X509V3_get_value_int); 147LCRYPTO_USED(X509V3_get_value_int);
148LCRYPTO_USED(X509V3_set_nconf); 148LCRYPTO_USED(X509V3_set_nconf);
149LCRYPTO_USED(X509V3_set_conf_lhash); 149LCRYPTO_UNUSED(X509V3_set_conf_lhash);
150LCRYPTO_USED(X509V3_get_string); 150LCRYPTO_USED(X509V3_get_string);
151LCRYPTO_USED(X509V3_get_section); 151LCRYPTO_USED(X509V3_get_section);
152LCRYPTO_USED(X509V3_string_free); 152LCRYPTO_USED(X509V3_string_free);
diff --git a/src/lib/libcrypto/x509/x509_conf.c b/src/lib/libcrypto/x509/x509_conf.c
index b6e5cd147a..5e6f1d6262 100644
--- a/src/lib/libcrypto/x509/x509_conf.c
+++ b/src/lib/libcrypto/x509/x509_conf.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_conf.c,v 1.19 2024/08/28 08:33:06 tb Exp $ */ 1/* $OpenBSD: x509_conf.c,v 1.20 2024/08/28 08:43:55 tb Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 1999. 3 * project 1999.
4 */ 4 */
@@ -74,10 +74,6 @@ static X509_EXTENSION *do_ext_nconf(CONF *conf, X509V3_CTX *ctx, int nid,
74 int crit, const char *value); 74 int crit, const char *value);
75static X509_EXTENSION *v3_generic_extension(const char *ext, const char *value, 75static X509_EXTENSION *v3_generic_extension(const char *ext, const char *value,
76 int crit, int type, X509V3_CTX *ctx); 76 int crit, int type, X509V3_CTX *ctx);
77static char *conf_lhash_get_string(void *db, const char *section,
78 const char *value);
79static STACK_OF(CONF_VALUE) *conf_lhash_get_section(void *db,
80 const char *section);
81static X509_EXTENSION *do_ext_i2d(const X509V3_EXT_METHOD *method, int nid, 77static X509_EXTENSION *do_ext_i2d(const X509V3_EXT_METHOD *method, int nid,
82 int crit, void *ext_struct); 78 int crit, void *ext_struct);
83static unsigned char *generic_asn1(const char *value, X509V3_CTX *ctx, 79static unsigned char *generic_asn1(const char *value, X509V3_CTX *ctx,
@@ -531,30 +527,9 @@ X509V3_EXT_conf_nid(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, int nid,
531} 527}
532LCRYPTO_ALIAS(X509V3_EXT_conf_nid); 528LCRYPTO_ALIAS(X509V3_EXT_conf_nid);
533 529
534static char *
535conf_lhash_get_string(void *db, const char *section, const char *value)
536{
537 return CONF_get_string(db, section, value);
538}
539
540static STACK_OF(CONF_VALUE) *
541conf_lhash_get_section(void *db, const char *section)
542{
543 return CONF_get_section(db, section);
544}
545
546static X509V3_CONF_METHOD conf_lhash_method = {
547 conf_lhash_get_string,
548 conf_lhash_get_section,
549 NULL,
550 NULL
551};
552
553void 530void
554X509V3_set_conf_lhash(X509V3_CTX *ctx, LHASH_OF(CONF_VALUE) *lhash) 531X509V3_set_conf_lhash(X509V3_CTX *ctx, LHASH_OF(CONF_VALUE) *lhash)
555{ 532{
556 ctx->db_meth = &conf_lhash_method;
557 ctx->db = lhash;
558} 533}
559LCRYPTO_ALIAS(X509V3_set_conf_lhash); 534LCRYPTO_ALIAS(X509V3_set_conf_lhash);
560 535