@@ -427,6 +427,18 @@ if(WOLFSSL_DTLS_CID)
427427 list (APPEND WOLFSSL_DEFINITIONS "-DWOLFSSL_DTLS_CID" )
428428endif ()
429429
430+ # DTLS 1.3 Fragment ClientHello
431+ add_option("WOLFSSL_DTLS_CH_FRAG"
432+ "Enable wolfSSL DTLS 1.3 Fragment ClientHello (default: disabled)"
433+ "no" "yes;no" )
434+
435+ if (WOLFSSL_DTLS_CH_FRAG)
436+ if (NOT WOLFSSL_DTLS13)
437+ message (FATAL_ERROR "DTLS 1.3 Fragment ClientHello are supported only for DTLSv1.3" )
438+ endif ()
439+ list (APPEND WOLFSSL_DEFINITIONS "-DWOLFSSL_DTLS_CH_FRAG" )
440+ endif ()
441+
430442# RNG
431443add_option("WOLFSSL_RNG"
432444 "Enable compiling and using RNG (default: enabled)"
@@ -513,6 +525,7 @@ endif()
513525
514526if (WOLFSSL_WOLFSSH OR WOLFSSL_WPAS)
515527 list (APPEND WOLFSSL_DEFINITIONS "-DWOLFSSL_PUBLIC_MP" )
528+ set (WOLFSSL_PUBLIC_MP ON )
516529endif ()
517530
518531# TODO: - DTLS-SCTP
@@ -881,6 +894,27 @@ add_option("WOLFSSL_AESOFB"
881894 "Enable wolfSSL AES-OFB support (default: disabled)"
882895 "no" "yes;no" )
883896
897+ # AES-ECB
898+ add_option("WOLFSSL_AESECB"
899+ "Enable wolfSSL AES-ECB support (default: disabled)"
900+ "no" "yes;no" )
901+
902+ if (WOLFSSL_AESECB)
903+ list (APPEND WOLFSSL_DEFINITIONS "-DHAVE_AES_ECB" )
904+ endif ()
905+
906+ # AES-CTS
907+ add_option("WOLFSSL_AESCTS"
908+ "Enable wolfSSL AES-CTS support (default: disabled)"
909+ "no" "yes;no" )
910+
911+ if (WOLFSSL_AESCTS)
912+ if (NOT WOLFSSL_AESCBC)
913+ message (FATAL_ERROR "AES-CTS requires AES-CBC." )
914+ endif ()
915+ list (APPEND WOLFSSL_DEFINITIONS "-DWOLFSSL_AES_CTS" )
916+ endif ()
917+
884918# TODO: - AES-GCM stream
885919# - AES-ARM
886920# - Xilinx hardened crypto
@@ -1081,6 +1115,7 @@ if(WOLFSSL_ECCSI)
10811115 endif ()
10821116
10831117 list (APPEND WOLFSSL_DEFINITIONS "-DWOLFCRYPT_HAVE_ECCSI -DWOLFSSL_PUBLIC_MP" )
1118+ set (WOLFSSL_PUBLIC_MP ON )
10841119endif ()
10851120
10861121# SAKKE
@@ -1105,6 +1140,14 @@ if(WOLFSSL_SIPHASH)
11051140 list (APPEND WOLFSSL_DEFINITIONS "-DWOLFSSL_SIPHASH" )
11061141endif ()
11071142
1143+ add_option("WOLFSSL_PUBLIC_MP"
1144+ "Enable public MP API (default: disabled)"
1145+ "no" "yes;no" )
1146+
1147+ if (WOLFSSL_PUBLIC_MP)
1148+ list (APPEND WOLFSSL_DEFINITIONS "-DWOLFSSL_PUBLIC_MP" )
1149+ endif ()
1150+
11081151# TODO: - Compressed key
11091152# - FP ECC, fixed point cache ECC
11101153# - ECC encrypt
@@ -1435,6 +1478,12 @@ if(NOT WOLFSSL_AES)
14351478 if (WOLFSSL_AESCTR)
14361479 message (FATAL_ERROR "AESCTR requires AES." )
14371480 endif ()
1481+ if (WOLFSSL_AESECB)
1482+ message (FATAL_ERROR "AES-ECB requires AES." )
1483+ endif ()
1484+ if (WOLFSSL_AESCTS)
1485+ message (FATAL_ERROR "AES-CTS requires AES." )
1486+ endif ()
14381487else ()
14391488 if (WOLFSSL_LEAN_PSK)
14401489 list (APPEND WOLFSSL_DEFINITIONS "-DNO_AES" )
@@ -2196,13 +2245,14 @@ if(WOLFSSL_AESOFB)
21962245endif ()
21972246
21982247if (WOLFSSL_TPM)
2199- override_cache(WOLFSSL_KEYGEN "yes" )
2200- override_cache(WOLFSSL_CERTGEN "yes" )
2201- override_cache(WOLFSSL_CRYPTOCB "yes" )
2202- override_cache(WOLFSSL_CERTREQ "yes" )
2203- override_cache(WOLFSSL_CERTEXT "yes" )
2204- override_cache(WOLFSSL_PKCS7 "yes" )
2205- override_cache(WOLFSSL_AESCFB "yes" )
2248+ override_cache(WOLFSSL_KEYGEN "yes" )
2249+ override_cache(WOLFSSL_CERTGEN "yes" )
2250+ override_cache(WOLFSSL_CRYPTOCB "yes" )
2251+ override_cache(WOLFSSL_CERTREQ "yes" )
2252+ override_cache(WOLFSSL_CERTEXT "yes" )
2253+ override_cache(WOLFSSL_PKCS7 "yes" )
2254+ override_cache(WOLFSSL_AESCFB "yes" )
2255+ override_cache(WOLFSSL_PUBLIC_MP "yes" )
22062256 list (APPEND WOLFSSL_DEFINITIONS "-DWOLFSSL_ALLOW_ENCODING_CA_FALSE" )
22072257endif ()
22082258
@@ -2600,7 +2650,7 @@ target_compile_definitions(wolfssl PRIVATE "BUILDING_WOLFSSL")
26002650if (${BUILD_SHARED_LIBS} )
26012651 target_compile_definitions (wolfssl PUBLIC "WOLFSSL_DLL" )
26022652endif ()
2603- target_compile_definitions (wolfssl PUBLIC ${WOLFSSL_DEFINITIONS} )
2653+ target_compile_definitions (wolfssl PRIVATE ${WOLFSSL_DEFINITIONS} )
26042654
26052655####################################################
26062656# Include Directories
@@ -2663,6 +2713,7 @@ if(WOLFSSL_EXAMPLES)
26632713 add_executable (client
26642714 ${CMAKE_CURRENT_SOURCE_DIR} /examples/client/client.c)
26652715 target_link_libraries (client wolfssl)
2716+ target_compile_definitions (client PRIVATE ${WOLFSSL_DEFINITIONS} )
26662717 set_property (TARGET client
26672718 PROPERTY RUNTIME_OUTPUT_DIRECTORY
26682719 ${WOLFSSL_OUTPUT_BASE} /examples/client)
@@ -2671,6 +2722,7 @@ if(WOLFSSL_EXAMPLES)
26712722 add_executable (server
26722723 ${CMAKE_CURRENT_SOURCE_DIR} /examples/server/server.c)
26732724 target_link_libraries (server wolfssl)
2725+ target_compile_definitions (server PRIVATE ${WOLFSSL_DEFINITIONS} )
26742726 set_property (TARGET server
26752727 PROPERTY RUNTIME_OUTPUT_DIRECTORY
26762728 ${WOLFSSL_OUTPUT_BASE} /examples/server)
@@ -2681,6 +2733,7 @@ if(WOLFSSL_EXAMPLES)
26812733 target_include_directories (echoclient PRIVATE
26822734 ${CMAKE_CURRENT_BINARY_DIR} )
26832735 target_link_libraries (echoclient wolfssl)
2736+ target_compile_definitions (echoclient PRIVATE ${WOLFSSL_DEFINITIONS} )
26842737 set_property (TARGET echoclient
26852738 PROPERTY RUNTIME_OUTPUT_DIRECTORY
26862739 ${WOLFSSL_OUTPUT_BASE} /examples/echoclient)
@@ -2691,6 +2744,7 @@ if(WOLFSSL_EXAMPLES)
26912744 target_include_directories (echoserver PRIVATE
26922745 ${CMAKE_CURRENT_BINARY_DIR} )
26932746 target_link_libraries (echoserver wolfssl)
2747+ target_compile_definitions (echoserver PRIVATE ${WOLFSSL_DEFINITIONS} )
26942748 set_property (TARGET echoserver
26952749 PROPERTY RUNTIME_OUTPUT_DIRECTORY
26962750 ${WOLFSSL_OUTPUT_BASE} /examples/echoserver)
@@ -2700,6 +2754,7 @@ if(WOLFSSL_EXAMPLES)
27002754 add_executable (tls_bench
27012755 ${CMAKE_CURRENT_SOURCE_DIR} /examples/benchmark/tls_bench.c)
27022756 target_link_libraries (tls_bench wolfssl)
2757+ target_compile_definitions (tls_bench PRIVATE ${WOLFSSL_DEFINITIONS} )
27032758 if (CMAKE_USE_PTHREADS_INIT)
27042759 target_link_libraries (tls_bench Threads::Threads)
27052760 endif ()
@@ -2804,6 +2859,7 @@ if(WOLFSSL_EXAMPLES)
28042859 ${CMAKE_CURRENT_BINARY_DIR} )
28052860 target_compile_options (unit_test PUBLIC "-DNO_MAIN_DRIVER" )
28062861 target_link_libraries (unit_test wolfssl)
2862+ target_compile_definitions (unit_test PRIVATE ${WOLFSSL_DEFINITIONS} )
28072863 if (CMAKE_USE_PTHREADS_INIT)
28082864 target_link_libraries (unit_test Threads::Threads)
28092865 endif ()
@@ -2829,6 +2885,7 @@ if(WOLFSSL_CRYPT_TESTS)
28292885 ${CMAKE_CURRENT_SOURCE_DIR} /wolfcrypt/test /test .c)
28302886 set_target_properties (wolfcrypttest_lib PROPERTIES OUTPUT_NAME "wolfcrypttest" )
28312887 target_link_libraries (wolfcrypttest_lib wolfssl)
2888+ target_compile_definitions (wolfcrypttest_lib PRIVATE ${WOLFSSL_DEFINITIONS} )
28322889 target_compile_options (wolfcrypttest_lib PRIVATE "-DNO_MAIN_DRIVER" )
28332890 if (WOLFSSL_CRYPT_TESTS_HELP)
28342891 target_compile_options (wolfcrypttest_lib PRIVATE "-DHAVE_WOLFCRYPT_TEST_OPTIONS" )
@@ -2839,13 +2896,15 @@ if(WOLFSSL_CRYPT_TESTS)
28392896 ${CMAKE_CURRENT_SOURCE_DIR} /wolfcrypt/benchmark/benchmark.c)
28402897 set_target_properties (wolfcryptbench_lib PROPERTIES OUTPUT_NAME "wolfcryptbench" )
28412898 target_link_libraries (wolfcryptbench_lib wolfssl)
2899+ target_compile_definitions (wolfcryptbench_lib PRIVATE ${WOLFSSL_DEFINITIONS} )
28422900 target_compile_options (wolfcryptbench_lib PRIVATE "-DNO_MAIN_DRIVER" )
28432901 endif ()
28442902
28452903 # Build wolfCrypt test executable.
28462904 add_executable (wolfcrypttest
28472905 ${CMAKE_CURRENT_SOURCE_DIR} /wolfcrypt/test /test .c)
28482906 target_link_libraries (wolfcrypttest wolfssl)
2907+ target_compile_definitions (wolfcrypttest PRIVATE ${WOLFSSL_DEFINITIONS} )
28492908 set_property (TARGET wolfcrypttest
28502909 PROPERTY RUNTIME_OUTPUT_DIRECTORY
28512910 ${WOLFSSL_OUTPUT_BASE} /wolfcrypt/test )
@@ -2865,6 +2924,7 @@ if(WOLFSSL_CRYPT_TESTS)
28652924 target_include_directories (wolfcryptbench PRIVATE
28662925 ${CMAKE_CURRENT_BINARY_DIR} )
28672926 target_link_libraries (wolfcryptbench wolfssl)
2927+ target_compile_definitions (wolfcryptbench PRIVATE ${WOLFSSL_DEFINITIONS} )
28682928 set_property (TARGET wolfcryptbench
28692929 PROPERTY RUNTIME_OUTPUT_DIRECTORY
28702930 ${WOLFSSL_OUTPUT_BASE} /wolfcrypt/benchmark)
@@ -3019,9 +3079,9 @@ if(WOLFSSL_INSTALL)
30193079 # Install the library
30203080 install (TARGETS wolfssl
30213081 EXPORT wolfssl-targets
3022- LIBRARY DESTINATION lib
3023- ARCHIVE DESTINATION lib
3024- RUNTIME DESTINATION bin
3082+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
3083+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
3084+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
30253085 )
30263086 # Install the headers
30273087 install (DIRECTORY ${WOLFSSL_OUTPUT_BASE} /wolfssl/
0 commit comments