diff options
author | beck <> | 2024-04-10 14:53:01 +0000 |
---|---|---|
committer | beck <> | 2024-04-10 14:53:01 +0000 |
commit | c74048d53051ecb8d267b8b92af44b32f0bd928c (patch) | |
tree | ad58252de816fa1777a2122eef964ba74c98a5c9 | |
parent | 28391ee6892093e7875a30c2bc0924a7bbcb17ea (diff) | |
download | openbsd-c74048d53051ecb8d267b8b92af44b32f0bd928c.tar.gz openbsd-c74048d53051ecb8d267b8b92af44b32f0bd928c.tar.bz2 openbsd-c74048d53051ecb8d267b8b92af44b32f0bd928c.zip |
Finish hiding symbols in rand.h
This removes the LIBRESSL_INTERNAL guards and marks
the functions within as LCRYPTO_UNUSED
-rw-r--r-- | src/lib/libcrypto/Symbols.namespace | 10 | ||||
-rw-r--r-- | src/lib/libcrypto/hidden/openssl/rand.h | 12 | ||||
-rw-r--r-- | src/lib/libcrypto/rand/rand.h | 4 | ||||
-rw-r--r-- | src/lib/libcrypto/rand/rand_lib.c | 9 | ||||
-rw-r--r-- | src/lib/libcrypto/rand/randfile.c | 5 |
5 files changed, 34 insertions, 6 deletions
diff --git a/src/lib/libcrypto/Symbols.namespace b/src/lib/libcrypto/Symbols.namespace index 0f44808bbc..b1be9dcc14 100644 --- a/src/lib/libcrypto/Symbols.namespace +++ b/src/lib/libcrypto/Symbols.namespace | |||
@@ -3179,3 +3179,13 @@ _libre_FIPS_mode | |||
3179 | _libre_FIPS_mode_set | 3179 | _libre_FIPS_mode_set |
3180 | _libre_OPENSSL_init | 3180 | _libre_OPENSSL_init |
3181 | _libre_CRYPTO_memcmp | 3181 | _libre_CRYPTO_memcmp |
3182 | _libre_RAND_cleanup | ||
3183 | _libre_RAND_bytes | ||
3184 | _libre_RAND_pseudo_bytes | ||
3185 | _libre_RAND_seed | ||
3186 | _libre_RAND_add | ||
3187 | _libre_RAND_load_file | ||
3188 | _libre_RAND_write_file | ||
3189 | _libre_RAND_file_name | ||
3190 | _libre_RAND_status | ||
3191 | _libre_RAND_poll | ||
diff --git a/src/lib/libcrypto/hidden/openssl/rand.h b/src/lib/libcrypto/hidden/openssl/rand.h index 978d10f70b..d06442acdb 100644 --- a/src/lib/libcrypto/hidden/openssl/rand.h +++ b/src/lib/libcrypto/hidden/openssl/rand.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: rand.h,v 1.3 2023/07/28 09:53:55 tb Exp $ */ | 1 | /* $OpenBSD: rand.h,v 1.4 2024/04/10 14:53:01 beck Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2023 Bob Beck <beck@openbsd.org> | 3 | * Copyright (c) 2023 Bob Beck <beck@openbsd.org> |
4 | * | 4 | * |
@@ -29,5 +29,15 @@ LCRYPTO_USED(RAND_set_rand_method); | |||
29 | LCRYPTO_USED(RAND_get_rand_method); | 29 | LCRYPTO_USED(RAND_get_rand_method); |
30 | LCRYPTO_USED(RAND_SSLeay); | 30 | LCRYPTO_USED(RAND_SSLeay); |
31 | LCRYPTO_USED(ERR_load_RAND_strings); | 31 | LCRYPTO_USED(ERR_load_RAND_strings); |
32 | LCRYPTO_UNUSED(RAND_cleanup); | ||
33 | LCRYPTO_UNUSED(RAND_bytes); | ||
34 | LCRYPTO_UNUSED(RAND_pseudo_bytes); | ||
35 | LCRYPTO_UNUSED(RAND_seed); | ||
36 | LCRYPTO_UNUSED(RAND_add); | ||
37 | LCRYPTO_UNUSED(RAND_load_file); | ||
38 | LCRYPTO_UNUSED(RAND_write_file); | ||
39 | LCRYPTO_UNUSED(RAND_file_name); | ||
40 | LCRYPTO_UNUSED(RAND_status); | ||
41 | LCRYPTO_UNUSED(RAND_poll); | ||
32 | 42 | ||
33 | #endif /* _LIBCRYPTO_RAND_H */ | 43 | #endif /* _LIBCRYPTO_RAND_H */ |
diff --git a/src/lib/libcrypto/rand/rand.h b/src/lib/libcrypto/rand/rand.h index d66d71579c..1a2c8f715f 100644 --- a/src/lib/libcrypto/rand/rand.h +++ b/src/lib/libcrypto/rand/rand.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: rand.h,v 1.24 2023/11/19 15:46:10 tb Exp $ */ | 1 | /* $OpenBSD: rand.h,v 1.25 2024/04/10 14:53:01 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 | * |
@@ -85,7 +85,6 @@ int RAND_set_rand_method(const RAND_METHOD *meth); | |||
85 | const RAND_METHOD *RAND_get_rand_method(void); | 85 | const RAND_METHOD *RAND_get_rand_method(void); |
86 | RAND_METHOD *RAND_SSLeay(void); | 86 | RAND_METHOD *RAND_SSLeay(void); |
87 | 87 | ||
88 | #ifndef LIBRESSL_INTERNAL | ||
89 | void RAND_cleanup(void ); | 88 | void RAND_cleanup(void ); |
90 | int RAND_bytes(unsigned char *buf, int num); | 89 | int RAND_bytes(unsigned char *buf, int num); |
91 | int RAND_pseudo_bytes(unsigned char *buf, int num); | 90 | int RAND_pseudo_bytes(unsigned char *buf, int num); |
@@ -96,7 +95,6 @@ int RAND_write_file(const char *file); | |||
96 | const char *RAND_file_name(char *file, size_t num); | 95 | const char *RAND_file_name(char *file, size_t num); |
97 | int RAND_status(void); | 96 | int RAND_status(void); |
98 | int RAND_poll(void); | 97 | int RAND_poll(void); |
99 | #endif | ||
100 | 98 | ||
101 | void ERR_load_RAND_strings(void); | 99 | void ERR_load_RAND_strings(void); |
102 | 100 | ||
diff --git a/src/lib/libcrypto/rand/rand_lib.c b/src/lib/libcrypto/rand/rand_lib.c index b9ef0deebe..0c9810f848 100644 --- a/src/lib/libcrypto/rand/rand_lib.c +++ b/src/lib/libcrypto/rand/rand_lib.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: rand_lib.c,v 1.23 2023/11/19 15:46:10 tb Exp $ */ | 1 | /* $OpenBSD: rand_lib.c,v 1.24 2024/04/10 14:53:01 beck Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2014 Ted Unangst <tedu@openbsd.org> | 3 | * Copyright (c) 2014 Ted Unangst <tedu@openbsd.org> |
4 | * | 4 | * |
@@ -50,30 +50,35 @@ RAND_cleanup(void) | |||
50 | { | 50 | { |
51 | 51 | ||
52 | } | 52 | } |
53 | LCRYPTO_ALIAS(RAND_cleanup); | ||
53 | 54 | ||
54 | void | 55 | void |
55 | RAND_seed(const void *buf, int num) | 56 | RAND_seed(const void *buf, int num) |
56 | { | 57 | { |
57 | 58 | ||
58 | } | 59 | } |
60 | LCRYPTO_ALIAS(RAND_seed); | ||
59 | 61 | ||
60 | void | 62 | void |
61 | RAND_add(const void *buf, int num, double entropy) | 63 | RAND_add(const void *buf, int num, double entropy) |
62 | { | 64 | { |
63 | 65 | ||
64 | } | 66 | } |
67 | LCRYPTO_ALIAS(RAND_add); | ||
65 | 68 | ||
66 | int | 69 | int |
67 | RAND_status(void) | 70 | RAND_status(void) |
68 | { | 71 | { |
69 | return 1; | 72 | return 1; |
70 | } | 73 | } |
74 | LCRYPTO_ALIAS(RAND_status); | ||
71 | 75 | ||
72 | int | 76 | int |
73 | RAND_poll(void) | 77 | RAND_poll(void) |
74 | { | 78 | { |
75 | return 1; | 79 | return 1; |
76 | } | 80 | } |
81 | LCRYPTO_ALIAS(RAND_poll); | ||
77 | 82 | ||
78 | /* | 83 | /* |
79 | * Hurray. You've made it to the good parts. | 84 | * Hurray. You've made it to the good parts. |
@@ -85,6 +90,7 @@ RAND_bytes(unsigned char *buf, int num) | |||
85 | arc4random_buf(buf, num); | 90 | arc4random_buf(buf, num); |
86 | return 1; | 91 | return 1; |
87 | } | 92 | } |
93 | LCRYPTO_ALIAS(RAND_bytes); | ||
88 | 94 | ||
89 | int | 95 | int |
90 | RAND_pseudo_bytes(unsigned char *buf, int num) | 96 | RAND_pseudo_bytes(unsigned char *buf, int num) |
@@ -93,3 +99,4 @@ RAND_pseudo_bytes(unsigned char *buf, int num) | |||
93 | arc4random_buf(buf, num); | 99 | arc4random_buf(buf, num); |
94 | return 1; | 100 | return 1; |
95 | } | 101 | } |
102 | LCRYPTO_ALIAS(RAND_pseudo_bytes); | ||
diff --git a/src/lib/libcrypto/rand/randfile.c b/src/lib/libcrypto/rand/randfile.c index 00008af755..5fdfcb8dd3 100644 --- a/src/lib/libcrypto/rand/randfile.c +++ b/src/lib/libcrypto/rand/randfile.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: randfile.c,v 1.44 2023/07/07 19:37:54 beck Exp $ */ | 1 | /* $OpenBSD: randfile.c,v 1.45 2024/04/10 14:53:01 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 | * |
@@ -85,6 +85,7 @@ RAND_load_file(const char *file, long bytes) | |||
85 | else | 85 | else |
86 | return bytes; | 86 | return bytes; |
87 | } | 87 | } |
88 | LCRYPTO_ALIAS(RAND_load_file); | ||
88 | 89 | ||
89 | int | 90 | int |
90 | RAND_write_file(const char *file) | 91 | RAND_write_file(const char *file) |
@@ -133,6 +134,7 @@ RAND_write_file(const char *file) | |||
133 | explicit_bzero(buf, BUFSIZE); | 134 | explicit_bzero(buf, BUFSIZE); |
134 | return ret; | 135 | return ret; |
135 | } | 136 | } |
137 | LCRYPTO_ALIAS(RAND_write_file); | ||
136 | 138 | ||
137 | const char * | 139 | const char * |
138 | RAND_file_name(char * buf, size_t size) | 140 | RAND_file_name(char * buf, size_t size) |
@@ -141,3 +143,4 @@ RAND_file_name(char * buf, size_t size) | |||
141 | return (NULL); | 143 | return (NULL); |
142 | return buf; | 144 | return buf; |
143 | } | 145 | } |
146 | LCRYPTO_ALIAS(RAND_file_name); | ||