From bbdd77aade04cbb360e8984b202712e98995c895 Mon Sep 17 00:00:00 2001 From: beck Date: Tue, 9 Apr 2024 13:56:29 +0000 Subject: [PATCH] Hide symbols in conf.h This guentherizes the public symbols from conf.h ok tb@ --- lib/libcrypto/Symbols.namespace | 45 +++++++++++++++++++++++++++++++++ lib/libcrypto/conf/conf_def.c | 4 ++- lib/libcrypto/conf/conf_err.c | 3 ++- lib/libcrypto/conf/conf_lib.c | 24 +++++++++++++++++- lib/libcrypto/conf/conf_mall.c | 3 ++- lib/libcrypto/conf/conf_mod.c | 19 +++++++++++++- lib/libcrypto/conf/conf_sap.c | 4 ++- 7 files changed, 96 insertions(+), 6 deletions(-) diff --git a/lib/libcrypto/Symbols.namespace b/lib/libcrypto/Symbols.namespace index dfeff2e763f..210efc27707 100644 --- a/lib/libcrypto/Symbols.namespace +++ b/lib/libcrypto/Symbols.namespace @@ -3103,3 +3103,48 @@ _libre_PKCS8_pkey_get0_attrs _libre_PKCS8_pkey_add1_attr_by_NID _libre_X509_PUBKEY_set0_param _libre_X509_PUBKEY_get0_param +_libre_CONF_set_default_method +_libre_CONF_set_nconf +_libre_CONF_load +_libre_CONF_load_fp +_libre_CONF_load_bio +_libre_CONF_get_section +_libre_CONF_get_string +_libre_CONF_get_number +_libre_CONF_free +_libre_CONF_dump_fp +_libre_CONF_dump_bio +_libre_OPENSSL_config +_libre_OPENSSL_no_config +_libre_NCONF_new +_libre_NCONF_default +_libre_NCONF_WIN32 +_libre_NCONF_free +_libre_NCONF_free_data +_libre_NCONF_load +_libre_NCONF_load_fp +_libre_NCONF_load_bio +_libre_NCONF_get_section +_libre_NCONF_get_string +_libre_NCONF_get_number_e +_libre_NCONF_dump_fp +_libre_NCONF_dump_bio +_libre_CONF_modules_load +_libre_CONF_modules_load_file +_libre_CONF_modules_unload +_libre_CONF_modules_finish +_libre_CONF_modules_free +_libre_CONF_module_add +_libre_CONF_imodule_get_name +_libre_CONF_imodule_get_value +_libre_CONF_imodule_get_usr_data +_libre_CONF_imodule_set_usr_data +_libre_CONF_imodule_get_module +_libre_CONF_imodule_get_flags +_libre_CONF_imodule_set_flags +_libre_CONF_module_get_usr_data +_libre_CONF_module_set_usr_data +_libre_CONF_get1_default_config_file +_libre_CONF_parse_list +_libre_OPENSSL_load_builtin_modules +_libre_ERR_load_CONF_strings diff --git a/lib/libcrypto/conf/conf_def.c b/lib/libcrypto/conf/conf_def.c index f2b2c9477b0..dbd2e6a2eb3 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.33 2020/02/17 12:51:48 inoguchi Exp $ */ +/* $OpenBSD: conf_def.c,v 1.34 2024/04/09 13:56:30 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -122,12 +122,14 @@ NCONF_default(void) { return &default_method; } +LCRYPTO_ALIAS(NCONF_default); CONF_METHOD * NCONF_WIN32(void) { return &WIN32_method; } +LCRYPTO_ALIAS(NCONF_WIN32); static CONF * def_create(CONF_METHOD *meth) diff --git a/lib/libcrypto/conf/conf_err.c b/lib/libcrypto/conf/conf_err.c index e6c707ab31c..9a44f22fa2f 100644 --- a/lib/libcrypto/conf/conf_err.c +++ b/lib/libcrypto/conf/conf_err.c @@ -1,4 +1,4 @@ -/* $OpenBSD: conf_err.c,v 1.15 2022/07/12 14:42:48 kn Exp $ */ +/* $OpenBSD: conf_err.c,v 1.16 2024/04/09 13:56:30 beck Exp $ */ /* ==================================================================== * Copyright (c) 1999-2007 The OpenSSL Project. All rights reserved. * @@ -103,3 +103,4 @@ ERR_load_CONF_strings(void) } #endif } +LCRYPTO_ALIAS(ERR_load_CONF_strings); diff --git a/lib/libcrypto/conf/conf_lib.c b/lib/libcrypto/conf/conf_lib.c index 2e4228bbe5d..d1c85dc0986 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.16 2024/01/28 21:00:54 tb Exp $ */ +/* $OpenBSD: conf_lib.c,v 1.17 2024/04/09 13:56:30 beck Exp $ */ /* Written by Richard Levitte (richard@levitte.org) for the OpenSSL * project 2000. */ @@ -75,6 +75,7 @@ CONF_set_nconf(CONF *conf, LHASH_OF(CONF_VALUE) *hash) default_CONF_method->init(conf); conf->data = hash; } +LCRYPTO_ALIAS(CONF_set_nconf); /* The following section contains the "CONF classic" functions, rewritten in terms of the new CONF interface. */ @@ -85,6 +86,7 @@ CONF_set_default_method(CONF_METHOD *meth) default_CONF_method = meth; return 1; } +LCRYPTO_ALIAS(CONF_set_default_method); LHASH_OF(CONF_VALUE) * CONF_load(LHASH_OF(CONF_VALUE) *conf, const char *file, long *eline) @@ -103,6 +105,7 @@ CONF_load(LHASH_OF(CONF_VALUE) *conf, const char *file, long *eline) return ltmp; } +LCRYPTO_ALIAS(CONF_load); LHASH_OF(CONF_VALUE) * CONF_load_fp(LHASH_OF(CONF_VALUE) *conf, FILE *fp, long *eline) @@ -118,6 +121,7 @@ CONF_load_fp(LHASH_OF(CONF_VALUE) *conf, FILE *fp, long *eline) BIO_free(btmp); return ltmp; } +LCRYPTO_ALIAS(CONF_load_fp); LHASH_OF(CONF_VALUE) * CONF_load_bio(LHASH_OF(CONF_VALUE) *conf, BIO *bp, long *eline) @@ -132,6 +136,7 @@ CONF_load_bio(LHASH_OF(CONF_VALUE) *conf, BIO *bp, long *eline) return ctmp.data; return NULL; } +LCRYPTO_ALIAS(CONF_load_bio); STACK_OF(CONF_VALUE) * CONF_get_section(LHASH_OF(CONF_VALUE) *conf, const char *section) @@ -144,6 +149,7 @@ CONF_get_section(LHASH_OF(CONF_VALUE) *conf, const char *section) return NCONF_get_section(&ctmp, section); } } +LCRYPTO_ALIAS(CONF_get_section); char * CONF_get_string(LHASH_OF(CONF_VALUE) *conf, const char *group, @@ -157,6 +163,7 @@ CONF_get_string(LHASH_OF(CONF_VALUE) *conf, const char *group, return NCONF_get_string(&ctmp, group, name); } } +LCRYPTO_ALIAS(CONF_get_string); long CONF_get_number(LHASH_OF(CONF_VALUE) *conf, const char *group, @@ -179,6 +186,7 @@ CONF_get_number(LHASH_OF(CONF_VALUE) *conf, const char *group, } return result; } +LCRYPTO_ALIAS(CONF_get_number); void CONF_free(LHASH_OF(CONF_VALUE) *conf) @@ -188,6 +196,7 @@ CONF_free(LHASH_OF(CONF_VALUE) *conf) CONF_set_nconf(&ctmp, conf); NCONF_free_data(&ctmp); } +LCRYPTO_ALIAS(CONF_free); int CONF_dump_fp(LHASH_OF(CONF_VALUE) *conf, FILE *out) @@ -203,6 +212,7 @@ CONF_dump_fp(LHASH_OF(CONF_VALUE) *conf, FILE *out) BIO_free(btmp); return ret; } +LCRYPTO_ALIAS(CONF_dump_fp); int CONF_dump_bio(LHASH_OF(CONF_VALUE) *conf, BIO *out) @@ -212,6 +222,7 @@ CONF_dump_bio(LHASH_OF(CONF_VALUE) *conf, BIO *out) CONF_set_nconf(&ctmp, conf); return NCONF_dump_bio(&ctmp, out); } +LCRYPTO_ALIAS(CONF_dump_bio); /* The following section contains the "New CONF" functions. They are completely centralised around a new CONF structure that may contain @@ -235,6 +246,7 @@ NCONF_new(CONF_METHOD *meth) return ret; } +LCRYPTO_ALIAS(NCONF_new); void NCONF_free(CONF *conf) @@ -243,6 +255,7 @@ NCONF_free(CONF *conf) return; conf->meth->destroy(conf); } +LCRYPTO_ALIAS(NCONF_free); void NCONF_free_data(CONF *conf) @@ -251,6 +264,7 @@ NCONF_free_data(CONF *conf) return; conf->meth->destroy_data(conf); } +LCRYPTO_ALIAS(NCONF_free_data); int NCONF_load(CONF *conf, const char *file, long *eline) @@ -262,6 +276,7 @@ NCONF_load(CONF *conf, const char *file, long *eline) return conf->meth->load(conf, file, eline); } +LCRYPTO_ALIAS(NCONF_load); int NCONF_load_fp(CONF *conf, FILE *fp, long *eline) @@ -277,6 +292,7 @@ NCONF_load_fp(CONF *conf, FILE *fp, long *eline) BIO_free(btmp); return ret; } +LCRYPTO_ALIAS(NCONF_load_fp); int NCONF_load_bio(CONF *conf, BIO *bp, long *eline) @@ -288,6 +304,7 @@ NCONF_load_bio(CONF *conf, BIO *bp, long *eline) return conf->meth->load_bio(conf, bp, eline); } +LCRYPTO_ALIAS(NCONF_load_bio); STACK_OF(CONF_VALUE) * NCONF_get_section(const CONF *conf, const char *section) @@ -304,6 +321,7 @@ NCONF_get_section(const CONF *conf, const char *section) return _CONF_get_section_values(conf, section); } +LCRYPTO_ALIAS(NCONF_get_section); char * NCONF_get_string(const CONF *conf, const char *group, const char *name) @@ -324,6 +342,7 @@ NCONF_get_string(const CONF *conf, const char *group, const char *name) group ? group : "", name); return NULL; } +LCRYPTO_ALIAS(NCONF_get_string); int NCONF_get_number_e(const CONF *conf, const char *group, const char *name, @@ -348,6 +367,7 @@ NCONF_get_number_e(const CONF *conf, const char *group, const char *name, return 1; } +LCRYPTO_ALIAS(NCONF_get_number_e); int NCONF_dump_fp(const CONF *conf, FILE *out) @@ -362,6 +382,7 @@ NCONF_dump_fp(const CONF *conf, FILE *out) BIO_free(btmp); return ret; } +LCRYPTO_ALIAS(NCONF_dump_fp); int NCONF_dump_bio(const CONF *conf, BIO *out) @@ -373,3 +394,4 @@ NCONF_dump_bio(const CONF *conf, BIO *out) return conf->meth->dump(conf, out); } +LCRYPTO_ALIAS(NCONF_dump_bio); diff --git a/lib/libcrypto/conf/conf_mall.c b/lib/libcrypto/conf/conf_mall.c index 141c0abefdc..6a3d180f9c9 100644 --- a/lib/libcrypto/conf/conf_mall.c +++ b/lib/libcrypto/conf/conf_mall.c @@ -1,4 +1,4 @@ -/* $OpenBSD: conf_mall.c,v 1.11 2024/03/02 09:02:04 tb Exp $ */ +/* $OpenBSD: conf_mall.c,v 1.12 2024/04/09 13:56:30 beck Exp $ */ /* Written by Stephen Henson (steve@openssl.org) for the OpenSSL * project 2001. */ @@ -67,3 +67,4 @@ OPENSSL_load_builtin_modules(void) /* Add builtin modules here */ ASN1_add_oid_module(); } +LCRYPTO_ALIAS(OPENSSL_load_builtin_modules); diff --git a/lib/libcrypto/conf/conf_mod.c b/lib/libcrypto/conf/conf_mod.c index 85d74e6fb62..4bde9eb3765 100644 --- a/lib/libcrypto/conf/conf_mod.c +++ b/lib/libcrypto/conf/conf_mod.c @@ -1,4 +1,4 @@ -/* $OpenBSD: conf_mod.c,v 1.37 2024/03/26 00:24:11 tb Exp $ */ +/* $OpenBSD: conf_mod.c,v 1.38 2024/04/09 13:56:30 beck Exp $ */ /* Written by Stephen Henson (steve@openssl.org) for the OpenSSL * project 2001. */ @@ -147,6 +147,7 @@ CONF_modules_load(const CONF *cnf, const char *appname, unsigned long flags) return 1; } +LCRYPTO_ALIAS(CONF_modules_load); int CONF_modules_load_file(const char *filename, const char *appname, @@ -185,6 +186,7 @@ err: return ret; } +LCRYPTO_ALIAS(CONF_modules_load_file); static int module_run(const CONF *cnf, char *name, char *value, unsigned long flags) @@ -352,6 +354,7 @@ CONF_modules_unload(int all) supported_modules = NULL; } } +LCRYPTO_ALIAS(CONF_modules_unload); /* unload a single module */ static void @@ -389,6 +392,7 @@ CONF_modules_finish(void) sk_CONF_IMODULE_free(initialized_modules); initialized_modules = NULL; } +LCRYPTO_ALIAS(CONF_modules_finish); /* finish a module instance */ @@ -409,6 +413,7 @@ CONF_module_add(const char *name, conf_init_func *ifunc, conf_finish_func *ffunc { return module_add(name, ifunc, ffunc); } +LCRYPTO_ALIAS(CONF_module_add); void CONF_modules_free(void) @@ -416,6 +421,7 @@ CONF_modules_free(void) CONF_modules_finish(); CONF_modules_unload(1); } +LCRYPTO_ALIAS(CONF_modules_free); /* Utility functions */ @@ -424,54 +430,63 @@ CONF_imodule_get_name(const CONF_IMODULE *imod) { return imod->name; } +LCRYPTO_ALIAS(CONF_imodule_get_name); const char * CONF_imodule_get_value(const CONF_IMODULE *imod) { return imod->value; } +LCRYPTO_ALIAS(CONF_imodule_get_value); void * CONF_imodule_get_usr_data(const CONF_IMODULE *imod) { return imod->usr_data; } +LCRYPTO_ALIAS(CONF_imodule_get_usr_data); void CONF_imodule_set_usr_data(CONF_IMODULE *imod, void *usr_data) { imod->usr_data = usr_data; } +LCRYPTO_ALIAS(CONF_imodule_set_usr_data); CONF_MODULE * CONF_imodule_get_module(const CONF_IMODULE *imod) { return imod->mod; } +LCRYPTO_ALIAS(CONF_imodule_get_module); unsigned long CONF_imodule_get_flags(const CONF_IMODULE *imod) { return imod->flags; } +LCRYPTO_ALIAS(CONF_imodule_get_flags); void CONF_imodule_set_flags(CONF_IMODULE *imod, unsigned long flags) { imod->flags = flags; } +LCRYPTO_ALIAS(CONF_imodule_set_flags); void * CONF_module_get_usr_data(CONF_MODULE *mod) { return mod->usr_data; } +LCRYPTO_ALIAS(CONF_module_get_usr_data); void CONF_module_set_usr_data(CONF_MODULE *mod, void *usr_data) { mod->usr_data = usr_data; } +LCRYPTO_ALIAS(CONF_module_set_usr_data); /* Return default config file name */ @@ -485,6 +500,7 @@ CONF_get1_default_config_file(void) return (NULL); return file; } +LCRYPTO_ALIAS(CONF_get1_default_config_file); /* This function takes a list separated by 'sep' and calls the * callback function giving the start and length of each member @@ -531,3 +547,4 @@ CONF_parse_list(const char *list_, int sep, int nospc, lstart = p + 1; } } +LCRYPTO_ALIAS(CONF_parse_list); diff --git a/lib/libcrypto/conf/conf_sap.c b/lib/libcrypto/conf/conf_sap.c index 689b7a325d2..3a0bf96df8d 100644 --- a/lib/libcrypto/conf/conf_sap.c +++ b/lib/libcrypto/conf/conf_sap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: conf_sap.c,v 1.15 2023/11/19 15:46:09 tb Exp $ */ +/* $OpenBSD: conf_sap.c,v 1.16 2024/04/09 13:56:30 beck Exp $ */ /* Written by Stephen Henson (steve@openssl.org) for the OpenSSL * project 2001. */ @@ -124,6 +124,7 @@ OPENSSL_config(const char *config_name) { (void) OpenSSL_config(config_name); } +LCRYPTO_ALIAS(OPENSSL_config); static void OPENSSL_no_config_internal(void) @@ -144,3 +145,4 @@ OPENSSL_no_config(void) { (void) OpenSSL_no_config(); } +LCRYPTO_ALIAS(OPENSSL_no_config); -- 2.20.1