summaryrefslogtreecommitdiffhomepage
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorMikael Magnusson <mikma@users.sourceforge.net>2024-09-22 11:40:51 +0200
committerMikael Magnusson <mikma@users.sourceforge.net>2024-11-22 12:59:13 +0100
commitbe34c719162bd03c235e7cf051bdc8f0ae234637 (patch)
treebc818d6c3cd9404541b3c0c8064983be93836167 /CMakeLists.txt
parentf00a211552eed0596c348f08a77cd041db716cd3 (diff)
lib: add Crypto OpenSSL plugin support
Implement message digest, and RSA, ECDSA and EdDSA signing and verification. Signed-off-by: Mikael Magnusson <mikma@users.sourceforge.net>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt14
1 files changed, 14 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3ceb0d3..727a9b8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -29,6 +29,7 @@ find_library(libubox NAMES ubox)
find_library(libubus NAMES ubus)
find_library(libblobmsg_json NAMES blobmsg_json)
find_library(libmbedtls NAMES mbedtls)
+find_library(libcrypto NAMES crypto)
find_package(ZLIB)
if(LINUX)
@@ -59,6 +60,10 @@ if(libmbedtls)
set(DEFAULT_CRYPTO_MBEDTLS_SUPPORT ON)
endif()
+if(libcrypto)
+ set(DEFAULT_CRYPTO_OPENSSL_SUPPORT ON)
+endif()
+
option(DEBUG_SUPPORT "Debug plugin support" ON)
option(FS_SUPPORT "Filesystem plugin support" ON)
option(MATH_SUPPORT "Math plugin support" ON)
@@ -73,6 +78,7 @@ option(LOG_SUPPORT "Log plugin support" ON)
option(SOCKET_SUPPORT "Socket plugin support" ON)
option(ZLIB_SUPPORT "Zlib plugin support" ${DEFAULT_ZLIB_SUPPORT})
option(CRYPTO_MBEDTLS_SUPPORT "Crypto Mbed-TLS plugin support" ${DEFAULT_CRYPTO_MBEDTLS_SUPPORT})
+option(CRYPTO_OPENSSL_SUPPORT "Crypto OpenSSL plugin support" ${DEFAULT_CRYPTO_OPENSSL_SUPPORT})
set(LIB_SEARCH_PATH "${CMAKE_INSTALL_PREFIX}/lib/ucode/*.so:${CMAKE_INSTALL_PREFIX}/share/ucode/*.uc:./*.so:./*.uc" CACHE STRING "Default library search path")
string(REPLACE ":" "\", \"" LIB_SEARCH_DEFINE "${LIB_SEARCH_PATH}")
@@ -304,6 +310,14 @@ if(CRYPTO_MBEDTLS_SUPPORT)
target_link_libraries(crypto_mbedtls_lib ${libmbedtls})
endif()
+if(CRYPTO_OPENSSL_SUPPORT)
+ set(LIBRARIES ${LIBRARIES} crypto_openssl_lib)
+ add_library(crypto_openssl_lib MODULE lib/crypto-openssl.c)
+ set_target_properties(crypto_openssl_lib PROPERTIES OUTPUT_NAME crypto_openssl PREFIX "")
+ #target_link_options(crypto_openssl_lib PRIVATE ${UCODE_MODULE_LINK_OPTIONS} -Wl,-no-as-needed)
+ target_link_libraries(crypto_openssl_lib crypto)
+endif()
+
if(UNIT_TESTING)
enable_testing()
add_definitions(-DUNIT_TESTING)