Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

217 mc how to handle where file is written #261

Merged
merged 3 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ project(crypto C)
set(SA_CUSTOM_PATH_DEFAULT "../../sa/custom")
set(KEY_CUSTOM_PATH_DEFAULT "../../key/custom")
set(MC_CUSTOM_PATH_DEFAULT "../../mc/custom")
set(MC_LOG_PATH_DEFAULT "log.txt")
set(CRYPTO_CUSTOM_PATH_DEFAULT "../../crypto/custom")


Expand Down Expand Up @@ -120,6 +121,13 @@ if(DEBUG)
add_compile_options(-ggdb)
endif()

if(DEFINED MC_LOG_CUSTOM_PATH)
message(STATUS "MC_LOG_CUSTOM_PATH set to: ${MC_LOG_CUSTOM_PATH}")
add_compile_definitions(MC_LOG_PATH="${MC_LOG_CUSTOM_PATH}")
else()
add_compile_definitions(MC_LOG_PATH="${MC_LOG_PATH_DEFAULT}")
endif()

IF(KMC_MDB_RH)
ADD_DEFINITIONS(-DKMC_MDB_RH)
ADD_DEFINITIONS(-DKMC_CFFI_EXCLUDE)
Expand Down
4 changes: 2 additions & 2 deletions src/mc/internal/mc_interface_internal.template.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ static int32_t mc_initialize(void)
int32_t status = CRYPTO_LIB_SUCCESS;

/* Open log */
mc_file_ptr = fopen("log.txt", "a");
mc_file_ptr = fopen(MC_LOG_PATH, "a");
if (mc_file_ptr == NULL)
{
status = CRYPTO_LIB_ERR_MC_INIT;
printf(KRED "ERROR: Monitoring andcontrol initialization - internal failed\n" RESET);
printf(KRED "ERROR: Monitoring and control initialization - internal failed\n" RESET);
}

return status;
Expand Down
2 changes: 2 additions & 0 deletions support/scripts/build_internal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
source $SCRIPT_DIR/env.sh

rm $BASE_DIR/CMakeCache.txt

cmake $BASE_DIR -DCODECOV=1 -DDEBUG=1 -DMC_INTERNAL=1 -DTEST=1 -DTEST_ENC=1 -DSA_FILE=1 -DKEY_VALIDATION=0 && make && make test
2 changes: 2 additions & 0 deletions support/scripts/build_kmc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
source $SCRIPT_DIR/env.sh

rm $BASE_DIR/CMakeCache.txt

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 -DSA_FILE=1 && make && make test
2 changes: 2 additions & 0 deletions support/scripts/build_minimal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
source $SCRIPT_DIR/env.sh

rm $BASE_DIR/CMakeCache.txt

cmake $BASE_DIR && make && make test
2 changes: 2 additions & 0 deletions support/scripts/build_rhel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
source $SCRIPT_DIR/env.sh

rm $BASE_DIR/CMakeCache.txt

cmake $BASE_DIR -DCODECOV=1 -DDEBUG=1 -DMC_INTERNAL=1 -DTEST=1 -DTEST_ENC=1 -DSA_FILE=1 && make && make test
2 changes: 2 additions & 0 deletions support/scripts/build_support.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
source $SCRIPT_DIR/env.sh

rm $BASE_DIR/CMakeCache.txt

cmake $BASE_DIR -DCODECOV=1 -DDEBUG=1 -DSUPPORT=1 -DTEST=1 -DTEST_ENC=1 && make && make test
2 changes: 2 additions & 0 deletions support/scripts/build_wolf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
source $SCRIPT_DIR/env.sh

rm $BASE_DIR/CMakeCache.txt

cmake $BASE_DIR -DCODECOV=1 -DDEBUG=1 -DCRYPTO_LIBGCRYPT=0 -DCRYPTO_WOLFSSL=1 -DTEST=1 -DTEST_ENC=1 -DSA_FILE=1 && make && make test
Loading