diff options
author | Bob Beck <beck@cvs.openbsd.org> | 2024-04-10 14:51:03 +0000 |
---|---|---|
committer | Bob Beck <beck@cvs.openbsd.org> | 2024-04-10 14:51:03 +0000 |
commit | b359025bc0a8e06d5fe97c68761c02d3f570b145 (patch) | |
tree | a23ed1a1bfe8cfa8ccd72ff5b9edc0af8290eab7 /lib | |
parent | 895c031c42572ba0e27433a5f5ae860aaa0a6c81 (diff) |
Finish Hiding symbols in crypto.h
crypto.h already had the symbols not hidden behind LIBRESSL_INTERNAL
hidden - This now picks up the reset of them marking them as
LCRYPTO_UNUSED, and removes the LIBRESSL_INTERNAL guard.
These symbols will now be hidden, but if we use them inside
the library in a namespaced build we will get a deprecation
warning. use outside the library will be as with any other hidden
symbol, so fine.
ok tb@
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libcrypto/Symbols.namespace | 31 | ||||
-rw-r--r-- | lib/libcrypto/cryptlib.c | 25 | ||||
-rw-r--r-- | lib/libcrypto/crypto.h | 12 | ||||
-rw-r--r-- | lib/libcrypto/crypto_init.c | 3 | ||||
-rw-r--r-- | lib/libcrypto/hidden/openssl/crypto.h | 33 | ||||
-rw-r--r-- | lib/libcrypto/malloc-wrapper.c | 5 | ||||
-rw-r--r-- | lib/libcrypto/mem_clr.c | 3 | ||||
-rw-r--r-- | lib/libcrypto/mem_dbg.c | 3 | ||||
-rw-r--r-- | lib/libcrypto/o_fips.c | 4 |
9 files changed, 101 insertions, 18 deletions
diff --git a/lib/libcrypto/Symbols.namespace b/lib/libcrypto/Symbols.namespace index 210efc27707..0f44808bbc0 100644 --- a/lib/libcrypto/Symbols.namespace +++ b/lib/libcrypto/Symbols.namespace @@ -3148,3 +3148,34 @@ _libre_CONF_get1_default_config_file _libre_CONF_parse_list _libre_OPENSSL_load_builtin_modules _libre_ERR_load_CONF_strings +_libre_CRYPTO_mem_ctrl +_libre_CRYPTO_set_id_callback +_libre_CRYPTO_get_id_callback +_libre_CRYPTO_thread_id +_libre_CRYPTO_get_new_lockid +_libre_CRYPTO_get_lock_name +_libre_CRYPTO_num_locks +_libre_CRYPTO_set_locking_callback +_libre_CRYPTO_get_locking_callback +_libre_CRYPTO_set_add_lock_callback +_libre_CRYPTO_get_add_lock_callback +_libre_CRYPTO_THREADID_set_numeric +_libre_CRYPTO_THREADID_set_pointer +_libre_CRYPTO_THREADID_set_callback +_libre_CRYPTO_THREADID_get_callback +_libre_CRYPTO_get_new_dynlockid +_libre_CRYPTO_destroy_dynlockid +_libre_CRYPTO_get_dynlock_value +_libre_CRYPTO_set_dynlock_create_callback +_libre_CRYPTO_set_dynlock_lock_callback +_libre_CRYPTO_set_dynlock_destroy_callback +_libre_CRYPTO_get_dynlock_lock_callback +_libre_CRYPTO_get_dynlock_destroy_callback +_libre_CRYPTO_malloc +_libre_CRYPTO_strdup +_libre_CRYPTO_free +_libre_OPENSSL_cleanse +_libre_FIPS_mode +_libre_FIPS_mode_set +_libre_OPENSSL_init +_libre_CRYPTO_memcmp diff --git a/lib/libcrypto/cryptlib.c b/lib/libcrypto/cryptlib.c index 9eef0348eb1..ae3df35f52a 100644 --- a/lib/libcrypto/cryptlib.c +++ b/lib/libcrypto/cryptlib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cryptlib.c,v 1.49 2024/03/24 06:48:03 tb Exp $ */ +/* $OpenBSD: cryptlib.c,v 1.50 2024/04/10 14:51:02 beck Exp $ */ /* ==================================================================== * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. * @@ -136,24 +136,28 @@ CRYPTO_num_locks(void) { return 1; } +LCRYPTO_ALIAS(CRYPTO_num_locks); unsigned long (*CRYPTO_get_id_callback(void))(void) { return NULL; } +LCRYPTO_ALIAS(CRYPTO_get_id_callback); void CRYPTO_set_id_callback(unsigned long (*func)(void)) { return; } +LCRYPTO_ALIAS(CRYPTO_set_id_callback); unsigned long CRYPTO_thread_id(void) { return (unsigned long)pthread_self(); } +LCRYPTO_ALIAS(CRYPTO_thread_id); void CRYPTO_set_locking_callback(void (*func)(int mode, int lock_num, @@ -161,6 +165,7 @@ CRYPTO_set_locking_callback(void (*func)(int mode, int lock_num, { locking_callback = func; } +LCRYPTO_ALIAS(CRYPTO_set_locking_callback); void (*CRYPTO_get_locking_callback(void))(int mode, int lock_num, @@ -168,6 +173,7 @@ void { return locking_callback; } +LCRYPTO_ALIAS(CRYPTO_get_locking_callback); void CRYPTO_set_add_lock_callback(int (*func)(int *num, int mount, int lock_num, @@ -175,6 +181,7 @@ CRYPTO_set_add_lock_callback(int (*func)(int *num, int mount, int lock_num, { add_lock_callback = func; } +LCRYPTO_ALIAS(CRYPTO_set_add_lock_callback); int (*CRYPTO_get_add_lock_callback(void))(int *num, int mount, int type, @@ -182,58 +189,68 @@ int { return add_lock_callback; } +LCRYPTO_ALIAS(CRYPTO_get_add_lock_callback); const char * CRYPTO_get_lock_name(int lock_num) { return ""; } +LCRYPTO_ALIAS(CRYPTO_get_lock_name); struct CRYPTO_dynlock_value * CRYPTO_get_dynlock_value(int i) { return NULL; } +LCRYPTO_ALIAS(CRYPTO_get_dynlock_value); int CRYPTO_get_new_dynlockid(void) { return 0; } +LCRYPTO_ALIAS(CRYPTO_get_new_dynlockid); void CRYPTO_destroy_dynlockid(int i) { return; } +LCRYPTO_ALIAS(CRYPTO_destroy_dynlockid); int CRYPTO_get_new_lockid(char *name) { return 0; } +LCRYPTO_ALIAS(CRYPTO_get_new_lockid); int CRYPTO_THREADID_set_callback(void (*func)(CRYPTO_THREADID *)) { return 1; } +LCRYPTO_ALIAS(CRYPTO_THREADID_set_callback); void (*CRYPTO_THREADID_get_callback(void))(CRYPTO_THREADID *) { return NULL; } +LCRYPTO_ALIAS(CRYPTO_THREADID_get_callback); void CRYPTO_THREADID_set_numeric(CRYPTO_THREADID *id, unsigned long val) { return; } +LCRYPTO_ALIAS(CRYPTO_THREADID_set_numeric); void CRYPTO_THREADID_set_pointer(CRYPTO_THREADID *id, void *ptr) { return; } +LCRYPTO_ALIAS(CRYPTO_THREADID_set_pointer); void CRYPTO_set_dynlock_create_callback(struct CRYPTO_dynlock_value *( @@ -241,6 +258,7 @@ CRYPTO_set_dynlock_create_callback(struct CRYPTO_dynlock_value *( { return; } +LCRYPTO_ALIAS(CRYPTO_set_dynlock_create_callback); void CRYPTO_set_dynlock_lock_callback(void (*dyn_lock_function)( @@ -248,6 +266,7 @@ CRYPTO_set_dynlock_lock_callback(void (*dyn_lock_function)( { return; } +LCRYPTO_ALIAS(CRYPTO_set_dynlock_lock_callback); void CRYPTO_set_dynlock_destroy_callback(void (*dyn_destroy_function)( @@ -255,6 +274,7 @@ CRYPTO_set_dynlock_destroy_callback(void (*dyn_destroy_function)( { return; } +LCRYPTO_ALIAS(CRYPTO_set_dynlock_destroy_callback); struct CRYPTO_dynlock_value * (*CRYPTO_get_dynlock_create_callback(void))( @@ -269,6 +289,7 @@ void { return NULL; } +LCRYPTO_ALIAS(CRYPTO_get_dynlock_lock_callback); void (*CRYPTO_get_dynlock_destroy_callback(void))( @@ -276,6 +297,7 @@ void { return NULL; } +LCRYPTO_ALIAS(CRYPTO_get_dynlock_destroy_callback); void CRYPTO_THREADID_current(CRYPTO_THREADID *id) @@ -380,3 +402,4 @@ CRYPTO_memcmp(const void *in_a, const void *in_b, size_t len) return x; } +LCRYPTO_ALIAS(CRYPTO_memcmp); diff --git a/lib/libcrypto/crypto.h b/lib/libcrypto/crypto.h index d6ea7771cf4..aad88aef079 100644 --- a/lib/libcrypto/crypto.h +++ b/lib/libcrypto/crypto.h @@ -1,4 +1,4 @@ -/* $OpenBSD: crypto.h,v 1.72 2024/03/02 15:40:05 tb Exp $ */ +/* $OpenBSD: crypto.h,v 1.73 2024/04/10 14:51:02 beck Exp $ */ /* ==================================================================== * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. * @@ -262,7 +262,6 @@ DECLARE_STACK_OF(void) #define CRYPTO_EX_INDEX_X509_STORE_CTX 14 #define CRYPTO_EX_INDEX__COUNT 15 -#ifndef LIBRESSL_INTERNAL #define CRYPTO_malloc_init() (0) #define CRYPTO_malloc_debug_init() (0) @@ -277,7 +276,6 @@ int CRYPTO_mem_ctrl(int mode); #define OPENSSL_malloc(num) CRYPTO_malloc((num),NULL,0) #define OPENSSL_strdup(str) CRYPTO_strdup((str),NULL,0) #define OPENSSL_free(addr) CRYPTO_free((addr),NULL,0) -#endif const char *OpenSSL_version(int type); #define OPENSSL_VERSION 0 @@ -316,7 +314,6 @@ int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file, /* Don't use this structure directly. */ typedef struct crypto_threadid_st CRYPTO_THREADID; -#ifndef LIBRESSL_INTERNAL /* These functions are deprecated no-op stubs */ void CRYPTO_set_id_callback(unsigned long (*func)(void)); unsigned long (*CRYPTO_get_id_callback(void))(void); @@ -349,7 +346,6 @@ void CRYPTO_set_dynlock_destroy_callback(void (*dyn_destroy_function)(struct CRY struct CRYPTO_dynlock_value *(*CRYPTO_get_dynlock_create_callback(void))(const char *file, int line); void (*CRYPTO_get_dynlock_lock_callback(void))(int mode, struct CRYPTO_dynlock_value *l, const char *file, int line); void (*CRYPTO_get_dynlock_destroy_callback(void))(struct CRYPTO_dynlock_value *l, const char *file, int line); -#endif /* CRYPTO_set_mem_functions includes CRYPTO_set_locked_mem_functions -- * call the latter last if you need different functions */ @@ -357,15 +353,11 @@ int CRYPTO_set_mem_functions(void *(*m)(size_t), void *(*r)(void *, size_t), voi int CRYPTO_set_mem_ex_functions(void *(*m)(size_t, const char *, int), void *(*r)(void *, size_t, const char *, int), void (*f)(void *)); -#ifndef LIBRESSL_INTERNAL void *CRYPTO_malloc(size_t num, const char *file, int line); char *CRYPTO_strdup(const char *str, const char *file, int line); void CRYPTO_free(void *ptr, const char *file, int line); -#endif -#ifndef LIBRESSL_INTERNAL void OPENSSL_cleanse(void *ptr, size_t len); -#endif /* * Because this is a public header, use a portable method of indicating the @@ -381,7 +373,6 @@ void OpenSSLDie(const char *file, int line, const char *assertion); uint64_t OPENSSL_cpu_caps(void); -#ifndef LIBRESSL_INTERNAL int FIPS_mode(void); int FIPS_mode_set(int r); @@ -393,7 +384,6 @@ void OPENSSL_init(void); * defined order as the return value when a != b is undefined, other than to be * non-zero. */ int CRYPTO_memcmp(const void *a, const void *b, size_t len); -#endif /* * OpenSSL compatible OPENSSL_INIT options. diff --git a/lib/libcrypto/crypto_init.c b/lib/libcrypto/crypto_init.c index 45210366395..d2d06f87df3 100644 --- a/lib/libcrypto/crypto_init.c +++ b/lib/libcrypto/crypto_init.c @@ -1,4 +1,4 @@ -/* $OpenBSD: crypto_init.c,v 1.20 2024/04/09 13:52:41 beck Exp $ */ +/* $OpenBSD: crypto_init.c,v 1.21 2024/04/10 14:51:02 beck Exp $ */ /* * Copyright (c) 2018 Bob Beck <beck@openbsd.org> * @@ -41,6 +41,7 @@ void OPENSSL_init(void) { } +LCRYPTO_ALIAS(OPENSSL_init); static void OPENSSL_init_crypto_internal(void) diff --git a/lib/libcrypto/hidden/openssl/crypto.h b/lib/libcrypto/hidden/openssl/crypto.h index 10daf41f574..fb1b215b96c 100644 --- a/lib/libcrypto/hidden/openssl/crypto.h +++ b/lib/libcrypto/hidden/openssl/crypto.h @@ -1,4 +1,4 @@ -/* $OpenBSD: crypto.h,v 1.6 2024/03/02 11:37:13 tb Exp $ */ +/* $OpenBSD: crypto.h,v 1.7 2024/04/10 14:51:02 beck Exp $ */ /* * Copyright (c) 2023 Bob Beck <beck@openbsd.org> * @@ -46,5 +46,36 @@ LCRYPTO_USED(OPENSSL_init_crypto); LCRYPTO_USED(OPENSSL_cleanup); LCRYPTO_USED(OPENSSL_gmtime); LCRYPTO_USED(ERR_load_CRYPTO_strings); +LCRYPTO_UNUSED(CRYPTO_mem_ctrl); +LCRYPTO_UNUSED(CRYPTO_set_id_callback); +LCRYPTO_UNUSED(CRYPTO_get_id_callback); +LCRYPTO_UNUSED(CRYPTO_thread_id); +LCRYPTO_UNUSED(CRYPTO_get_new_lockid); +LCRYPTO_UNUSED(CRYPTO_get_lock_name); +LCRYPTO_UNUSED(CRYPTO_num_locks); +LCRYPTO_UNUSED(CRYPTO_set_locking_callback); +LCRYPTO_UNUSED(CRYPTO_get_locking_callback); +LCRYPTO_UNUSED(CRYPTO_set_add_lock_callback); +LCRYPTO_UNUSED(CRYPTO_get_add_lock_callback); +LCRYPTO_UNUSED(CRYPTO_THREADID_set_numeric); +LCRYPTO_UNUSED(CRYPTO_THREADID_set_pointer); +LCRYPTO_UNUSED(CRYPTO_THREADID_set_callback); +LCRYPTO_UNUSED(CRYPTO_THREADID_get_callback); +LCRYPTO_UNUSED(CRYPTO_get_new_dynlockid); +LCRYPTO_UNUSED(CRYPTO_destroy_dynlockid); +LCRYPTO_UNUSED(CRYPTO_get_dynlock_value); +LCRYPTO_UNUSED(CRYPTO_set_dynlock_create_callback); +LCRYPTO_UNUSED(CRYPTO_set_dynlock_lock_callback); +LCRYPTO_UNUSED(CRYPTO_set_dynlock_destroy_callback); +LCRYPTO_UNUSED(CRYPTO_get_dynlock_lock_callback); +LCRYPTO_UNUSED(CRYPTO_get_dynlock_destroy_callback); +LCRYPTO_UNUSED(CRYPTO_malloc); +LCRYPTO_UNUSED(CRYPTO_strdup); +LCRYPTO_UNUSED(CRYPTO_free); +LCRYPTO_UNUSED(OPENSSL_cleanse); +LCRYPTO_UNUSED(FIPS_mode); +LCRYPTO_UNUSED(FIPS_mode_set); +LCRYPTO_UNUSED(OPENSSL_init); +LCRYPTO_UNUSED(CRYPTO_memcmp); #endif /* _LIBCRYPTO_CRYPTO_H */ diff --git a/lib/libcrypto/malloc-wrapper.c b/lib/libcrypto/malloc-wrapper.c index fb42169b2fa..7330903c6ca 100644 --- a/lib/libcrypto/malloc-wrapper.c +++ b/lib/libcrypto/malloc-wrapper.c @@ -1,4 +1,4 @@ -/* $OpenBSD: malloc-wrapper.c,v 1.10 2024/03/02 11:35:09 tb Exp $ */ +/* $OpenBSD: malloc-wrapper.c,v 1.11 2024/04/10 14:51:02 beck Exp $ */ /* * Copyright (c) 2014 Bob Beck * @@ -41,15 +41,18 @@ CRYPTO_malloc(size_t num, const char *file, int line) { return malloc(num); } +LCRYPTO_ALIAS(CRYPTO_malloc); char * CRYPTO_strdup(const char *str, const char *file, int line) { return strdup(str); } +LCRYPTO_ALIAS(CRYPTO_strdup); void CRYPTO_free(void *ptr, const char *file, int line) { free(ptr); } +LCRYPTO_ALIAS(CRYPTO_free); diff --git a/lib/libcrypto/mem_clr.c b/lib/libcrypto/mem_clr.c index 9ee5e65a2e6..a936dcc5b82 100644 --- a/lib/libcrypto/mem_clr.c +++ b/lib/libcrypto/mem_clr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mem_clr.c,v 1.4 2014/06/12 15:49:27 deraadt Exp $ */ +/* $OpenBSD: mem_clr.c,v 1.5 2024/04/10 14:51:02 beck Exp $ */ /* Ted Unangst places this file in the public domain. */ #include <string.h> @@ -9,3 +9,4 @@ OPENSSL_cleanse(void *ptr, size_t len) { explicit_bzero(ptr, len); } +LCRYPTO_ALIAS(OPENSSL_cleanse); diff --git a/lib/libcrypto/mem_dbg.c b/lib/libcrypto/mem_dbg.c index 031db43e3b8..a7b38632654 100644 --- a/lib/libcrypto/mem_dbg.c +++ b/lib/libcrypto/mem_dbg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mem_dbg.c,v 1.27 2024/03/02 11:32:31 tb Exp $ */ +/* $OpenBSD: mem_dbg.c,v 1.28 2024/04/10 14:51:02 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -116,3 +116,4 @@ CRYPTO_mem_ctrl(int mode) { return (CRYPTO_MEM_CHECK_OFF); } +LCRYPTO_ALIAS(CRYPTO_mem_ctrl); diff --git a/lib/libcrypto/o_fips.c b/lib/libcrypto/o_fips.c index b1487e3be37..b0190b18e6e 100644 --- a/lib/libcrypto/o_fips.c +++ b/lib/libcrypto/o_fips.c @@ -1,4 +1,4 @@ -/* $OpenBSD: o_fips.c,v 1.6 2021/10/23 13:57:00 schwarze Exp $ */ +/* $OpenBSD: o_fips.c,v 1.7 2024/04/10 14:51:02 beck Exp $ */ /* Written by Stephen Henson (steve@openssl.org) for the OpenSSL * project 2011. */ @@ -65,6 +65,7 @@ FIPS_mode(void) { return 0; } +LCRYPTO_ALIAS(FIPS_mode); int FIPS_mode_set(int r) @@ -74,3 +75,4 @@ FIPS_mode_set(int r) CRYPTOerror(CRYPTO_R_FIPS_MODE_NOT_SUPPORTED); return 0; } +LCRYPTO_ALIAS(FIPS_mode_set); |