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 <alangley@gmail.com>
diff --git a/crypto/des/des.c b/crypto/des/des.c
index a5669a6..1d27ebe 100644
--- a/crypto/des/des.c
+++ b/crypto/des/des.c
@@ -499,7 +499,6 @@
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 @@
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 84e5252..0773f9a 100644
--- a/decrepit/CMakeLists.txt
+++ b/decrepit/CMakeLists.txt
@@ -15,3 +15,5 @@
$<TARGET_OBJECTS:rsa_decrepit>
$<TARGET_OBJECTS:xts>
)
+
+target_link_libraries(decrepit crypto)
diff --git a/decrepit/des/cfb64ede.c b/decrepit/des/cfb64ede.c
index 680a75a..f7e81d4 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 f9db62d..2b8dd0f 100644
--- a/include/openssl/des.h
+++ b/include/openssl/des.h
@@ -157,6 +157,19 @@
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 8617639..a5ad126 100644
--- a/ssl/CMakeLists.txt
+++ b/ssl/CMakeLists.txt
@@ -38,6 +38,8 @@
$<TARGET_OBJECTS:pqueue>
)
+target_link_libraries(ssl crypto)
+
add_executable(
ssl_test