summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbeck <>2024-04-10 14:53:01 +0000
committerbeck <>2024-04-10 14:53:01 +0000
commitc74048d53051ecb8d267b8b92af44b32f0bd928c (patch)
treead58252de816fa1777a2122eef964ba74c98a5c9
parent28391ee6892093e7875a30c2bc0924a7bbcb17ea (diff)
downloadopenbsd-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.namespace10
-rw-r--r--src/lib/libcrypto/hidden/openssl/rand.h12
-rw-r--r--src/lib/libcrypto/rand/rand.h4
-rw-r--r--src/lib/libcrypto/rand/rand_lib.c9
-rw-r--r--src/lib/libcrypto/rand/randfile.c5
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);
29LCRYPTO_USED(RAND_get_rand_method); 29LCRYPTO_USED(RAND_get_rand_method);
30LCRYPTO_USED(RAND_SSLeay); 30LCRYPTO_USED(RAND_SSLeay);
31LCRYPTO_USED(ERR_load_RAND_strings); 31LCRYPTO_USED(ERR_load_RAND_strings);
32LCRYPTO_UNUSED(RAND_cleanup);
33LCRYPTO_UNUSED(RAND_bytes);
34LCRYPTO_UNUSED(RAND_pseudo_bytes);
35LCRYPTO_UNUSED(RAND_seed);
36LCRYPTO_UNUSED(RAND_add);
37LCRYPTO_UNUSED(RAND_load_file);
38LCRYPTO_UNUSED(RAND_write_file);
39LCRYPTO_UNUSED(RAND_file_name);
40LCRYPTO_UNUSED(RAND_status);
41LCRYPTO_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);
85const RAND_METHOD *RAND_get_rand_method(void); 85const RAND_METHOD *RAND_get_rand_method(void);
86RAND_METHOD *RAND_SSLeay(void); 86RAND_METHOD *RAND_SSLeay(void);
87 87
88#ifndef LIBRESSL_INTERNAL
89void RAND_cleanup(void ); 88void RAND_cleanup(void );
90int RAND_bytes(unsigned char *buf, int num); 89int RAND_bytes(unsigned char *buf, int num);
91int RAND_pseudo_bytes(unsigned char *buf, int num); 90int RAND_pseudo_bytes(unsigned char *buf, int num);
@@ -96,7 +95,6 @@ int RAND_write_file(const char *file);
96const char *RAND_file_name(char *file, size_t num); 95const char *RAND_file_name(char *file, size_t num);
97int RAND_status(void); 96int RAND_status(void);
98int RAND_poll(void); 97int RAND_poll(void);
99#endif
100 98
101void ERR_load_RAND_strings(void); 99void 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}
53LCRYPTO_ALIAS(RAND_cleanup);
53 54
54void 55void
55RAND_seed(const void *buf, int num) 56RAND_seed(const void *buf, int num)
56{ 57{
57 58
58} 59}
60LCRYPTO_ALIAS(RAND_seed);
59 61
60void 62void
61RAND_add(const void *buf, int num, double entropy) 63RAND_add(const void *buf, int num, double entropy)
62{ 64{
63 65
64} 66}
67LCRYPTO_ALIAS(RAND_add);
65 68
66int 69int
67RAND_status(void) 70RAND_status(void)
68{ 71{
69 return 1; 72 return 1;
70} 73}
74LCRYPTO_ALIAS(RAND_status);
71 75
72int 76int
73RAND_poll(void) 77RAND_poll(void)
74{ 78{
75 return 1; 79 return 1;
76} 80}
81LCRYPTO_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}
93LCRYPTO_ALIAS(RAND_bytes);
88 94
89int 95int
90RAND_pseudo_bytes(unsigned char *buf, int num) 96RAND_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}
102LCRYPTO_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}
88LCRYPTO_ALIAS(RAND_load_file);
88 89
89int 90int
90RAND_write_file(const char *file) 91RAND_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}
137LCRYPTO_ALIAS(RAND_write_file);
136 138
137const char * 139const char *
138RAND_file_name(char * buf, size_t size) 140RAND_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}
146LCRYPTO_ALIAS(RAND_file_name);