-
Notifications
You must be signed in to change notification settings - Fork 265
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -767,13 +767,13 @@ endif() | |
|
||
if(NOT HAVE_ASPRINTF) | ||
set(CRYPTO_SRC ${CRYPTO_SRC} compat/bsd-asprintf.c) | ||
set(EXTRA_EXPORT ${EXTRA_EXPORT} asprintf) | ||
set(EXTRA_EXPORT ${EXTRA_EXPORT} vasprintf) | ||
set(EXTRA_EXPORT ${EXTRA_EXPORT} libressl_asprintf) | ||
set(EXTRA_EXPORT ${EXTRA_EXPORT} libressl_vasprintf) | ||
endif() | ||
|
||
if(NOT HAVE_FREEZERO) | ||
set(CRYPTO_SRC ${CRYPTO_SRC} compat/freezero.c) | ||
set(EXTRA_EXPORT ${EXTRA_EXPORT} freezero) | ||
set(EXTRA_EXPORT ${EXTRA_EXPORT} libressl_freezero) | ||
endif() | ||
|
||
if(NOT HAVE_GETOPT) | ||
|
@@ -799,46 +799,46 @@ endif() | |
|
||
if(NOT HAVE_REALLOCARRAY) | ||
set(CRYPTO_SRC ${CRYPTO_SRC} compat/reallocarray.c) | ||
set(EXTRA_EXPORT ${EXTRA_EXPORT} reallocarray) | ||
set(EXTRA_EXPORT ${EXTRA_EXPORT} libressl_reallocarray) | ||
endif() | ||
|
||
if(NOT HAVE_RECALLOCARRAY) | ||
set(CRYPTO_SRC ${CRYPTO_SRC} compat/recallocarray.c) | ||
set(EXTRA_EXPORT ${EXTRA_EXPORT} recallocarray) | ||
set(EXTRA_EXPORT ${EXTRA_EXPORT} libressl_recallocarray) | ||
endif() | ||
|
||
if(NOT HAVE_STRCASECMP) | ||
set(CRYPTO_SRC ${CRYPTO_SRC} compat/strcasecmp.c) | ||
set(EXTRA_EXPORT ${EXTRA_EXPORT} strcasecmp) | ||
set(EXTRA_EXPORT ${EXTRA_EXPORT} libressl_strcasecmp) | ||
endif() | ||
|
||
if(NOT HAVE_STRLCAT) | ||
set(CRYPTO_SRC ${CRYPTO_SRC} compat/strlcat.c) | ||
set(EXTRA_EXPORT ${EXTRA_EXPORT} strlcat) | ||
set(EXTRA_EXPORT ${EXTRA_EXPORT} libressl_strlcat) | ||
endif() | ||
|
||
if(NOT HAVE_STRLCPY) | ||
set(CRYPTO_SRC ${CRYPTO_SRC} compat/strlcpy.c) | ||
set(EXTRA_EXPORT ${EXTRA_EXPORT} strlcpy) | ||
set(EXTRA_EXPORT ${EXTRA_EXPORT} libressl_strlcpy) | ||
endif() | ||
|
||
if(NOT HAVE_STRNDUP) | ||
set(CRYPTO_SRC ${CRYPTO_SRC} compat/strndup.c) | ||
set(EXTRA_EXPORT ${EXTRA_EXPORT} strndup) | ||
set(EXTRA_EXPORT ${EXTRA_EXPORT} libressl_strndup) | ||
if(NOT HAVE_STRNLEN) | ||
set(CRYPTO_SRC ${CRYPTO_SRC} compat/strnlen.c) | ||
set(EXTRA_EXPORT ${EXTRA_EXPORT} strnlen) | ||
set(EXTRA_EXPORT ${EXTRA_EXPORT} libressl_strnlen) | ||
endif() | ||
endif() | ||
|
||
if(NOT HAVE_STRSEP) | ||
set(CRYPTO_SRC ${CRYPTO_SRC} compat/strsep.c) | ||
set(EXTRA_EXPORT ${EXTRA_EXPORT} strsep) | ||
set(EXTRA_EXPORT ${EXTRA_EXPORT} libressl_strsep) | ||
endif() | ||
|
||
if(NOT HAVE_STRTONUM) | ||
set(CRYPTO_SRC ${CRYPTO_SRC} compat/strtonum.c) | ||
set(EXTRA_EXPORT ${EXTRA_EXPORT} strtonum) | ||
set(EXTRA_EXPORT ${EXTRA_EXPORT} libressl_strtonum) | ||
endif() | ||
|
||
if(NOT HAVE_SYSLOG_R) | ||
|
@@ -857,15 +857,15 @@ if(NOT HAVE_EXPLICIT_BZERO) | |
set(CRYPTO_SRC ${CRYPTO_SRC} compat/explicit_bzero.c) | ||
set_source_files_properties(compat/explicit_bzero.c PROPERTIES COMPILE_FLAGS -O0) | ||
endif() | ||
set(EXTRA_EXPORT ${EXTRA_EXPORT} explicit_bzero) | ||
set(EXTRA_EXPORT ${EXTRA_EXPORT} libressl_explicit_bzero) | ||
endif() | ||
|
||
if(NOT HAVE_ARC4RANDOM_BUF) | ||
set(CRYPTO_SRC ${CRYPTO_SRC} compat/arc4random.c) | ||
set(CRYPTO_SRC ${CRYPTO_SRC} compat/arc4random_uniform.c) | ||
set(EXTRA_EXPORT ${EXTRA_EXPORT} arc4random) | ||
set(EXTRA_EXPORT ${EXTRA_EXPORT} arc4random_buf) | ||
set(EXTRA_EXPORT ${EXTRA_EXPORT} arc4random_uniform) | ||
set(EXTRA_EXPORT ${EXTRA_EXPORT} libressl_arc4random) | ||
set(EXTRA_EXPORT ${EXTRA_EXPORT} libressl_arc4random_buf) | ||
set(EXTRA_EXPORT ${EXTRA_EXPORT} libressl_arc4random_uniform) | ||
|
||
if(NOT HAVE_GETENTROPY) | ||
if(WIN32) | ||
|
@@ -891,12 +891,12 @@ endif() | |
|
||
if(NOT HAVE_TIMINGSAFE_BCMP) | ||
set(CRYPTO_SRC ${CRYPTO_SRC} compat/timingsafe_bcmp.c) | ||
set(EXTRA_EXPORT ${EXTRA_EXPORT} timingsafe_bcmp) | ||
set(EXTRA_EXPORT ${EXTRA_EXPORT} libressl_timingsafe_bcmp) | ||
endif() | ||
|
||
if(NOT HAVE_TIMINGSAFE_MEMCMP) | ||
set(CRYPTO_SRC ${CRYPTO_SRC} compat/timingsafe_memcmp.c) | ||
set(EXTRA_EXPORT ${EXTRA_EXPORT} timingsafe_memcmp) | ||
set(EXTRA_EXPORT ${EXTRA_EXPORT} libressl_timingsafe_memcmp) | ||
endif() | ||
|
||
if(NOT ENABLE_ASM) | ||
|
@@ -919,6 +919,7 @@ foreach(SYM IN LISTS CRYPTO_UNEXPORT) | |
string(REPLACE "${SYM}\n" "" SYMS ${SYMS}) | ||
endforeach() | ||
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/crypto_p.sym ${SYMS}) | ||
# XXX should we still be doing this? | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
botovq
Author
Contributor
|
||
if(EXTRA_EXPORT) | ||
list(SORT EXTRA_EXPORT) | ||
foreach(SYM IN LISTS EXTRA_EXPORT) | ||
|
Just noticed this. My understanding is that we add these symbols to the list of functions we explicitly export from a Windows DLL, because a local app (e.g. openssl.exe), libssl or libtls need to call them when linking libcrypto dynamically. The downside is that someone might assume these are part of the LibreSSL API and call into them from user code.
To avoid giving that impression and making clear the "exported but internal" nature, prefixing them with an underscore might be useful.
For those functions that are only referenced from libcrypto itself, these exports would better be deleted.