From da084a3ebd3e60de86cc345ea3daeab3415e1e57 Mon Sep 17 00:00:00 2001 From: David Benjamin Date: Mon, 5 Oct 2015 21:32:10 -0400 Subject: [PATCH] Fix shared library build on OS X. It seems OS X actually cares about symbol resolution and dependencies when you create a dylib. Probably because they do two-level name resolution. (Obligatory disclaimer: BoringSSL does not have a stable ABI and is thus not suitable for a traditional system-wide library.) BUG=539603 Change-Id: Ic26c4ad23840fe6c1f4825c44671e74dd2e33870 Reviewed-on: https://boringssl-review.googlesource.com/6131 Reviewed-by: Adam Langley --- crypto/des/des.c | 2 -- decrepit/CMakeLists.txt | 2 ++ decrepit/des/cfb64ede.c | 6 ------ include/openssl/des.h | 13 +++++++++++++ ssl/CMakeLists.txt | 2 ++ 5 files changed, 17 insertions(+), 8 deletions(-) diff --git a/crypto/des/des.c b/crypto/des/des.c index a5669a62..1d27ebe4 100644 --- a/crypto/des/des.c +++ b/crypto/des/des.c @@ -499,7 +499,6 @@ static void DES_encrypt2(uint32_t *data, const DES_key_schedule *ks, int enc) { data[1] = ROTATE(r, 3) & 0xffffffffL; } -/* DES_encrypt3 is not static because it's used in decrepit. */ void DES_encrypt3(uint32_t *data, const DES_key_schedule *ks1, const DES_key_schedule *ks2, const DES_key_schedule *ks3) { uint32_t l, r; @@ -519,7 +518,6 @@ void DES_encrypt3(uint32_t *data, const DES_key_schedule *ks1, data[1] = r; } -/* DES_decrypt3 is not static because it's used in decrepit. */ void DES_decrypt3(uint32_t *data, const DES_key_schedule *ks1, const DES_key_schedule *ks2, const DES_key_schedule *ks3) { uint32_t l, r; diff --git a/decrepit/CMakeLists.txt b/decrepit/CMakeLists.txt index 84e52522..0773f9a6 100644 --- a/decrepit/CMakeLists.txt +++ b/decrepit/CMakeLists.txt @@ -15,3 +15,5 @@ add_library( $ $ ) + +target_link_libraries(decrepit crypto) diff --git a/decrepit/des/cfb64ede.c b/decrepit/des/cfb64ede.c index 680a75a6..f7e81d45 100644 --- a/decrepit/des/cfb64ede.c +++ b/decrepit/des/cfb64ede.c @@ -61,12 +61,6 @@ #include "../crypto/des/internal.h" -/* defined in des.c */ -void DES_decrypt3(uint32_t *data, const DES_key_schedule *ks1, - const DES_key_schedule *ks2, const DES_key_schedule *ks3); -void DES_encrypt3(uint32_t *data, const DES_key_schedule *ks1, - const DES_key_schedule *ks2, const DES_key_schedule *ks3); - /* The input and output encrypted as though 64bit cfb mode is being used. The * extra state information to record how much of the 64bit block we have used * is contained in *num; */ diff --git a/include/openssl/des.h b/include/openssl/des.h index f9db62d6..2b8dd0f6 100644 --- a/include/openssl/des.h +++ b/include/openssl/des.h @@ -157,6 +157,19 @@ OPENSSL_EXPORT void DES_ede3_cfb_encrypt(const uint8_t *in, uint8_t *out, DES_cblock *ivec, int enc); +/* Private functions. + * + * These functions are only exported for use in |decrepit|. */ + +OPENSSL_EXPORT void DES_decrypt3(uint32_t *data, const DES_key_schedule *ks1, + const DES_key_schedule *ks2, + const DES_key_schedule *ks3); + +OPENSSL_EXPORT void DES_encrypt3(uint32_t *data, const DES_key_schedule *ks1, + const DES_key_schedule *ks2, + const DES_key_schedule *ks3); + + #if defined(__cplusplus) } /* extern C */ #endif diff --git a/ssl/CMakeLists.txt b/ssl/CMakeLists.txt index 86176392..a5ad1260 100644 --- a/ssl/CMakeLists.txt +++ b/ssl/CMakeLists.txt @@ -38,6 +38,8 @@ add_library( $ ) +target_link_libraries(ssl crypto) + add_executable( ssl_test