From f102b9743db6530d8ff84da213453d09cba8e7f1 Mon Sep 17 00:00:00 2001 From: tb Date: Sat, 31 Aug 2024 09:29:03 +0000 Subject: [PATCH] Retire conf_api.h and the API therein This makes the _CONF_* layer of the conf module internal and gets rid of the entirely unused conf_api.h. ok beck jsing --- lib/libcrypto/Makefile | 3 +- lib/libcrypto/Symbols.list | 7 -- lib/libcrypto/conf/conf_api.c | 10 +-- lib/libcrypto/conf/conf_api.h | 87 ------------------------- lib/libcrypto/conf/conf_def.c | 3 +- lib/libcrypto/conf/conf_lib.c | 3 +- lib/libcrypto/conf/conf_local.h | 14 +++- lib/libcrypto/hidden/openssl/conf_api.h | 36 ---------- 8 files changed, 17 insertions(+), 146 deletions(-) delete mode 100644 lib/libcrypto/conf/conf_api.h delete mode 100644 lib/libcrypto/hidden/openssl/conf_api.h diff --git a/lib/libcrypto/Makefile b/lib/libcrypto/Makefile index e71f8b4bf43..090589559e7 100644 --- a/lib/libcrypto/Makefile +++ b/lib/libcrypto/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.204 2024/08/31 09:21:44 tb Exp $ +# $OpenBSD: Makefile,v 1.205 2024/08/31 09:29:03 tb Exp $ LIB= crypto LIBREBUILD=y @@ -682,7 +682,6 @@ HDRS=\ ${LCRYPTO_SRC}/cms/cms.h \ ${LCRYPTO_SRC}/comp/comp.h \ ${LCRYPTO_SRC}/conf/conf.h \ - ${LCRYPTO_SRC}/conf/conf_api.h \ ${LCRYPTO_SRC}/crypto.h \ ${LCRYPTO_SRC}/ct/ct.h \ ${LCRYPTO_SRC}/curve25519/curve25519.h \ diff --git a/lib/libcrypto/Symbols.list b/lib/libcrypto/Symbols.list index 20abe2588f2..e20601a2cc6 100644 --- a/lib/libcrypto/Symbols.list +++ b/lib/libcrypto/Symbols.list @@ -2873,13 +2873,6 @@ X509v3_get_ext_by_OBJ X509v3_get_ext_by_critical X509v3_get_ext_count ZLONG_it -_CONF_add_string -_CONF_free_data -_CONF_get_section -_CONF_get_section_values -_CONF_get_string -_CONF_new_data -_CONF_new_section a2d_ASN1_OBJECT a2i_ASN1_ENUMERATED a2i_ASN1_INTEGER diff --git a/lib/libcrypto/conf/conf_api.c b/lib/libcrypto/conf/conf_api.c index 348c4ff7443..d00c698148f 100644 --- a/lib/libcrypto/conf/conf_api.c +++ b/lib/libcrypto/conf/conf_api.c @@ -1,4 +1,4 @@ -/* $OpenBSD: conf_api.c,v 1.20 2024/08/31 09:21:44 tb Exp $ */ +/* $OpenBSD: conf_api.c,v 1.21 2024/08/31 09:29:03 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -67,7 +67,6 @@ #include #include #include -#include #include "conf_local.h" @@ -91,7 +90,6 @@ _CONF_get_section(const CONF *conf, const char *section) v = lh_CONF_VALUE_retrieve(conf->data, &vv); return (v); } -LCRYPTO_ALIAS(_CONF_get_section); /* Up until OpenSSL 0.9.5a, this was CONF_get_section */ STACK_OF(CONF_VALUE) * @@ -105,7 +103,6 @@ _CONF_get_section_values(const CONF *conf, const char *section) else return (NULL); } -LCRYPTO_ALIAS(_CONF_get_section_values); int _CONF_add_string(CONF *conf, CONF_VALUE *section, CONF_VALUE *value) @@ -129,7 +126,6 @@ _CONF_add_string(CONF *conf, CONF_VALUE *section, CONF_VALUE *value) } return 1; } -LCRYPTO_ALIAS(_CONF_add_string); char * _CONF_get_string(const CONF *conf, const char *section, const char *name) @@ -156,7 +152,6 @@ _CONF_get_string(const CONF *conf, const char *section, const char *name) } else return (NULL); } -LCRYPTO_ALIAS(_CONF_get_string); static unsigned long conf_value_hash(const CONF_VALUE *v) @@ -199,7 +194,6 @@ _CONF_new_data(CONF *conf) } return 1; } -LCRYPTO_ALIAS(_CONF_new_data); void _CONF_free_data(CONF *conf) @@ -217,7 +211,6 @@ _CONF_free_data(CONF *conf) lh_CONF_VALUE_doall(conf->data, LHASH_DOALL_FN(value_free_stack)); lh_CONF_VALUE_free(conf->data); } -LCRYPTO_ALIAS(_CONF_free_data); static void value_free_hash_doall_arg(CONF_VALUE *a, LHASH_OF(CONF_VALUE) *conf) @@ -282,4 +275,3 @@ err: } return (v); } -LCRYPTO_ALIAS(_CONF_new_section); diff --git a/lib/libcrypto/conf/conf_api.h b/lib/libcrypto/conf/conf_api.h deleted file mode 100644 index 2793e8413b5..00000000000 --- a/lib/libcrypto/conf/conf_api.h +++ /dev/null @@ -1,87 +0,0 @@ -/* $OpenBSD: conf_api.h,v 1.5 2024/05/19 07:12:50 jsg Exp $ */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_CONF_API_H -#define HEADER_CONF_API_H - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* Up until OpenSSL 0.9.5a, this was new_section */ -CONF_VALUE *_CONF_new_section(CONF *conf, const char *section); -/* Up until OpenSSL 0.9.5a, this was get_section */ -CONF_VALUE *_CONF_get_section(const CONF *conf, const char *section); -/* 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); - -int _CONF_add_string(CONF *conf, CONF_VALUE *section, CONF_VALUE *value); -char *_CONF_get_string(const CONF *conf, const char *section, - const char *name); - -int _CONF_new_data(CONF *conf); -void _CONF_free_data(CONF *conf); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/lib/libcrypto/conf/conf_def.c b/lib/libcrypto/conf/conf_def.c index 4c644055a23..d796b8454e8 100644 --- a/lib/libcrypto/conf/conf_def.c +++ b/lib/libcrypto/conf/conf_def.c @@ -1,4 +1,4 @@ -/* $OpenBSD: conf_def.c,v 1.38 2024/08/31 09:21:44 tb Exp $ */ +/* $OpenBSD: conf_def.c,v 1.39 2024/08/31 09:29:03 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -63,7 +63,6 @@ #include #include -#include #include #include #include diff --git a/lib/libcrypto/conf/conf_lib.c b/lib/libcrypto/conf/conf_lib.c index abeea5588f6..ccd09c02586 100644 --- a/lib/libcrypto/conf/conf_lib.c +++ b/lib/libcrypto/conf/conf_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: conf_lib.c,v 1.20 2024/08/31 09:26:18 tb Exp $ */ +/* $OpenBSD: conf_lib.c,v 1.21 2024/08/31 09:29:03 tb Exp $ */ /* Written by Richard Levitte (richard@levitte.org) for the OpenSSL * project 2000. */ @@ -60,7 +60,6 @@ #include #include #include -#include #include #include "conf_local.h" diff --git a/lib/libcrypto/conf/conf_local.h b/lib/libcrypto/conf/conf_local.h index cf5941ed509..c991f0629b9 100644 --- a/lib/libcrypto/conf/conf_local.h +++ b/lib/libcrypto/conf/conf_local.h @@ -1,4 +1,4 @@ -/* $OpenBSD: conf_local.h,v 1.2 2024/08/31 09:26:18 tb Exp $ */ +/* $OpenBSD: conf_local.h,v 1.3 2024/08/31 09:29:03 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -90,6 +90,18 @@ void CONF_module_set_usr_data(CONF_MODULE *pmod, void *usr_data); int CONF_parse_list(const char *list, int sep, int nospc, int (*list_cb)(const char *elem, int len, void *usr), void *arg); +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, + const char *name); + +int _CONF_new_data(CONF *conf); +void _CONF_free_data(CONF *conf); + __END_HIDDEN_DECLS #endif /* HEADER_CONF_LOCAL_H */ diff --git a/lib/libcrypto/hidden/openssl/conf_api.h b/lib/libcrypto/hidden/openssl/conf_api.h deleted file mode 100644 index 5ff89566164..00000000000 --- a/lib/libcrypto/hidden/openssl/conf_api.h +++ /dev/null @@ -1,36 +0,0 @@ -/* $OpenBSD: conf_api.h,v 1.1 2023/07/08 08:26:26 beck Exp $ */ -/* - * Copyright (c) 2023 Bob Beck - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef _LIBCRYPTO_CONF_API_H -#define _LIBCRYPTO_CONF_API_H - -#ifndef _MSC_VER -#include_next -#else -#include "../include/openssl/conf_api.h" -#endif -#include "crypto_namespace.h" - -LCRYPTO_USED(_CONF_new_section); -LCRYPTO_USED(_CONF_get_section); -LCRYPTO_USED(_CONF_get_section_values); -LCRYPTO_USED(_CONF_add_string); -LCRYPTO_USED(_CONF_get_string); -LCRYPTO_USED(_CONF_new_data); -LCRYPTO_USED(_CONF_free_data); - -#endif /* _LIBCRYPTO_CONF_API_H */ -- 2.20.1