Skip to content

Commit

Permalink
[#145] Created sa folder with both internal and mariadb options;
Browse files Browse the repository at this point in the history
  • Loading branch information
jlucas9 committed Apr 25, 2023
1 parent 49848f0 commit 296b020
Show file tree
Hide file tree
Showing 17 changed files with 597 additions and 591 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/mariadb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ jobs:
working-directory: ${{github.workspace}}/build
#Maybe create a variable for this SQL location
run: |
cd /__w/CryptoLib/CryptoLib/src/crypto_sadb/sadb_mariadb_sql
cd /__w/CryptoLib/CryptoLib/src/sa/sadb_mariadb_sql
echo "----------------"
/etc/init.d/mysql start
mysql --host=localhost -uroot -pitc123! < delete_sadb.sql
mysql --host=localhost -uroot -pitc123! < create_sadb.sql
cd /__w/CryptoLib/CryptoLib/src/crypto_sadb/test_sadb_mariadb_sql
cd /__w/CryptoLib/CryptoLib/src/sa/test_sadb_mariadb_sql
mysql --host=localhost -uroot -pitc123! < create_sadb_unit_test_user_grant_permissions.sql
mysql --host=localhost -uroot -pitc123! < create_sadb_jpl_unit_test_security_associations.sql
cd /__w/CryptoLib/CryptoLib/build/bin
Expand Down
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ OPTION(ENCTEST "Encryption-Tests" OFF) # Disabled by default, enable with: -DENC
OPTION(CODECOV "Code-Coverage" OFF) # Disabled by default, enable with: -DCODECOV=ON
OPTION(SYSTEM_INSTALL "SystemInstall" OFF) #Disabled by default, enable with: -DSYSTEM_INSTALL=ON

OPTION(SA_INTERNAL "SA Internal" ON) # Enabled by default, disable with: -DSA_INTERNAL=OFF

IF(NOT DEFINED CFE_SYSTEM_PSPNAME)
# Not cFE / cFS
set(CMAKE_INSTALL_RPATH "$ORIGIN/../lib")
Expand Down
20 changes: 14 additions & 6 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,19 @@ include_directories(../include)

aux_source_directory(src_main LIB_SRC_FILES)
if(MYSQL)
aux_source_directory(src_mysql LIB_SRC_MYSQL_FILES)
list(APPEND LIB_SRC_FILES ${LIB_SRC_MYSQL_FILES})
aux_source_directory(sa/mariadb MARIADB_FILES)
list(APPEND LIB_SRC_FILES ${MARIADB_FILES})
else()
aux_source_directory(src_feature_stubs/mysql_stub LIB_SRC_MYSQL_FILES)
list(APPEND LIB_SRC_FILES ${LIB_SRC_MYSQL_FILES})
aux_source_directory(sa/mariadb_stub MARIADB_FILES)
list(APPEND LIB_SRC_FILES ${MARIADB_FILES})
endif()

if(SA_INTERNAL)
aux_source_directory(sa/internal SA_INTERNAL_FILES)
list(APPEND LIB_SRC_FILES ${SA_INTERNAL_FILES})
else()
aux_source_directory(sa/internal_stub SA_INTERNAL_FILES)
list(APPEND LIB_SRC_FILES ${SA_INTERNAL_FILES})
endif()

if(LIBGCRYPT)
Expand Down Expand Up @@ -92,8 +100,8 @@ ELSE()
ENDIF()

IF(MYSQL)
file(GLOB MYSQL_SCRIPTS crypto_sadb/sadb_mariadb_sql/*.sql)
file(GLOB MYSQL_TEST_SCRIPTS crypto_sadb/test_sadb_mariadb_sql/*.sql)
file(GLOB MYSQL_SCRIPTS sa/sadb_mariadb_sql/*.sql)
file(GLOB MYSQL_TEST_SCRIPTS sa/test_sadb_mariadb_sql/*.sql)
install(FILES ${MYSQL_SCRIPTS}
DESTINATION ${CMAKE_INSTALL_PREFIX}/etc/sadb_mariadb_sql)
install(FILES ${MYSQL_TEST_SCRIPTS}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,11 @@
*/

#include "sadb_routine.h"
/**
* @brief Function: init_parse_sadb_routine
* @param config: uint8_t*
* @return SadbRoutine
**/
/*
SadbRoutine init_parse_sadb_routine(uint8_t* config)

static SadbRoutineStruct sadb_routine;

SadbRoutine get_sadb_routine_inmemory(void)
{
SadbRoutine sadb_routine;
return sadb_routine;
fprintf(stderr,"ERROR: Loading internal stub source code. Rebuild CryptoLib with -DMYSQL=OFF to use proper internal implementation.\n");
return &sadb_routine;
}
*/
Loading

0 comments on commit 296b020

Please sign in to comment.