diff --git a/CMakeLists.txt b/CMakeLists.txt index 901267e6c..7adbe5bcc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -931,7 +931,7 @@ endif() # DH add_option("WOLFSSL_DH" "Enable DH (default: enabled)" - "yes" "yes;no") + "yes" "yes;no;const") if(WOLFSSL_OPENSSH) override_cache(WOLFSSL_DH "yes") @@ -946,6 +946,11 @@ else() endif() endif() +if("${WOLFSSL_DH}" STREQUAL "const") + list(APPEND WOLFSSL_DEFINITIONS "-DWOLFSSL_DH_CONST") + set(WOLFSSL_DH_CONST "yes") +endif() + # TODO: - Anonymous # ASN @@ -1949,7 +1954,7 @@ elseif(APPLE) ${SECURITY_FRAMEWORK}) endif() else() - if(WOLFSSL_DH) + if(WOLFSSL_DH AND NOT WOLFSSL_DH_CONST) # DH requires math (m) library target_link_libraries(wolfssl PUBLIC