From 1e07089babecfe48429157576c9b04908a399a45 Mon Sep 17 00:00:00 2001 From: tb <> Date: Sat, 8 Mar 2025 09:35:53 +0000 Subject: Inline _CONF_get_section_values() in its last caller and remove it NCONF_get_section() isn't any clearer by using this indirection. ok jsing --- src/lib/libcrypto/conf/conf_api.c | 15 +-------------- src/lib/libcrypto/conf/conf_lib.c | 9 +++++++-- src/lib/libcrypto/conf/conf_local.h | 4 +--- 3 files changed, 9 insertions(+), 19 deletions(-) (limited to 'src') diff --git a/src/lib/libcrypto/conf/conf_api.c b/src/lib/libcrypto/conf/conf_api.c index 5ed2a6332d..f986243b65 100644 --- a/src/lib/libcrypto/conf/conf_api.c +++ b/src/lib/libcrypto/conf/conf_api.c @@ -1,4 +1,4 @@ -/* $OpenBSD: conf_api.c,v 1.25 2025/03/07 11:01:12 tb Exp $ */ +/* $OpenBSD: conf_api.c,v 1.26 2025/03/08 09:35:53 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -91,19 +91,6 @@ _CONF_get_section(const CONF *conf, const char *section) return (v); } -/* Up until OpenSSL 0.9.5a, this was CONF_get_section */ -STACK_OF(CONF_VALUE) * -_CONF_get_section_values(const CONF *conf, const char *section) -{ - CONF_VALUE *v; - - v = _CONF_get_section(conf, section); - if (v != NULL) - return ((STACK_OF(CONF_VALUE) *)v->value); - else - return (NULL); -} - int _CONF_add_string(CONF *conf, CONF_VALUE *section, CONF_VALUE *value) { diff --git a/src/lib/libcrypto/conf/conf_lib.c b/src/lib/libcrypto/conf/conf_lib.c index 7d426d56b2..863e1c9475 100644 --- a/src/lib/libcrypto/conf/conf_lib.c +++ b/src/lib/libcrypto/conf/conf_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: conf_lib.c,v 1.24 2024/08/31 09:50:52 tb Exp $ */ +/* $OpenBSD: conf_lib.c,v 1.25 2025/03/08 09:35:53 tb Exp $ */ /* Written by Richard Levitte (richard@levitte.org) for the OpenSSL * project 2000. */ @@ -131,6 +131,8 @@ LCRYPTO_ALIAS(NCONF_load_bio); STACK_OF(CONF_VALUE) * NCONF_get_section(const CONF *conf, const char *section) { + CONF_VALUE *v; + if (conf == NULL) { CONFerror(CONF_R_NO_CONF); return NULL; @@ -141,7 +143,10 @@ NCONF_get_section(const CONF *conf, const char *section) return NULL; } - return _CONF_get_section_values(conf, section); + if ((v = _CONF_get_section(conf, section)) == NULL) + return NULL; + + return (STACK_OF(CONF_VALUE) *)v->value; } LCRYPTO_ALIAS(NCONF_get_section); diff --git a/src/lib/libcrypto/conf/conf_local.h b/src/lib/libcrypto/conf/conf_local.h index c3c6b22923..71cd22707b 100644 --- a/src/lib/libcrypto/conf/conf_local.h +++ b/src/lib/libcrypto/conf/conf_local.h @@ -1,4 +1,4 @@ -/* $OpenBSD: conf_local.h,v 1.9 2024/10/18 11:12:10 tb Exp $ */ +/* $OpenBSD: conf_local.h,v 1.10 2025/03/08 09:35:53 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -88,8 +88,6 @@ void CONF_set_nconf(CONF *conf, LHASH_OF(CONF_VALUE) *hash); CONF_VALUE *_CONF_new_section(CONF *conf, const char *section); CONF_VALUE *_CONF_get_section(const CONF *conf, const char *section); -STACK_OF(CONF_VALUE) *_CONF_get_section_values(const CONF *conf, - const char *section); int _CONF_add_string(CONF *conf, CONF_VALUE *section, CONF_VALUE *value); char *_CONF_get_string(const CONF *conf, const char *section, -- cgit v1.2.3-55-g6feb