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).

This commit is contained in:
Daniel Pouzzner 2022-08-12 15:18:41 -05:00
parent b4f1b6d04d
commit e382905311
3 changed files with 4 additions and 3 deletions

View File

@ -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

View File

@ -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()

View File

@ -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);