Browse Source

CMakeLists.txt: synchronize CMAKE_C_FLAGS with diagnostic flags set in autotools-generated Makefile (-Wall -Wextra -Wno-unused -Werror), and fix WOLFSSL_RSA_PSS to add -DWOLFSSL_PSS_LONG_SALT as needed by changes to test_wolfSSL_CertRsaPss() in fb531dacc2 (gating of those changes is also added in this commit).

Daniel Pouzzner 1 year ago
parent
commit
e382905311
3 changed files with 4 additions and 3 deletions
  1. 3 0
      CMakeLists.txt
  2. 0 2
      cmake/functions.cmake
  3. 1 1
      tests/api.c

+ 3 - 0
CMakeLists.txt

@@ -167,6 +167,8 @@ find_package(Threads)
 # Example for map file and custom linker script
 #set(CMAKE_EXE_LINKER_FLAGS " -Xlinker -Map=output.map -T\"${CMAKE_CURRENT_SOURCE_DIR}/linker.ld\"")
 
+set(CMAKE_C_FLAGS "-Wall -Wextra -Wno-unused -Werror ${CMAKE_C_FLAGS}")
+
 ####################################################
 # Build Options
 ####################################################
@@ -874,6 +876,7 @@ else()
 endif()
 if(WOLFSSL_RSA_PSS)
     list(APPEND WOLFSSL_DEFINITIONS "-DWC_RSA_PSS")
+    list(APPEND WOLFSSL_DEFINITIONS "-DWOLFSSL_PSS_LONG_SALT")
 endif()
 
 # DH

+ 0 - 2
cmake/functions.cmake

@@ -905,8 +905,6 @@ function(add_to_options_file DEFINITIONS OPTION_FILE)
             endif()
 
             file(APPEND ${OPTION_FILE} "\n")
-        else()
-            message("option w/o begin -D is ${DEF}, not saving to ${OPTION_FILE}")
         endif()
     endforeach()
 endfunction()

+ 1 - 1
tests/api.c

@@ -2416,7 +2416,7 @@ static int test_wolfSSL_CertRsaPss(void)
     AssertIntEQ(wc_ParseCert(&cert, CERT_TYPE, VERIFY, cm), 0);
     wc_FreeDecodedCert(&cert);
 
-#ifdef WOLFSSL_SHA384
+#if defined(WOLFSSL_SHA384) && defined(WOLFSSL_PSS_LONG_SALT)
     f = XFOPEN(rsaPssSha384Cert, "rb");
     AssertTrue((f != XBADFILE));
     bytes = (int)XFREAD(buf, 1, sizeof(buf), f);