From c0a7030e018d644bf0d71d714d6a1981ab7a11c0 Mon Sep 17 00:00:00 2001 From: "D. Cody Cutright" Date: Tue, 23 Jan 2024 08:40:41 -0500 Subject: [PATCH 1/3] KMC_CFFI_EXCLUDE Test Patch --- CMakeLists.txt | 3 +++ include/crypto_structs.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0aae90d5..4a9b79b3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,6 +44,7 @@ option(TEST_ENC "Tests - Encryption" OFF) OPTION(KMC_MDB_RH "KMC-MDB-RedHat-Integration-Testing" OFF) #Disabled by default, enable with: -DKMC_MDB_RH=ON OPTION(KMC_MDB_DB "KMC-MDB-Debian-Integration-Testing" OFF) #Disabled by default, enable with: -DKMC_MDB_DB=ON +OPTION(KMC_CFFI_EXCLUDE "KMC-Exclude-Problematic-CFFI-Code" OFF) #Disabled by default, enable with: -DKMC_CFFI_EXCLUDE=ON # # Build Flag Logic @@ -59,10 +60,12 @@ endif() IF(KMC_MDB_RH) ADD_DEFINITIONS(-DKMC_MDB_RH) + ADD_DEFINITIONS(-DKMC_CFFI_EXCLUDE) ENDIF(KMC_MDB_RH) IF(KMC_MDB_DB) ADD_DEFINITIONS(-DKMC_MDB_DB) + ADD_DEFINITIONS(-DKMC_CFFI_EXCLUDE) ENDIF(KMC_MDB_DB) if(SYSTEM_INSTALL) diff --git a/include/crypto_structs.h b/include/crypto_structs.h index 8cd13d23..584ae7e0 100644 --- a/include/crypto_structs.h +++ b/include/crypto_structs.h @@ -25,9 +25,11 @@ #include "common_types.h" #else // Assume build outside of NOS3/cFS infrastructure #include +#ifndef KMC_CFFI_EXCLUDE // Exclude libraries that CFFI parser can’t process #include #include #endif +#endif /* ** Definitions From ae01a58a74e7b8f07afa1aed4b2c56cacf13a7a6 Mon Sep 17 00:00:00 2001 From: "D. Cody Cutright" Date: Tue, 23 Jan 2024 08:45:01 -0500 Subject: [PATCH 2/3] Add flag to convenience script --- support/scripts/build_kmc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/support/scripts/build_kmc.sh b/support/scripts/build_kmc.sh index d329e4d8..d68f4af4 100755 --- a/support/scripts/build_kmc.sh +++ b/support/scripts/build_kmc.sh @@ -9,4 +9,4 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) source $SCRIPT_DIR/env.sh -cmake $BASE_DIR -DCODECOV=1 -DDEBUG=1 -DCRYPTO_KMC=1 -DKEY_KMC=1 -DMC_DISABLED=1 -DSA_MARIADB=1 -DTEST=1 -DTEST_ENC=1 && make && make test +cmake $BASE_DIR -DCODECOV=1 -DDEBUG=1 -DCRYPTO_KMC=1 -DKEY_KMC=1 -DMC_DISABLED=1 -DSA_MARIADB=1 -DTEST=1 -DTEST_ENC=1 -DKMC_CFFI_EXCLUDE && make && make test From 8d8c7baa3cf6193ae07c6bb9578f8e64f8188bd8 Mon Sep 17 00:00:00 2001 From: "D. Cody Cutright" Date: Tue, 23 Jan 2024 10:47:20 -0500 Subject: [PATCH 3/3] Fix CFFI_EXCLUDE Flag in build.kmc... caught by CI --- support/scripts/build_kmc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/support/scripts/build_kmc.sh b/support/scripts/build_kmc.sh index d68f4af4..e0c2846c 100755 --- a/support/scripts/build_kmc.sh +++ b/support/scripts/build_kmc.sh @@ -9,4 +9,4 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) source $SCRIPT_DIR/env.sh -cmake $BASE_DIR -DCODECOV=1 -DDEBUG=1 -DCRYPTO_KMC=1 -DKEY_KMC=1 -DMC_DISABLED=1 -DSA_MARIADB=1 -DTEST=1 -DTEST_ENC=1 -DKMC_CFFI_EXCLUDE && make && make test +cmake $BASE_DIR -DCODECOV=1 -DDEBUG=1 -DCRYPTO_KMC=1 -DKEY_KMC=1 -DMC_DISABLED=1 -DSA_MARIADB=1 -DTEST=1 -DTEST_ENC=1 -DKMC_CFFI_EXCLUDE=1 && make && make test