diff options
author | beck <> | 2023-07-08 08:28:23 +0000 |
---|---|---|
committer | beck <> | 2023-07-08 08:28:23 +0000 |
commit | 62076bba7c620e3ba9d5e1eb92934c369465834b (patch) | |
tree | a5a939397b6b2256dfb6935b10c9e72d34fbc502 /src | |
parent | 8035a603830bfb31d58529c3c42a85a6999ff6cb (diff) | |
download | openbsd-62076bba7c620e3ba9d5e1eb92934c369465834b.tar.gz openbsd-62076bba7c620e3ba9d5e1eb92934c369465834b.tar.bz2 openbsd-62076bba7c620e3ba9d5e1eb92934c369465834b.zip |
Hide symbols in crypto.h
ok jsing@
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libcrypto/Symbols.namespace | 50 | ||||
-rw-r--r-- | src/lib/libcrypto/cpt_err.c | 3 | ||||
-rw-r--r-- | src/lib/libcrypto/cryptlib.c | 9 | ||||
-rw-r--r-- | src/lib/libcrypto/crypto_init.c | 4 | ||||
-rw-r--r-- | src/lib/libcrypto/crypto_lock.c | 4 | ||||
-rw-r--r-- | src/lib/libcrypto/cversion.c | 6 | ||||
-rw-r--r-- | src/lib/libcrypto/ex_data.c | 12 | ||||
-rw-r--r-- | src/lib/libcrypto/hidden/openssl/crypto.h | 79 | ||||
-rw-r--r-- | src/lib/libcrypto/malloc-wrapper.c | 18 | ||||
-rw-r--r-- | src/lib/libcrypto/mem_dbg.c | 13 |
10 files changed, 190 insertions, 8 deletions
diff --git a/src/lib/libcrypto/Symbols.namespace b/src/lib/libcrypto/Symbols.namespace index 617fc06b13..89c4a06367 100644 --- a/src/lib/libcrypto/Symbols.namespace +++ b/src/lib/libcrypto/Symbols.namespace | |||
@@ -2013,3 +2013,53 @@ _libre_BUF_MEM_free | |||
2013 | _libre_BUF_MEM_grow | 2013 | _libre_BUF_MEM_grow |
2014 | _libre_BUF_MEM_grow_clean | 2014 | _libre_BUF_MEM_grow_clean |
2015 | _libre_ERR_load_BUF_strings | 2015 | _libre_ERR_load_BUF_strings |
2016 | _libre_OpenSSL_version | ||
2017 | _libre_OpenSSL_version_num | ||
2018 | _libre_SSLeay_version | ||
2019 | _libre_SSLeay | ||
2020 | _libre_CRYPTO_get_ex_data_implementation | ||
2021 | _libre_CRYPTO_set_ex_data_implementation | ||
2022 | _libre_CRYPTO_ex_data_new_class | ||
2023 | _libre_CRYPTO_get_ex_new_index | ||
2024 | _libre_CRYPTO_new_ex_data | ||
2025 | _libre_CRYPTO_dup_ex_data | ||
2026 | _libre_CRYPTO_free_ex_data | ||
2027 | _libre_CRYPTO_set_ex_data | ||
2028 | _libre_CRYPTO_get_ex_data | ||
2029 | _libre_CRYPTO_cleanup_all_ex_data | ||
2030 | _libre_CRYPTO_lock | ||
2031 | _libre_CRYPTO_add_lock | ||
2032 | _libre_CRYPTO_THREADID_current | ||
2033 | _libre_CRYPTO_THREADID_cmp | ||
2034 | _libre_CRYPTO_THREADID_cpy | ||
2035 | _libre_CRYPTO_THREADID_hash | ||
2036 | _libre_CRYPTO_set_mem_functions | ||
2037 | _libre_CRYPTO_set_locked_mem_functions | ||
2038 | _libre_CRYPTO_set_mem_ex_functions | ||
2039 | _libre_CRYPTO_set_locked_mem_ex_functions | ||
2040 | _libre_CRYPTO_set_mem_debug_functions | ||
2041 | _libre_CRYPTO_get_mem_functions | ||
2042 | _libre_CRYPTO_get_locked_mem_functions | ||
2043 | _libre_CRYPTO_get_mem_ex_functions | ||
2044 | _libre_CRYPTO_get_locked_mem_ex_functions | ||
2045 | _libre_CRYPTO_get_mem_debug_functions | ||
2046 | _libre_CRYPTO_realloc_clean | ||
2047 | _libre_CRYPTO_remalloc | ||
2048 | _libre_CRYPTO_set_mem_debug_options | ||
2049 | _libre_CRYPTO_get_mem_debug_options | ||
2050 | _libre_CRYPTO_push_info_ | ||
2051 | _libre_CRYPTO_pop_info | ||
2052 | _libre_CRYPTO_remove_all_info | ||
2053 | _libre_CRYPTO_dbg_malloc | ||
2054 | _libre_CRYPTO_dbg_realloc | ||
2055 | _libre_CRYPTO_dbg_free | ||
2056 | _libre_CRYPTO_dbg_set_options | ||
2057 | _libre_CRYPTO_dbg_get_options | ||
2058 | _libre_CRYPTO_mem_leaks_fp | ||
2059 | _libre_CRYPTO_mem_leaks | ||
2060 | _libre_CRYPTO_mem_leaks_cb | ||
2061 | _libre_OpenSSLDie | ||
2062 | _libre_OPENSSL_cpu_caps | ||
2063 | _libre_OPENSSL_init_crypto | ||
2064 | _libre_OPENSSL_cleanup | ||
2065 | _libre_ERR_load_CRYPTO_strings | ||
diff --git a/src/lib/libcrypto/cpt_err.c b/src/lib/libcrypto/cpt_err.c index 718c72608e..ff4e5c4bc5 100644 --- a/src/lib/libcrypto/cpt_err.c +++ b/src/lib/libcrypto/cpt_err.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: cpt_err.c,v 1.14 2022/07/12 14:42:48 kn Exp $ */ | 1 | /* $OpenBSD: cpt_err.c,v 1.15 2023/07/08 08:28:23 beck Exp $ */ |
2 | /* ==================================================================== | 2 | /* ==================================================================== |
3 | * Copyright (c) 1999-2011 The OpenSSL Project. All rights reserved. | 3 | * Copyright (c) 1999-2011 The OpenSSL Project. All rights reserved. |
4 | * | 4 | * |
@@ -97,3 +97,4 @@ ERR_load_CRYPTO_strings(void) | |||
97 | } | 97 | } |
98 | #endif | 98 | #endif |
99 | } | 99 | } |
100 | LCRYPTO_ALIAS(ERR_load_CRYPTO_strings); | ||
diff --git a/src/lib/libcrypto/cryptlib.c b/src/lib/libcrypto/cryptlib.c index 38d31e7ac2..18f40e5448 100644 --- a/src/lib/libcrypto/cryptlib.c +++ b/src/lib/libcrypto/cryptlib.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: cryptlib.c,v 1.45 2019/01/26 11:30:32 deraadt Exp $ */ | 1 | /* $OpenBSD: cryptlib.c,v 1.46 2023/07/08 08:28:23 beck Exp $ */ |
2 | /* ==================================================================== | 2 | /* ==================================================================== |
3 | * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. | 3 | * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. |
4 | * | 4 | * |
@@ -281,24 +281,28 @@ CRYPTO_THREADID_current(CRYPTO_THREADID *id) | |||
281 | memset(id, 0, sizeof(*id)); | 281 | memset(id, 0, sizeof(*id)); |
282 | id->val = (unsigned long)pthread_self(); | 282 | id->val = (unsigned long)pthread_self(); |
283 | } | 283 | } |
284 | LCRYPTO_ALIAS(CRYPTO_THREADID_current); | ||
284 | 285 | ||
285 | int | 286 | int |
286 | CRYPTO_THREADID_cmp(const CRYPTO_THREADID *a, const CRYPTO_THREADID *b) | 287 | CRYPTO_THREADID_cmp(const CRYPTO_THREADID *a, const CRYPTO_THREADID *b) |
287 | { | 288 | { |
288 | return memcmp(a, b, sizeof(*a)); | 289 | return memcmp(a, b, sizeof(*a)); |
289 | } | 290 | } |
291 | LCRYPTO_ALIAS(CRYPTO_THREADID_cmp); | ||
290 | 292 | ||
291 | void | 293 | void |
292 | CRYPTO_THREADID_cpy(CRYPTO_THREADID *dest, const CRYPTO_THREADID *src) | 294 | CRYPTO_THREADID_cpy(CRYPTO_THREADID *dest, const CRYPTO_THREADID *src) |
293 | { | 295 | { |
294 | memcpy(dest, src, sizeof(*src)); | 296 | memcpy(dest, src, sizeof(*src)); |
295 | } | 297 | } |
298 | LCRYPTO_ALIAS(CRYPTO_THREADID_cpy); | ||
296 | 299 | ||
297 | unsigned long | 300 | unsigned long |
298 | CRYPTO_THREADID_hash(const CRYPTO_THREADID *id) | 301 | CRYPTO_THREADID_hash(const CRYPTO_THREADID *id) |
299 | { | 302 | { |
300 | return id->val; | 303 | return id->val; |
301 | } | 304 | } |
305 | LCRYPTO_ALIAS(CRYPTO_THREADID_hash); | ||
302 | 306 | ||
303 | #if defined(__i386) || defined(__i386__) || defined(_M_IX86) || \ | 307 | #if defined(__i386) || defined(__i386__) || defined(_M_IX86) || \ |
304 | defined(__INTEL__) || \ | 308 | defined(__INTEL__) || \ |
@@ -311,6 +315,7 @@ OPENSSL_cpu_caps(void) | |||
311 | { | 315 | { |
312 | return OPENSSL_ia32cap_P; | 316 | return OPENSSL_ia32cap_P; |
313 | } | 317 | } |
318 | LCRYPTO_ALIAS(OPENSSL_cpu_caps); | ||
314 | 319 | ||
315 | #if defined(OPENSSL_CPUID_OBJ) && !defined(OPENSSL_NO_ASM) | 320 | #if defined(OPENSSL_CPUID_OBJ) && !defined(OPENSSL_NO_ASM) |
316 | #define OPENSSL_CPUID_SETUP | 321 | #define OPENSSL_CPUID_SETUP |
@@ -333,6 +338,7 @@ OPENSSL_cpu_caps(void) | |||
333 | { | 338 | { |
334 | return 0; | 339 | return 0; |
335 | } | 340 | } |
341 | LCRYPTO_ALIAS(OPENSSL_cpu_caps); | ||
336 | #endif | 342 | #endif |
337 | 343 | ||
338 | #if !defined(OPENSSL_CPUID_SETUP) && !defined(OPENSSL_CPUID_OBJ) | 344 | #if !defined(OPENSSL_CPUID_SETUP) && !defined(OPENSSL_CPUID_OBJ) |
@@ -361,6 +367,7 @@ OpenSSLDie(const char *file, int line, const char *assertion) | |||
361 | getuid(), getprogname(), file, line, assertion); | 367 | getuid(), getprogname(), file, line, assertion); |
362 | _exit(1); | 368 | _exit(1); |
363 | } | 369 | } |
370 | LCRYPTO_ALIAS(OpenSSLDie); | ||
364 | 371 | ||
365 | int | 372 | int |
366 | CRYPTO_memcmp(const void *in_a, const void *in_b, size_t len) | 373 | CRYPTO_memcmp(const void *in_a, const void *in_b, size_t len) |
diff --git a/src/lib/libcrypto/crypto_init.c b/src/lib/libcrypto/crypto_init.c index 361bef41a3..a2c1c786c3 100644 --- a/src/lib/libcrypto/crypto_init.c +++ b/src/lib/libcrypto/crypto_init.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: crypto_init.c,v 1.10 2023/07/02 19:52:01 tb Exp $ */ | 1 | /* $OpenBSD: crypto_init.c,v 1.11 2023/07/08 08:28:23 beck Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2018 Bob Beck <beck@openbsd.org> | 3 | * Copyright (c) 2018 Bob Beck <beck@openbsd.org> |
4 | * | 4 | * |
@@ -75,6 +75,7 @@ OPENSSL_init_crypto(uint64_t opts, const void *settings) | |||
75 | 75 | ||
76 | return 1; | 76 | return 1; |
77 | } | 77 | } |
78 | LCRYPTO_ALIAS(OPENSSL_init_crypto); | ||
78 | 79 | ||
79 | void | 80 | void |
80 | OPENSSL_cleanup(void) | 81 | OPENSSL_cleanup(void) |
@@ -98,3 +99,4 @@ OPENSSL_cleanup(void) | |||
98 | 99 | ||
99 | crypto_init_cleaned_up = 1; | 100 | crypto_init_cleaned_up = 1; |
100 | } | 101 | } |
102 | LCRYPTO_ALIAS(OPENSSL_cleanup); | ||
diff --git a/src/lib/libcrypto/crypto_lock.c b/src/lib/libcrypto/crypto_lock.c index 6d9dbab22b..59c3933c7d 100644 --- a/src/lib/libcrypto/crypto_lock.c +++ b/src/lib/libcrypto/crypto_lock.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: crypto_lock.c,v 1.5 2023/06/04 17:28:35 tb Exp $ */ | 1 | /* $OpenBSD: crypto_lock.c,v 1.6 2023/07/08 08:28:23 beck Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2018 Brent Cook <bcook@openbsd.org> | 3 | * Copyright (c) 2018 Brent Cook <bcook@openbsd.org> |
4 | * | 4 | * |
@@ -78,6 +78,7 @@ CRYPTO_lock(int mode, int type, const char *file, int line) | |||
78 | else if (mode & CRYPTO_UNLOCK) | 78 | else if (mode & CRYPTO_UNLOCK) |
79 | (void) pthread_mutex_unlock(&locks[type]); | 79 | (void) pthread_mutex_unlock(&locks[type]); |
80 | } | 80 | } |
81 | LCRYPTO_ALIAS(CRYPTO_lock); | ||
81 | 82 | ||
82 | int | 83 | int |
83 | CRYPTO_add_lock(int *pointer, int amount, int type, const char *file, | 84 | CRYPTO_add_lock(int *pointer, int amount, int type, const char *file, |
@@ -92,3 +93,4 @@ CRYPTO_add_lock(int *pointer, int amount, int type, const char *file, | |||
92 | 93 | ||
93 | return (ret); | 94 | return (ret); |
94 | } | 95 | } |
96 | LCRYPTO_ALIAS(CRYPTO_add_lock); | ||
diff --git a/src/lib/libcrypto/cversion.c b/src/lib/libcrypto/cversion.c index 2d4460d10d..acb7b70543 100644 --- a/src/lib/libcrypto/cversion.c +++ b/src/lib/libcrypto/cversion.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: cversion.c,v 1.17 2018/02/17 06:56:12 jsing Exp $ */ | 1 | /* $OpenBSD: cversion.c,v 1.18 2023/07/08 08:28:23 beck 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 | * |
@@ -78,12 +78,14 @@ SSLeay_version(int t) | |||
78 | } | 78 | } |
79 | return("not available"); | 79 | return("not available"); |
80 | } | 80 | } |
81 | LCRYPTO_ALIAS(SSLeay_version); | ||
81 | 82 | ||
82 | unsigned long | 83 | unsigned long |
83 | SSLeay(void) | 84 | SSLeay(void) |
84 | { | 85 | { |
85 | return (SSLEAY_VERSION_NUMBER); | 86 | return (SSLEAY_VERSION_NUMBER); |
86 | } | 87 | } |
88 | LCRYPTO_ALIAS(SSLeay); | ||
87 | 89 | ||
88 | const char * | 90 | const char * |
89 | OpenSSL_version(int t) | 91 | OpenSSL_version(int t) |
@@ -104,9 +106,11 @@ OpenSSL_version(int t) | |||
104 | } | 106 | } |
105 | return("not available"); | 107 | return("not available"); |
106 | } | 108 | } |
109 | LCRYPTO_ALIAS(OpenSSL_version); | ||
107 | 110 | ||
108 | unsigned long | 111 | unsigned long |
109 | OpenSSL_version_num(void) | 112 | OpenSSL_version_num(void) |
110 | { | 113 | { |
111 | return SSLeay(); | 114 | return SSLeay(); |
112 | } | 115 | } |
116 | LCRYPTO_ALIAS(OpenSSL_version_num); | ||
diff --git a/src/lib/libcrypto/ex_data.c b/src/lib/libcrypto/ex_data.c index 0a9c59121f..71b2fc397b 100644 --- a/src/lib/libcrypto/ex_data.c +++ b/src/lib/libcrypto/ex_data.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ex_data.c,v 1.21 2023/06/16 11:20:01 tb Exp $ */ | 1 | /* $OpenBSD: ex_data.c,v 1.22 2023/07/08 08:28:23 beck Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Overhaul notes; | 4 | * Overhaul notes; |
@@ -217,6 +217,7 @@ CRYPTO_get_ex_data_implementation(void) | |||
217 | IMPL_CHECK | 217 | IMPL_CHECK |
218 | return impl; | 218 | return impl; |
219 | } | 219 | } |
220 | LCRYPTO_ALIAS(CRYPTO_get_ex_data_implementation); | ||
220 | 221 | ||
221 | int | 222 | int |
222 | CRYPTO_set_ex_data_implementation(const CRYPTO_EX_DATA_IMPL *i) | 223 | CRYPTO_set_ex_data_implementation(const CRYPTO_EX_DATA_IMPL *i) |
@@ -230,6 +231,7 @@ CRYPTO_set_ex_data_implementation(const CRYPTO_EX_DATA_IMPL *i) | |||
230 | CRYPTO_w_unlock(CRYPTO_LOCK_EX_DATA); | 231 | CRYPTO_w_unlock(CRYPTO_LOCK_EX_DATA); |
231 | return toret; | 232 | return toret; |
232 | } | 233 | } |
234 | LCRYPTO_ALIAS(CRYPTO_set_ex_data_implementation); | ||
233 | 235 | ||
234 | /****************************************************************************/ | 236 | /****************************************************************************/ |
235 | /* Interal (default) implementation of "ex_data" support. API functions are | 237 | /* Interal (default) implementation of "ex_data" support. API functions are |
@@ -547,6 +549,7 @@ CRYPTO_ex_data_new_class(void) | |||
547 | IMPL_CHECK | 549 | IMPL_CHECK |
548 | return EX_IMPL(new_class)(); | 550 | return EX_IMPL(new_class)(); |
549 | } | 551 | } |
552 | LCRYPTO_ALIAS(CRYPTO_ex_data_new_class); | ||
550 | 553 | ||
551 | /* Release all "ex_data" state to prevent memory leaks. This can't be made | 554 | /* Release all "ex_data" state to prevent memory leaks. This can't be made |
552 | * thread-safe without overhauling a lot of stuff, and shouldn't really be | 555 | * thread-safe without overhauling a lot of stuff, and shouldn't really be |
@@ -558,6 +561,7 @@ CRYPTO_cleanup_all_ex_data(void) | |||
558 | IMPL_CHECK | 561 | IMPL_CHECK |
559 | EX_IMPL(cleanup)(); | 562 | EX_IMPL(cleanup)(); |
560 | } | 563 | } |
564 | LCRYPTO_ALIAS(CRYPTO_cleanup_all_ex_data); | ||
561 | 565 | ||
562 | /* Inside an existing class, get/register a new index. */ | 566 | /* Inside an existing class, get/register a new index. */ |
563 | int | 567 | int |
@@ -571,6 +575,7 @@ CRYPTO_get_ex_new_index(int class_index, long argl, void *argp, | |||
571 | argl, argp, new_func, dup_func, free_func); | 575 | argl, argp, new_func, dup_func, free_func); |
572 | return ret; | 576 | return ret; |
573 | } | 577 | } |
578 | LCRYPTO_ALIAS(CRYPTO_get_ex_new_index); | ||
574 | 579 | ||
575 | /* Initialise a new CRYPTO_EX_DATA for use in a particular class - including | 580 | /* Initialise a new CRYPTO_EX_DATA for use in a particular class - including |
576 | * calling new() callbacks for each index in the class used by this variable */ | 581 | * calling new() callbacks for each index in the class used by this variable */ |
@@ -580,6 +585,7 @@ CRYPTO_new_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad) | |||
580 | IMPL_CHECK | 585 | IMPL_CHECK |
581 | return EX_IMPL(new_ex_data)(class_index, obj, ad); | 586 | return EX_IMPL(new_ex_data)(class_index, obj, ad); |
582 | } | 587 | } |
588 | LCRYPTO_ALIAS(CRYPTO_new_ex_data); | ||
583 | 589 | ||
584 | /* Duplicate a CRYPTO_EX_DATA variable - including calling dup() callbacks for | 590 | /* Duplicate a CRYPTO_EX_DATA variable - including calling dup() callbacks for |
585 | * each index in the class used by this variable */ | 591 | * each index in the class used by this variable */ |
@@ -589,6 +595,7 @@ CRYPTO_dup_ex_data(int class_index, CRYPTO_EX_DATA *to, CRYPTO_EX_DATA *from) | |||
589 | IMPL_CHECK | 595 | IMPL_CHECK |
590 | return EX_IMPL(dup_ex_data)(class_index, to, from); | 596 | return EX_IMPL(dup_ex_data)(class_index, to, from); |
591 | } | 597 | } |
598 | LCRYPTO_ALIAS(CRYPTO_dup_ex_data); | ||
592 | 599 | ||
593 | /* Cleanup a CRYPTO_EX_DATA variable - including calling free() callbacks for | 600 | /* Cleanup a CRYPTO_EX_DATA variable - including calling free() callbacks for |
594 | * each index in the class used by this variable */ | 601 | * each index in the class used by this variable */ |
@@ -598,6 +605,7 @@ CRYPTO_free_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad) | |||
598 | IMPL_CHECK | 605 | IMPL_CHECK |
599 | EX_IMPL(free_ex_data)(class_index, obj, ad); | 606 | EX_IMPL(free_ex_data)(class_index, obj, ad); |
600 | } | 607 | } |
608 | LCRYPTO_ALIAS(CRYPTO_free_ex_data); | ||
601 | 609 | ||
602 | /* For a given CRYPTO_EX_DATA variable, set the value corresponding to a | 610 | /* For a given CRYPTO_EX_DATA variable, set the value corresponding to a |
603 | * particular index in the class used by this variable */ | 611 | * particular index in the class used by this variable */ |
@@ -624,6 +632,7 @@ CRYPTO_set_ex_data(CRYPTO_EX_DATA *ad, int idx, void *val) | |||
624 | sk_void_set(ad->sk, idx, val); | 632 | sk_void_set(ad->sk, idx, val); |
625 | return (1); | 633 | return (1); |
626 | } | 634 | } |
635 | LCRYPTO_ALIAS(CRYPTO_set_ex_data); | ||
627 | 636 | ||
628 | /* For a given CRYPTO_EX_DATA_ variable, get the value corresponding to a | 637 | /* For a given CRYPTO_EX_DATA_ variable, get the value corresponding to a |
629 | * particular index in the class used by this variable */ | 638 | * particular index in the class used by this variable */ |
@@ -637,3 +646,4 @@ CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx) | |||
637 | else | 646 | else |
638 | return (sk_void_value(ad->sk, idx)); | 647 | return (sk_void_value(ad->sk, idx)); |
639 | } | 648 | } |
649 | LCRYPTO_ALIAS(CRYPTO_get_ex_data); | ||
diff --git a/src/lib/libcrypto/hidden/openssl/crypto.h b/src/lib/libcrypto/hidden/openssl/crypto.h new file mode 100644 index 0000000000..69ffa9480b --- /dev/null +++ b/src/lib/libcrypto/hidden/openssl/crypto.h | |||
@@ -0,0 +1,79 @@ | |||
1 | /* $OpenBSD: crypto.h,v 1.1 2023/07/08 08:28:23 beck Exp $ */ | ||
2 | /* | ||
3 | * Copyright (c) 2023 Bob Beck <beck@openbsd.org> | ||
4 | * | ||
5 | * Permission to use, copy, modify, and distribute this software for any | ||
6 | * purpose with or without fee is hereby granted, provided that the above | ||
7 | * copyright notice and this permission notice appear in all copies. | ||
8 | * | ||
9 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
10 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
11 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
12 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
13 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
14 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
15 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
16 | */ | ||
17 | |||
18 | #ifndef _LIBCRYPTO_CRYPTO_H | ||
19 | #define _LIBCRYPTO_CRYPTO_H | ||
20 | |||
21 | #ifndef _MSC_VER | ||
22 | #include_next <openssl/crypto.h> | ||
23 | #else | ||
24 | #include "../include/openssl/crypto.h" | ||
25 | #endif | ||
26 | #include "crypto_namespace.h" | ||
27 | |||
28 | LCRYPTO_USED(OpenSSL_version); | ||
29 | LCRYPTO_USED(OpenSSL_version_num); | ||
30 | LCRYPTO_USED(SSLeay_version); | ||
31 | LCRYPTO_USED(SSLeay); | ||
32 | LCRYPTO_USED(CRYPTO_get_ex_data_implementation); | ||
33 | LCRYPTO_USED(CRYPTO_set_ex_data_implementation); | ||
34 | LCRYPTO_USED(CRYPTO_ex_data_new_class); | ||
35 | LCRYPTO_USED(CRYPTO_get_ex_new_index); | ||
36 | LCRYPTO_USED(CRYPTO_new_ex_data); | ||
37 | LCRYPTO_USED(CRYPTO_dup_ex_data); | ||
38 | LCRYPTO_USED(CRYPTO_free_ex_data); | ||
39 | LCRYPTO_USED(CRYPTO_set_ex_data); | ||
40 | LCRYPTO_USED(CRYPTO_get_ex_data); | ||
41 | LCRYPTO_USED(CRYPTO_cleanup_all_ex_data); | ||
42 | LCRYPTO_USED(CRYPTO_lock); | ||
43 | LCRYPTO_USED(CRYPTO_add_lock); | ||
44 | LCRYPTO_USED(CRYPTO_THREADID_current); | ||
45 | LCRYPTO_USED(CRYPTO_THREADID_cmp); | ||
46 | LCRYPTO_USED(CRYPTO_THREADID_cpy); | ||
47 | LCRYPTO_USED(CRYPTO_THREADID_hash); | ||
48 | LCRYPTO_USED(CRYPTO_set_mem_functions); | ||
49 | LCRYPTO_USED(CRYPTO_set_locked_mem_functions); | ||
50 | LCRYPTO_USED(CRYPTO_set_mem_ex_functions); | ||
51 | LCRYPTO_USED(CRYPTO_set_locked_mem_ex_functions); | ||
52 | LCRYPTO_USED(CRYPTO_set_mem_debug_functions); | ||
53 | LCRYPTO_USED(CRYPTO_get_mem_functions); | ||
54 | LCRYPTO_USED(CRYPTO_get_locked_mem_functions); | ||
55 | LCRYPTO_USED(CRYPTO_get_mem_ex_functions); | ||
56 | LCRYPTO_USED(CRYPTO_get_locked_mem_ex_functions); | ||
57 | LCRYPTO_USED(CRYPTO_get_mem_debug_functions); | ||
58 | LCRYPTO_USED(CRYPTO_realloc_clean); | ||
59 | LCRYPTO_USED(CRYPTO_remalloc); | ||
60 | LCRYPTO_USED(CRYPTO_set_mem_debug_options); | ||
61 | LCRYPTO_USED(CRYPTO_get_mem_debug_options); | ||
62 | LCRYPTO_USED(CRYPTO_push_info_); | ||
63 | LCRYPTO_USED(CRYPTO_pop_info); | ||
64 | LCRYPTO_USED(CRYPTO_remove_all_info); | ||
65 | LCRYPTO_USED(CRYPTO_dbg_malloc); | ||
66 | LCRYPTO_USED(CRYPTO_dbg_realloc); | ||
67 | LCRYPTO_USED(CRYPTO_dbg_free); | ||
68 | LCRYPTO_USED(CRYPTO_dbg_set_options); | ||
69 | LCRYPTO_USED(CRYPTO_dbg_get_options); | ||
70 | LCRYPTO_USED(CRYPTO_mem_leaks_fp); | ||
71 | LCRYPTO_USED(CRYPTO_mem_leaks); | ||
72 | LCRYPTO_USED(CRYPTO_mem_leaks_cb); | ||
73 | LCRYPTO_USED(OpenSSLDie); | ||
74 | LCRYPTO_USED(OPENSSL_cpu_caps); | ||
75 | LCRYPTO_USED(OPENSSL_init_crypto); | ||
76 | LCRYPTO_USED(OPENSSL_cleanup); | ||
77 | LCRYPTO_USED(ERR_load_CRYPTO_strings); | ||
78 | |||
79 | #endif /* _LIBCRYPTO_CRYPTO_H */ | ||
diff --git a/src/lib/libcrypto/malloc-wrapper.c b/src/lib/libcrypto/malloc-wrapper.c index cb9a31186d..4d57f00b23 100644 --- a/src/lib/libcrypto/malloc-wrapper.c +++ b/src/lib/libcrypto/malloc-wrapper.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: malloc-wrapper.c,v 1.7 2018/05/13 13:49:04 jsing Exp $ */ | 1 | /* $OpenBSD: malloc-wrapper.c,v 1.8 2023/07/08 08:28:23 beck Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2014 Bob Beck | 3 | * Copyright (c) 2014 Bob Beck |
4 | * | 4 | * |
@@ -18,12 +18,15 @@ | |||
18 | #include <stdlib.h> | 18 | #include <stdlib.h> |
19 | #include <string.h> | 19 | #include <string.h> |
20 | 20 | ||
21 | #include <openssl/crypto.h> | ||
22 | |||
21 | int | 23 | int |
22 | CRYPTO_set_mem_functions(void *(*m)(size_t), void *(*r)(void *, size_t), | 24 | CRYPTO_set_mem_functions(void *(*m)(size_t), void *(*r)(void *, size_t), |
23 | void (*f)(void *)) | 25 | void (*f)(void *)) |
24 | { | 26 | { |
25 | return 0; | 27 | return 0; |
26 | } | 28 | } |
29 | LCRYPTO_ALIAS(CRYPTO_set_mem_functions); | ||
27 | 30 | ||
28 | int | 31 | int |
29 | CRYPTO_set_mem_ex_functions(void *(*m)(size_t, const char *, int), | 32 | CRYPTO_set_mem_ex_functions(void *(*m)(size_t, const char *, int), |
@@ -31,12 +34,14 @@ CRYPTO_set_mem_ex_functions(void *(*m)(size_t, const char *, int), | |||
31 | { | 34 | { |
32 | return 0; | 35 | return 0; |
33 | } | 36 | } |
37 | LCRYPTO_ALIAS(CRYPTO_set_mem_ex_functions); | ||
34 | 38 | ||
35 | int | 39 | int |
36 | CRYPTO_set_locked_mem_functions(void *(*m)(size_t), void (*f)(void *)) | 40 | CRYPTO_set_locked_mem_functions(void *(*m)(size_t), void (*f)(void *)) |
37 | { | 41 | { |
38 | return 0; | 42 | return 0; |
39 | } | 43 | } |
44 | LCRYPTO_ALIAS(CRYPTO_set_locked_mem_functions); | ||
40 | 45 | ||
41 | int | 46 | int |
42 | CRYPTO_set_locked_mem_ex_functions(void *(*m)(size_t, const char *, int), | 47 | CRYPTO_set_locked_mem_ex_functions(void *(*m)(size_t, const char *, int), |
@@ -44,6 +49,7 @@ CRYPTO_set_locked_mem_ex_functions(void *(*m)(size_t, const char *, int), | |||
44 | { | 49 | { |
45 | return 0; | 50 | return 0; |
46 | } | 51 | } |
52 | LCRYPTO_ALIAS(CRYPTO_set_locked_mem_ex_functions); | ||
47 | 53 | ||
48 | int | 54 | int |
49 | CRYPTO_set_mem_debug_functions(void (*m)(void *, int, const char *, int, int), | 55 | CRYPTO_set_mem_debug_functions(void (*m)(void *, int, const char *, int, int), |
@@ -52,6 +58,7 @@ CRYPTO_set_mem_debug_functions(void (*m)(void *, int, const char *, int, int), | |||
52 | { | 58 | { |
53 | return 0; | 59 | return 0; |
54 | } | 60 | } |
61 | LCRYPTO_ALIAS(CRYPTO_set_mem_debug_functions); | ||
55 | 62 | ||
56 | 63 | ||
57 | void | 64 | void |
@@ -65,6 +72,7 @@ CRYPTO_get_mem_functions(void *(**m)(size_t), void *(**r)(void *, size_t), | |||
65 | if (f != NULL) | 72 | if (f != NULL) |
66 | *f = free; | 73 | *f = free; |
67 | } | 74 | } |
75 | LCRYPTO_ALIAS(CRYPTO_get_mem_functions); | ||
68 | 76 | ||
69 | void | 77 | void |
70 | CRYPTO_get_mem_ex_functions(void *(**m)(size_t, const char *, int), | 78 | CRYPTO_get_mem_ex_functions(void *(**m)(size_t, const char *, int), |
@@ -77,6 +85,7 @@ CRYPTO_get_mem_ex_functions(void *(**m)(size_t, const char *, int), | |||
77 | if (f != NULL) | 85 | if (f != NULL) |
78 | *f = free; | 86 | *f = free; |
79 | } | 87 | } |
88 | LCRYPTO_ALIAS(CRYPTO_get_mem_ex_functions); | ||
80 | 89 | ||
81 | void | 90 | void |
82 | CRYPTO_get_locked_mem_functions(void *(**m)(size_t), void (**f)(void *)) | 91 | CRYPTO_get_locked_mem_functions(void *(**m)(size_t), void (**f)(void *)) |
@@ -86,6 +95,7 @@ CRYPTO_get_locked_mem_functions(void *(**m)(size_t), void (**f)(void *)) | |||
86 | if (f != NULL) | 95 | if (f != NULL) |
87 | *f = free; | 96 | *f = free; |
88 | } | 97 | } |
98 | LCRYPTO_ALIAS(CRYPTO_get_locked_mem_functions); | ||
89 | 99 | ||
90 | void | 100 | void |
91 | CRYPTO_get_locked_mem_ex_functions(void *(**m)(size_t, const char *, int), | 101 | CRYPTO_get_locked_mem_ex_functions(void *(**m)(size_t, const char *, int), |
@@ -96,6 +106,7 @@ CRYPTO_get_locked_mem_ex_functions(void *(**m)(size_t, const char *, int), | |||
96 | if (f != NULL) | 106 | if (f != NULL) |
97 | *f = free; | 107 | *f = free; |
98 | } | 108 | } |
109 | LCRYPTO_ALIAS(CRYPTO_get_locked_mem_ex_functions); | ||
99 | 110 | ||
100 | void | 111 | void |
101 | CRYPTO_get_mem_debug_functions(void (**m)(void *, int, const char *, int, int), | 112 | CRYPTO_get_mem_debug_functions(void (**m)(void *, int, const char *, int, int), |
@@ -113,6 +124,7 @@ CRYPTO_get_mem_debug_functions(void (**m)(void *, int, const char *, int, int), | |||
113 | if (go != NULL) | 124 | if (go != NULL) |
114 | *go = NULL; | 125 | *go = NULL; |
115 | } | 126 | } |
127 | LCRYPTO_ALIAS(CRYPTO_get_mem_debug_functions); | ||
116 | 128 | ||
117 | 129 | ||
118 | void * | 130 | void * |
@@ -162,6 +174,7 @@ CRYPTO_realloc_clean(void *ptr, int old_len, int num, const char *file, | |||
162 | return NULL; | 174 | return NULL; |
163 | return recallocarray(ptr, old_len, num, 1); | 175 | return recallocarray(ptr, old_len, num, 1); |
164 | } | 176 | } |
177 | LCRYPTO_ALIAS(CRYPTO_realloc_clean); | ||
165 | 178 | ||
166 | void | 179 | void |
167 | CRYPTO_free(void *ptr) | 180 | CRYPTO_free(void *ptr) |
@@ -175,15 +188,18 @@ CRYPTO_remalloc(void *a, int num, const char *file, int line) | |||
175 | free(a); | 188 | free(a); |
176 | return malloc(num); | 189 | return malloc(num); |
177 | } | 190 | } |
191 | LCRYPTO_ALIAS(CRYPTO_remalloc); | ||
178 | 192 | ||
179 | void | 193 | void |
180 | CRYPTO_set_mem_debug_options(long bits) | 194 | CRYPTO_set_mem_debug_options(long bits) |
181 | { | 195 | { |
182 | return; | 196 | return; |
183 | } | 197 | } |
198 | LCRYPTO_ALIAS(CRYPTO_set_mem_debug_options); | ||
184 | 199 | ||
185 | long | 200 | long |
186 | CRYPTO_get_mem_debug_options(void) | 201 | CRYPTO_get_mem_debug_options(void) |
187 | { | 202 | { |
188 | return 0; | 203 | return 0; |
189 | } | 204 | } |
205 | LCRYPTO_ALIAS(CRYPTO_get_mem_debug_options); | ||
diff --git a/src/lib/libcrypto/mem_dbg.c b/src/lib/libcrypto/mem_dbg.c index 602b139d1c..e2eacebe19 100644 --- a/src/lib/libcrypto/mem_dbg.c +++ b/src/lib/libcrypto/mem_dbg.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: mem_dbg.c,v 1.24 2019/01/29 14:40:54 deraadt Exp $ */ | 1 | /* $OpenBSD: mem_dbg.c,v 1.25 2023/07/08 08:28:23 beck 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 | * |
@@ -133,30 +133,35 @@ CRYPTO_dbg_set_options(long bits) | |||
133 | { | 133 | { |
134 | return; | 134 | return; |
135 | } | 135 | } |
136 | LCRYPTO_ALIAS(CRYPTO_dbg_set_options); | ||
136 | 137 | ||
137 | long | 138 | long |
138 | CRYPTO_dbg_get_options(void) | 139 | CRYPTO_dbg_get_options(void) |
139 | { | 140 | { |
140 | return (0); | 141 | return (0); |
141 | } | 142 | } |
143 | LCRYPTO_ALIAS(CRYPTO_dbg_get_options); | ||
142 | 144 | ||
143 | int | 145 | int |
144 | CRYPTO_push_info_(const char *info, const char *file, int line) | 146 | CRYPTO_push_info_(const char *info, const char *file, int line) |
145 | { | 147 | { |
146 | return (0); | 148 | return (0); |
147 | } | 149 | } |
150 | LCRYPTO_ALIAS(CRYPTO_push_info_); | ||
148 | 151 | ||
149 | int | 152 | int |
150 | CRYPTO_pop_info(void) | 153 | CRYPTO_pop_info(void) |
151 | { | 154 | { |
152 | return (0); | 155 | return (0); |
153 | } | 156 | } |
157 | LCRYPTO_ALIAS(CRYPTO_pop_info); | ||
154 | 158 | ||
155 | int | 159 | int |
156 | CRYPTO_remove_all_info(void) | 160 | CRYPTO_remove_all_info(void) |
157 | { | 161 | { |
158 | return (0); | 162 | return (0); |
159 | } | 163 | } |
164 | LCRYPTO_ALIAS(CRYPTO_remove_all_info); | ||
160 | 165 | ||
161 | void | 166 | void |
162 | CRYPTO_dbg_malloc(void *addr, int num, const char *file, int line, | 167 | CRYPTO_dbg_malloc(void *addr, int num, const char *file, int line, |
@@ -164,12 +169,14 @@ CRYPTO_dbg_malloc(void *addr, int num, const char *file, int line, | |||
164 | { | 169 | { |
165 | OPENSSL_assert("CRYPTO_dbg_malloc is no longer permitted"); | 170 | OPENSSL_assert("CRYPTO_dbg_malloc is no longer permitted"); |
166 | } | 171 | } |
172 | LCRYPTO_ALIAS(CRYPTO_dbg_malloc); | ||
167 | 173 | ||
168 | void | 174 | void |
169 | CRYPTO_dbg_free(void *addr, int before_p) | 175 | CRYPTO_dbg_free(void *addr, int before_p) |
170 | { | 176 | { |
171 | OPENSSL_assert("CRYPTO_dbg_free is no longer permitted"); | 177 | OPENSSL_assert("CRYPTO_dbg_free is no longer permitted"); |
172 | } | 178 | } |
179 | LCRYPTO_ALIAS(CRYPTO_dbg_free); | ||
173 | 180 | ||
174 | void | 181 | void |
175 | CRYPTO_dbg_realloc(void *addr1, void *addr2, int num, | 182 | CRYPTO_dbg_realloc(void *addr1, void *addr2, int num, |
@@ -177,18 +184,21 @@ CRYPTO_dbg_realloc(void *addr1, void *addr2, int num, | |||
177 | { | 184 | { |
178 | OPENSSL_assert("CRYPTO_dbg_realloc is no longer permitted"); | 185 | OPENSSL_assert("CRYPTO_dbg_realloc is no longer permitted"); |
179 | } | 186 | } |
187 | LCRYPTO_ALIAS(CRYPTO_dbg_realloc); | ||
180 | 188 | ||
181 | int | 189 | int |
182 | CRYPTO_mem_leaks(BIO *b) | 190 | CRYPTO_mem_leaks(BIO *b) |
183 | { | 191 | { |
184 | return -1; | 192 | return -1; |
185 | } | 193 | } |
194 | LCRYPTO_ALIAS(CRYPTO_mem_leaks); | ||
186 | 195 | ||
187 | int | 196 | int |
188 | CRYPTO_mem_leaks_fp(FILE *fp) | 197 | CRYPTO_mem_leaks_fp(FILE *fp) |
189 | { | 198 | { |
190 | return -1; | 199 | return -1; |
191 | } | 200 | } |
201 | LCRYPTO_ALIAS(CRYPTO_mem_leaks_fp); | ||
192 | 202 | ||
193 | 203 | ||
194 | int | 204 | int |
@@ -196,3 +206,4 @@ CRYPTO_mem_leaks_cb(CRYPTO_MEM_LEAK_CB *cb) | |||
196 | { | 206 | { |
197 | return -1; | 207 | return -1; |
198 | } | 208 | } |
209 | LCRYPTO_ALIAS(CRYPTO_mem_leaks_cb); | ||