Finish hiding symbols in rand.h
authorbeck <beck@openbsd.org>
Wed, 10 Apr 2024 14:53:01 +0000 (14:53 +0000)
committerbeck <beck@openbsd.org>
Wed, 10 Apr 2024 14:53:01 +0000 (14:53 +0000)
This removes the LIBRESSL_INTERNAL guards and marks
the functions within as LCRYPTO_UNUSED

lib/libcrypto/Symbols.namespace
lib/libcrypto/hidden/openssl/rand.h
lib/libcrypto/rand/rand.h
lib/libcrypto/rand/rand_lib.c
lib/libcrypto/rand/randfile.c

index 0f44808..b1be9dc 100644 (file)
@@ -3179,3 +3179,13 @@ _libre_FIPS_mode
 _libre_FIPS_mode_set
 _libre_OPENSSL_init
 _libre_CRYPTO_memcmp
+_libre_RAND_cleanup
+_libre_RAND_bytes
+_libre_RAND_pseudo_bytes
+_libre_RAND_seed
+_libre_RAND_add
+_libre_RAND_load_file
+_libre_RAND_write_file
+_libre_RAND_file_name
+_libre_RAND_status
+_libre_RAND_poll
index 978d10f..d06442a 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: rand.h,v 1.3 2023/07/28 09:53:55 tb Exp $ */
+/* $OpenBSD: rand.h,v 1.4 2024/04/10 14:53:01 beck Exp $ */
 /*
  * Copyright (c) 2023 Bob Beck <beck@openbsd.org>
  *
@@ -29,5 +29,15 @@ LCRYPTO_USED(RAND_set_rand_method);
 LCRYPTO_USED(RAND_get_rand_method);
 LCRYPTO_USED(RAND_SSLeay);
 LCRYPTO_USED(ERR_load_RAND_strings);
+LCRYPTO_UNUSED(RAND_cleanup);
+LCRYPTO_UNUSED(RAND_bytes);
+LCRYPTO_UNUSED(RAND_pseudo_bytes);
+LCRYPTO_UNUSED(RAND_seed);
+LCRYPTO_UNUSED(RAND_add);
+LCRYPTO_UNUSED(RAND_load_file);
+LCRYPTO_UNUSED(RAND_write_file);
+LCRYPTO_UNUSED(RAND_file_name);
+LCRYPTO_UNUSED(RAND_status);
+LCRYPTO_UNUSED(RAND_poll);
 
 #endif /* _LIBCRYPTO_RAND_H */
index d66d715..1a2c8f7 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: rand.h,v 1.24 2023/11/19 15:46:10 tb Exp $ */
+/* $OpenBSD: rand.h,v 1.25 2024/04/10 14:53:01 beck Exp $ */
 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
  * All rights reserved.
  *
@@ -85,7 +85,6 @@ int RAND_set_rand_method(const RAND_METHOD *meth);
 const RAND_METHOD *RAND_get_rand_method(void);
 RAND_METHOD *RAND_SSLeay(void);
 
-#ifndef LIBRESSL_INTERNAL
 void RAND_cleanup(void );
 int  RAND_bytes(unsigned char *buf, int num);
 int  RAND_pseudo_bytes(unsigned char *buf, int num);
@@ -96,7 +95,6 @@ int  RAND_write_file(const char *file);
 const char *RAND_file_name(char *file, size_t num);
 int RAND_status(void);
 int RAND_poll(void);
-#endif
 
 void ERR_load_RAND_strings(void);
 
index b9ef0de..0c9810f 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: rand_lib.c,v 1.23 2023/11/19 15:46:10 tb Exp $ */
+/* $OpenBSD: rand_lib.c,v 1.24 2024/04/10 14:53:01 beck Exp $ */
 /*
  * Copyright (c) 2014 Ted Unangst <tedu@openbsd.org>
  *
@@ -50,30 +50,35 @@ RAND_cleanup(void)
 {
 
 }
+LCRYPTO_ALIAS(RAND_cleanup);
 
 void
 RAND_seed(const void *buf, int num)
 {
 
 }
+LCRYPTO_ALIAS(RAND_seed);
 
 void
 RAND_add(const void *buf, int num, double entropy)
 {
 
 }
+LCRYPTO_ALIAS(RAND_add);
 
 int
 RAND_status(void)
 {
        return 1;
 }
+LCRYPTO_ALIAS(RAND_status);
 
 int
 RAND_poll(void)
 {
        return 1;
 }
+LCRYPTO_ALIAS(RAND_poll);
 
 /*
  * Hurray. You've made it to the good parts.
@@ -85,6 +90,7 @@ RAND_bytes(unsigned char *buf, int num)
                arc4random_buf(buf, num);
        return 1;
 }
+LCRYPTO_ALIAS(RAND_bytes);
 
 int
 RAND_pseudo_bytes(unsigned char *buf, int num)
@@ -93,3 +99,4 @@ RAND_pseudo_bytes(unsigned char *buf, int num)
                arc4random_buf(buf, num);
        return 1;
 }
+LCRYPTO_ALIAS(RAND_pseudo_bytes);
index 00008af..5fdfcb8 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: randfile.c,v 1.44 2023/07/07 19:37:54 beck Exp $ */
+/* $OpenBSD: randfile.c,v 1.45 2024/04/10 14:53:01 beck Exp $ */
 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
  * All rights reserved.
  *
@@ -85,6 +85,7 @@ RAND_load_file(const char *file, long bytes)
        else
                return bytes;
 }
+LCRYPTO_ALIAS(RAND_load_file);
 
 int
 RAND_write_file(const char *file)
@@ -133,6 +134,7 @@ RAND_write_file(const char *file)
        explicit_bzero(buf, BUFSIZE);
        return ret;
 }
+LCRYPTO_ALIAS(RAND_write_file);
 
 const char *
 RAND_file_name(char * buf, size_t size)
@@ -141,3 +143,4 @@ RAND_file_name(char * buf, size_t size)
                return (NULL);
        return buf;
 }
+LCRYPTO_ALIAS(RAND_file_name);