diff options
author | tb <> | 2025-03-08 09:35:53 +0000 |
---|---|---|
committer | tb <> | 2025-03-08 09:35:53 +0000 |
commit | 1e07089babecfe48429157576c9b04908a399a45 (patch) | |
tree | 46059d5be800957c29719ceda8538099c7284994 /src/lib | |
parent | 98a22bb72e4a20765f43cd5778f45ccd8072fa26 (diff) | |
download | openbsd-1e07089babecfe48429157576c9b04908a399a45.tar.gz openbsd-1e07089babecfe48429157576c9b04908a399a45.tar.bz2 openbsd-1e07089babecfe48429157576c9b04908a399a45.zip |
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
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/libcrypto/conf/conf_api.c | 15 | ||||
-rw-r--r-- | src/lib/libcrypto/conf/conf_lib.c | 9 | ||||
-rw-r--r-- | src/lib/libcrypto/conf/conf_local.h | 4 |
3 files changed, 9 insertions, 19 deletions
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 @@ | |||
1 | /* $OpenBSD: conf_api.c,v 1.25 2025/03/07 11:01:12 tb Exp $ */ | 1 | /* $OpenBSD: conf_api.c,v 1.26 2025/03/08 09:35:53 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 | * |
@@ -91,19 +91,6 @@ _CONF_get_section(const CONF *conf, const char *section) | |||
91 | return (v); | 91 | return (v); |
92 | } | 92 | } |
93 | 93 | ||
94 | /* Up until OpenSSL 0.9.5a, this was CONF_get_section */ | ||
95 | STACK_OF(CONF_VALUE) * | ||
96 | _CONF_get_section_values(const CONF *conf, const char *section) | ||
97 | { | ||
98 | CONF_VALUE *v; | ||
99 | |||
100 | v = _CONF_get_section(conf, section); | ||
101 | if (v != NULL) | ||
102 | return ((STACK_OF(CONF_VALUE) *)v->value); | ||
103 | else | ||
104 | return (NULL); | ||
105 | } | ||
106 | |||
107 | int | 94 | int |
108 | _CONF_add_string(CONF *conf, CONF_VALUE *section, CONF_VALUE *value) | 95 | _CONF_add_string(CONF *conf, CONF_VALUE *section, CONF_VALUE *value) |
109 | { | 96 | { |
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 @@ | |||
1 | /* $OpenBSD: conf_lib.c,v 1.24 2024/08/31 09:50:52 tb Exp $ */ | 1 | /* $OpenBSD: conf_lib.c,v 1.25 2025/03/08 09:35:53 tb Exp $ */ |
2 | /* Written by Richard Levitte (richard@levitte.org) for the OpenSSL | 2 | /* Written by Richard Levitte (richard@levitte.org) for the OpenSSL |
3 | * project 2000. | 3 | * project 2000. |
4 | */ | 4 | */ |
@@ -131,6 +131,8 @@ LCRYPTO_ALIAS(NCONF_load_bio); | |||
131 | STACK_OF(CONF_VALUE) * | 131 | STACK_OF(CONF_VALUE) * |
132 | NCONF_get_section(const CONF *conf, const char *section) | 132 | NCONF_get_section(const CONF *conf, const char *section) |
133 | { | 133 | { |
134 | CONF_VALUE *v; | ||
135 | |||
134 | if (conf == NULL) { | 136 | if (conf == NULL) { |
135 | CONFerror(CONF_R_NO_CONF); | 137 | CONFerror(CONF_R_NO_CONF); |
136 | return NULL; | 138 | return NULL; |
@@ -141,7 +143,10 @@ NCONF_get_section(const CONF *conf, const char *section) | |||
141 | return NULL; | 143 | return NULL; |
142 | } | 144 | } |
143 | 145 | ||
144 | return _CONF_get_section_values(conf, section); | 146 | if ((v = _CONF_get_section(conf, section)) == NULL) |
147 | return NULL; | ||
148 | |||
149 | return (STACK_OF(CONF_VALUE) *)v->value; | ||
145 | } | 150 | } |
146 | LCRYPTO_ALIAS(NCONF_get_section); | 151 | LCRYPTO_ALIAS(NCONF_get_section); |
147 | 152 | ||
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 @@ | |||
1 | /* $OpenBSD: conf_local.h,v 1.9 2024/10/18 11:12:10 tb Exp $ */ | 1 | /* $OpenBSD: conf_local.h,v 1.10 2025/03/08 09:35:53 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 | * |
@@ -88,8 +88,6 @@ void CONF_set_nconf(CONF *conf, LHASH_OF(CONF_VALUE) *hash); | |||
88 | 88 | ||
89 | CONF_VALUE *_CONF_new_section(CONF *conf, const char *section); | 89 | CONF_VALUE *_CONF_new_section(CONF *conf, const char *section); |
90 | CONF_VALUE *_CONF_get_section(const CONF *conf, const char *section); | 90 | CONF_VALUE *_CONF_get_section(const CONF *conf, const char *section); |
91 | STACK_OF(CONF_VALUE) *_CONF_get_section_values(const CONF *conf, | ||
92 | const char *section); | ||
93 | 91 | ||
94 | int _CONF_add_string(CONF *conf, CONF_VALUE *section, CONF_VALUE *value); | 92 | int _CONF_add_string(CONF *conf, CONF_VALUE *section, CONF_VALUE *value); |
95 | char *_CONF_get_string(const CONF *conf, const char *section, | 93 | char *_CONF_get_string(const CONF *conf, const char *section, |