Skip to content

Commit

Permalink
Add require secure transport MariaDB configuration option, Update mys…
Browse files Browse the repository at this point in the history
…ql options calls for mariadb
  • Loading branch information
iysaleh committed Feb 1, 2022
1 parent 20c8bd8 commit 7e868e4
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 21 deletions.
2 changes: 1 addition & 1 deletion include/crypto.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ extern int32_t Crypto_Config_CryptoLib(uint8_t sadb_type, uint8_t cryptography_t
extern int32_t Crypto_Config_MariaDB(char* mysql_username, char* mysql_password, char* mysql_hostname,
char* mysql_database, uint16_t mysql_port, char* mysql_mtls_cert,
char* mysql_mtls_key, char* mysql_mtls_ca, char* mysql_mtls_capath,
uint8_t mysql_tls_verify_server, char* mysql_mtls_client_key_password);
uint8_t mysql_tls_verify_server, char* mysql_mtls_client_key_password, uint8_t mysql_require_secure_transport);
extern int32_t Crypto_Config_Kmc_Crypto_Service(char *protocol, char *kmc_crypto_hostname, uint16_t kmc_crypto_port, char *kmc_crypto_app_uri, char *mtls_client_cert_path, char *mtls_client_cert_type,
char *mtls_client_key_path,char *mtls_client_key_pass, char *mtls_ca_bundle, char *mtls_ca_path,
char *mtls_issuer_cert, uint8_t ignore_ssl_hostname_validation);
Expand Down
1 change: 1 addition & 0 deletions include/crypto_config_structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ typedef struct
char* mysql_mtls_capath;
uint8_t mysql_tls_verify_server;
char* mysql_mtls_client_key_password;
uint8_t mysql_require_secure_transport;

} SadbMariaDBConfig_t;
#define SADB_MARIADB_CONFIG_SIZE (sizeof(SadbMariaDBConfig_t))
Expand Down
3 changes: 2 additions & 1 deletion src/src_main/crypto_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ int32_t Crypto_Config_CryptoLib(uint8_t sadb_type, uint8_t cryptography_type, ui
int32_t Crypto_Config_MariaDB(char* mysql_username, char* mysql_password, char* mysql_hostname, char* mysql_database,
uint16_t mysql_port, char* mysql_mtls_cert, char* mysql_mtls_key,
char* mysql_mtls_ca, char* mysql_mtls_capath, uint8_t mysql_tls_verify_server,
char* mysql_mtls_client_key_password)
char* mysql_mtls_client_key_password, uint8_t mysql_require_secure_transport)
{
int32_t status = CRYPTO_LIB_ERROR;
sadb_mariadb_config = (SadbMariaDBConfig_t*)calloc(1, SADB_MARIADB_CONFIG_SIZE);
Expand All @@ -286,6 +286,7 @@ int32_t Crypto_Config_MariaDB(char* mysql_username, char* mysql_password, char*
sadb_mariadb_config->mysql_mtls_capath = mysql_mtls_capath;
sadb_mariadb_config->mysql_tls_verify_server = mysql_tls_verify_server;
sadb_mariadb_config->mysql_mtls_client_key_password = mysql_mtls_client_key_password;
sadb_mariadb_config->mysql_require_secure_transport = mysql_require_secure_transport;
/*end - encrypted connection related parameters*/
status = CRYPTO_LIB_SUCCESS;
}
Expand Down
20 changes: 14 additions & 6 deletions src/src_mysql/sadb_routine_mariadb.template.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,29 +104,37 @@ static int32_t sadb_init(void)
con = mysql_init(con);
if (con != NULL)
{
//mysql_options is removed in MariaDB C connector v3, using mysql_optionsv
// Lots of small configuration differences between MySQL connector & MariaDB Connector
// Only MariaDB Connector is implemented here:
// https://wikidev.in/wiki/C/mysql_mysql_h/mysql_options | https://mariadb.com/kb/en/mysql_optionsv/
if(sadb_mariadb_config->mysql_mtls_key != NULL)
{
mysql_options(con, MYSQL_OPT_SSL_KEY, sadb_mariadb_config->mysql_mtls_key);
mysql_optionsv(con, MYSQL_OPT_SSL_KEY, sadb_mariadb_config->mysql_mtls_key);
}
if(sadb_mariadb_config->mysql_mtls_cert != NULL)
{
mysql_options(con, MYSQL_OPT_SSL_CERT, sadb_mariadb_config->mysql_mtls_cert);
mysql_optionsv(con, MYSQL_OPT_SSL_CERT, sadb_mariadb_config->mysql_mtls_cert);
}
if(sadb_mariadb_config->mysql_mtls_ca != NULL)
{
mysql_options(con, MYSQL_OPT_SSL_CA, sadb_mariadb_config->mysql_mtls_ca);
mysql_optionsv(con, MYSQL_OPT_SSL_CA, sadb_mariadb_config->mysql_mtls_ca);
}
if(sadb_mariadb_config->mysql_mtls_capath != NULL)
{
mysql_options(con, MYSQL_OPT_SSL_CAPATH, sadb_mariadb_config->mysql_mtls_capath);
mysql_optionsv(con, MYSQL_OPT_SSL_CAPATH, sadb_mariadb_config->mysql_mtls_capath);
}
if (sadb_mariadb_config->mysql_tls_verify_server != CRYPTO_FALSE)
{
mysql_options4(con, MYSQL_OPT_CONNECT_ATTR_ADD, "MASTER_SSL_VERIFY_SERVER_CERT", "1");
mysql_optionsv(con, MYSQL_OPT_SSL_VERIFY_SERVER_CERT, &(sadb_mariadb_config->mysql_tls_verify_server));
}
if (sadb_mariadb_config->mysql_mtls_client_key_password != NULL)
{
mysql_options4(con, MYSQL_OPT_CONNECT_ATTR_ADD, "ssl-passphrase", sadb_mariadb_config->mysql_mtls_client_key_password);
mysql_optionsv(con, MARIADB_OPT_TLS_PASSPHRASE, sadb_mariadb_config->mysql_mtls_client_key_password);
}
if (sadb_mariadb_config->mysql_require_secure_transport == CRYPTO_TRUE)
{
mysql_optionsv(con, MYSQL_OPT_SSL_ENFORCE,&(sadb_mariadb_config->mysql_require_secure_transport));
}
//if encrypted connection (TLS) connection. No need for SSL Key
if (mysql_real_connect(con, sadb_mariadb_config->mysql_hostname,
Expand Down
2 changes: 1 addition & 1 deletion util/src_util/ut_crypto_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ UTEST(CRYPTO_CONFIG, CRYPTO_CONFIG_MDB)
char* ssl_capath = "NONE";
uint8_t verify_server = 0;
char* client_key_password = NULL;
status = Crypto_Config_MariaDB(mysql_username, mysql_password, mysql_hostname, mysql_database, mysql_port, ssl_cert, ssl_key, ssl_ca, ssl_capath, verify_server,client_key_password);
status = Crypto_Config_MariaDB(mysql_username, mysql_password, mysql_hostname, mysql_database, mysql_port, ssl_cert, ssl_key, ssl_ca, ssl_capath, verify_server,client_key_password,CRYPTO_FALSE);
ASSERT_EQ(CRYPTO_LIB_SUCCESS, status);
}

Expand Down
8 changes: 4 additions & 4 deletions util/src_util/ut_kmc_crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ UTEST(KMC_CRYPTO, HAPPY_PATH_APPLY_SEC_ENC_AND_AUTH)
Crypto_Config_CryptoLib(SADB_TYPE_MARIADB, CRYPTOGRAPHY_TYPE_KMCCRYPTO, CRYPTO_TC_CREATE_FECF_TRUE, TC_PROCESS_SDLS_PDUS_FALSE, TC_NO_PUS_HDR,
TC_IGNORE_SA_STATE_FALSE, TC_IGNORE_ANTI_REPLAY_TRUE, TC_UNIQUE_SA_PER_MAP_ID_FALSE,
TC_CHECK_FECF_TRUE, 0x3F);
Crypto_Config_MariaDB("sadb_user", "sadb_password", "localhost","sadb", 3306, NULL, NULL, NULL, NULL,0,NULL);
Crypto_Config_MariaDB("sadb_user", "sadb_password", "localhost","sadb", 3306, NULL, NULL, NULL, NULL,0,NULL,CRYPTO_FALSE);
Crypto_Config_Kmc_Crypto_Service("https", "asec-cmdenc-srv1.jpl.nasa.gov", 8443, "crypto-service", "/home/isaleh/git/KMC/CryptoLib-IbraheemYSaleh/util/etc/local-test-cert.pem", "PEM","/home/isaleh/git/KMC/CryptoLib-IbraheemYSaleh/util/etc/local-test-key.pem",NULL,"/home/isaleh/git/KMC/CryptoLib-IbraheemYSaleh/util/etc/ammos-ca-bundle.crt", NULL, NULL, CRYPTO_FALSE);
Crypto_Config_Add_Gvcid_Managed_Parameter(0, 0x002C, 0, TC_HAS_FECF, TC_NO_SEGMENT_HDRS);
Crypto_Config_Add_Gvcid_Managed_Parameter(0, 0x002C, 1, TC_HAS_FECF, TC_NO_SEGMENT_HDRS);
Expand Down Expand Up @@ -138,7 +138,7 @@ UTEST(KMC_CRYPTO, HAPPY_PATH_APPLY_SEC_AUTH_ONLY)
Crypto_Config_CryptoLib(SADB_TYPE_MARIADB, CRYPTOGRAPHY_TYPE_KMCCRYPTO, CRYPTO_TC_CREATE_FECF_TRUE, TC_PROCESS_SDLS_PDUS_FALSE, TC_NO_PUS_HDR,
TC_IGNORE_SA_STATE_FALSE, TC_IGNORE_ANTI_REPLAY_TRUE, TC_UNIQUE_SA_PER_MAP_ID_FALSE,
TC_CHECK_FECF_TRUE, 0x3F);
Crypto_Config_MariaDB("sadb_user", "sadb_password", "localhost","sadb", 3306, NULL, NULL, NULL, NULL,0,NULL);
Crypto_Config_MariaDB("sadb_user", "sadb_password", "localhost","sadb", 3306, NULL, NULL, NULL, NULL,0,NULL,CRYPTO_FALSE);
Crypto_Config_Kmc_Crypto_Service("https", "asec-cmdenc-srv1.jpl.nasa.gov", 8443, "crypto-service", "/home/isaleh/git/KMC/CryptoLib-IbraheemYSaleh/util/etc/local-test-cert.pem", "PEM","/home/isaleh/git/KMC/CryptoLib-IbraheemYSaleh/util/etc/local-test-key.pem",NULL,"/home/isaleh/git/KMC/CryptoLib-IbraheemYSaleh/util/etc/ammos-ca-bundle.crt", NULL, NULL, CRYPTO_FALSE);
Crypto_Config_Add_Gvcid_Managed_Parameter(0, 0x002C, 0, TC_HAS_FECF, TC_NO_SEGMENT_HDRS);
Crypto_Config_Add_Gvcid_Managed_Parameter(0, 0x002C, 1, TC_HAS_FECF, TC_NO_SEGMENT_HDRS);
Expand Down Expand Up @@ -189,7 +189,7 @@ UTEST(KMC_CRYPTO, HAPPY_PATH_PROCESS_SEC_ENC_AND_AUTH)
Crypto_Config_CryptoLib(SADB_TYPE_MARIADB, CRYPTOGRAPHY_TYPE_KMCCRYPTO, CRYPTO_TC_CREATE_FECF_TRUE, TC_PROCESS_SDLS_PDUS_FALSE, TC_NO_PUS_HDR,
TC_IGNORE_SA_STATE_FALSE, TC_IGNORE_ANTI_REPLAY_TRUE, TC_UNIQUE_SA_PER_MAP_ID_FALSE,
TC_CHECK_FECF_TRUE, 0x3F);
Crypto_Config_MariaDB("sadb_user", "sadb_password", "localhost","sadb", 3306, NULL, NULL, NULL, NULL,0,NULL);
Crypto_Config_MariaDB("sadb_user", "sadb_password", "localhost","sadb", 3306, NULL, NULL, NULL, NULL,0,NULL,CRYPTO_FALSE);
Crypto_Config_Kmc_Crypto_Service("https", "asec-cmdenc-srv1.jpl.nasa.gov", 8443, "crypto-service", "/home/isaleh/git/KMC/CryptoLib-IbraheemYSaleh/util/etc/local-test-cert.pem", "PEM","/home/isaleh/git/KMC/CryptoLib-IbraheemYSaleh/util/etc/local-test-key.pem",NULL,"/home/isaleh/git/KMC/CryptoLib-IbraheemYSaleh/util/etc/ammos-ca-bundle.crt", NULL, NULL, CRYPTO_FALSE);
Crypto_Config_Add_Gvcid_Managed_Parameter(0, 0x002C, 0, TC_HAS_FECF, TC_NO_SEGMENT_HDRS);
Crypto_Config_Add_Gvcid_Managed_Parameter(0, 0x002C, 1, TC_HAS_FECF, TC_NO_SEGMENT_HDRS);
Expand Down Expand Up @@ -309,7 +309,7 @@ UTEST(KMC_CRYPTO, HAPPY_PATH_PROCESS_SEC_AUTH_ONLY)
Crypto_Config_CryptoLib(SADB_TYPE_MARIADB, CRYPTOGRAPHY_TYPE_KMCCRYPTO, CRYPTO_TC_CREATE_FECF_TRUE, TC_PROCESS_SDLS_PDUS_FALSE, TC_NO_PUS_HDR,
TC_IGNORE_SA_STATE_FALSE, TC_IGNORE_ANTI_REPLAY_TRUE, TC_UNIQUE_SA_PER_MAP_ID_FALSE,
TC_CHECK_FECF_TRUE, 0x3F);
Crypto_Config_MariaDB("sadb_user", "sadb_password", "localhost","sadb", 3306, NULL, NULL, NULL, NULL,0,NULL);
Crypto_Config_MariaDB("sadb_user", "sadb_password", "localhost","sadb", 3306, NULL, NULL, NULL, NULL,0,NULL,CRYPTO_FALSE);
Crypto_Config_Kmc_Crypto_Service("https", "asec-cmdenc-srv1.jpl.nasa.gov", 8443, "crypto-service", "/home/isaleh/git/KMC/CryptoLib-IbraheemYSaleh/util/etc/local-test-cert.pem", "PEM","/home/isaleh/git/KMC/CryptoLib-IbraheemYSaleh/util/etc/local-test-key.pem",NULL,"/home/isaleh/git/KMC/CryptoLib-IbraheemYSaleh/util/etc/ammos-ca-bundle.crt", NULL, NULL, CRYPTO_FALSE);
Crypto_Config_Add_Gvcid_Managed_Parameter(0, 0x002C, 0, TC_HAS_FECF, TC_NO_SEGMENT_HDRS);
Crypto_Config_Add_Gvcid_Managed_Parameter(0, 0x002C, 1, TC_HAS_FECF, TC_NO_SEGMENT_HDRS);
Expand Down
6 changes: 3 additions & 3 deletions util/src_util/ut_kmc_crypto_aes_cmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ UTEST(KMC_CRYPTO, HAPPY_PATH_APPLY_SEC_CMAC_AUTH_ONLY)
Crypto_Config_CryptoLib(SADB_TYPE_MARIADB, CRYPTOGRAPHY_TYPE_KMCCRYPTO, CRYPTO_TC_CREATE_FECF_TRUE, TC_PROCESS_SDLS_PDUS_FALSE, TC_NO_PUS_HDR,
TC_IGNORE_SA_STATE_FALSE, TC_IGNORE_ANTI_REPLAY_TRUE, TC_UNIQUE_SA_PER_MAP_ID_FALSE,
TC_CHECK_FECF_TRUE, 0x3F);
Crypto_Config_MariaDB("sadb_user", "sadb_password", "localhost","sadb", 3306, NULL, NULL, NULL, NULL,0,NULL);
Crypto_Config_MariaDB("sadb_user", "sadb_password", "localhost","sadb", 3306, NULL, NULL, NULL, NULL,0,NULL,CRYPTO_FALSE);
Crypto_Config_Kmc_Crypto_Service("https", "asec-cmdenc-srv1.jpl.nasa.gov", 8443, "crypto-service", "/home/isaleh/git/KMC/CryptoLib-IbraheemYSaleh/util/etc/local-test-cert.pem", "PEM","/home/isaleh/git/KMC/CryptoLib-IbraheemYSaleh/util/etc/local-test-key.pem",NULL,"/home/isaleh/git/KMC/CryptoLib-IbraheemYSaleh/util/etc/ammos-ca-bundle.crt", NULL, NULL, CRYPTO_FALSE);
Crypto_Config_Add_Gvcid_Managed_Parameter(0, 0x002C, 7, TC_HAS_FECF, TC_NO_SEGMENT_HDRS);
int32_t status = Crypto_Init();
Expand Down Expand Up @@ -86,7 +86,7 @@ UTEST(KMC_CRYPTO, HAPPY_PATH_PROCESS_SEC_CMAC_AUTH_ONLY)
Crypto_Config_CryptoLib(SADB_TYPE_MARIADB, CRYPTOGRAPHY_TYPE_KMCCRYPTO, CRYPTO_TC_CREATE_FECF_TRUE, TC_PROCESS_SDLS_PDUS_FALSE, TC_NO_PUS_HDR,
TC_IGNORE_SA_STATE_FALSE, TC_IGNORE_ANTI_REPLAY_TRUE, TC_UNIQUE_SA_PER_MAP_ID_FALSE,
TC_CHECK_FECF_TRUE, 0x3F);
Crypto_Config_MariaDB("sadb_user", "sadb_password", "localhost","sadb", 3306, NULL, NULL, NULL, NULL,0,NULL);
Crypto_Config_MariaDB("sadb_user", "sadb_password", "localhost","sadb", 3306, NULL, NULL, NULL, NULL,0,NULL, CRYPTO_FALSE);
Crypto_Config_Kmc_Crypto_Service("https", "asec-cmdenc-srv1.jpl.nasa.gov", 8443, "crypto-service", "/home/isaleh/git/KMC/CryptoLib-IbraheemYSaleh/util/etc/local-test-cert.pem", "PEM","/home/isaleh/git/KMC/CryptoLib-IbraheemYSaleh/util/etc/local-test-key.pem",NULL,"/home/isaleh/git/KMC/CryptoLib-IbraheemYSaleh/util/etc/ammos-ca-bundle.crt", NULL, NULL, CRYPTO_FALSE);
Crypto_Config_Add_Gvcid_Managed_Parameter(0, 0x002C, 7, TC_HAS_FECF, TC_NO_SEGMENT_HDRS);
int32_t status = Crypto_Init();
Expand Down Expand Up @@ -142,7 +142,7 @@ UTEST(KMC_CRYPTO, HAPPY_PATH_APPLY_SEC_CMAC_LARGE_FRM_AUTH_ONLY)
Crypto_Config_CryptoLib(SADB_TYPE_MARIADB, CRYPTOGRAPHY_TYPE_KMCCRYPTO, CRYPTO_TC_CREATE_FECF_TRUE, TC_PROCESS_SDLS_PDUS_FALSE, TC_NO_PUS_HDR,
TC_IGNORE_SA_STATE_FALSE, TC_IGNORE_ANTI_REPLAY_TRUE, TC_UNIQUE_SA_PER_MAP_ID_FALSE,
TC_CHECK_FECF_TRUE, 0x3F);
Crypto_Config_MariaDB("sadb_user", "sadb_password", "localhost","sadb", 3306, NULL, NULL, NULL, NULL,0,NULL);
Crypto_Config_MariaDB("sadb_user", "sadb_password", "localhost","sadb", 3306, NULL, NULL, NULL, NULL,0,NULL, CRYPTO_FALSE);
Crypto_Config_Kmc_Crypto_Service("https", "asec-cmdenc-srv1.jpl.nasa.gov", 8443, "crypto-service", "/home/isaleh/git/KMC/CryptoLib-IbraheemYSaleh/util/etc/local-test-cert.pem", "PEM","/home/isaleh/git/KMC/CryptoLib-IbraheemYSaleh/util/etc/local-test-key.pem",NULL,"/home/isaleh/git/KMC/CryptoLib-IbraheemYSaleh/util/etc/ammos-ca-bundle.crt", NULL, NULL, CRYPTO_FALSE);
Crypto_Config_Add_Gvcid_Managed_Parameter(0, 0x002C, 7, TC_HAS_FECF, TC_NO_SEGMENT_HDRS);
int32_t status = Crypto_Init();
Expand Down
4 changes: 2 additions & 2 deletions util/src_util/ut_kmc_crypto_with_mtls_sadb.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ UTEST(KMC_CRYPTO, HAPPY_PATH_APPLY_SEC_ENC_AND_AUTH_MTLS)
Crypto_Config_CryptoLib(SADB_TYPE_MARIADB, CRYPTOGRAPHY_TYPE_KMCCRYPTO, CRYPTO_TC_CREATE_FECF_TRUE, TC_PROCESS_SDLS_PDUS_FALSE, TC_NO_PUS_HDR,
TC_IGNORE_SA_STATE_FALSE, TC_IGNORE_ANTI_REPLAY_TRUE, TC_UNIQUE_SA_PER_MAP_ID_FALSE,
TC_CHECK_FECF_TRUE, 0x3F);
Crypto_Config_MariaDB("testuser2", NULL, "asec-cmdenc-dev2.jpl.nasa.gov","sadb", 3306, "/home/isaleh/git/KMC/CryptoLib-IbraheemYSaleh/util/etc/local-test-cert.pem", "/home/isaleh/git/KMC/CryptoLib-IbraheemYSaleh/util/etc/local-test-key.pem", "/home/isaleh/git/KMC/CryptoLib-IbraheemYSaleh/util/etc/ammos-ca-bundle.crt", NULL,CRYPTO_TRUE,NULL);
Crypto_Config_MariaDB("testuser2", NULL, "asec-cmdenc-dev2.jpl.nasa.gov","sadb", 3306, "/home/isaleh/git/KMC/CryptoLib-IbraheemYSaleh/util/etc/local-test-cert.pem", "/home/isaleh/git/KMC/CryptoLib-IbraheemYSaleh/util/etc/local-test-key.pem", "/home/isaleh/git/KMC/CryptoLib-IbraheemYSaleh/util/etc/ammos-ca-bundle.crt", NULL,CRYPTO_TRUE,NULL,CRYPTO_TRUE);
Crypto_Config_Kmc_Crypto_Service("https", "asec-cmdenc-srv1.jpl.nasa.gov", 8443, "crypto-service", "/home/isaleh/git/KMC/CryptoLib-IbraheemYSaleh/util/etc/local-test-cert.pem", "PEM","/home/isaleh/git/KMC/CryptoLib-IbraheemYSaleh/util/etc/local-test-key.pem",NULL,"/home/isaleh/git/KMC/CryptoLib-IbraheemYSaleh/util/etc/ammos-ca-bundle.crt", NULL, NULL, CRYPTO_FALSE);
Crypto_Config_Add_Gvcid_Managed_Parameter(0, 0x002C, 0, TC_HAS_FECF, TC_NO_SEGMENT_HDRS);
Crypto_Config_Add_Gvcid_Managed_Parameter(0, 0x002C, 1, TC_HAS_FECF, TC_NO_SEGMENT_HDRS);
Expand Down Expand Up @@ -85,7 +85,7 @@ UTEST(KMC_CRYPTO, HAPPY_PATH_APPLY_SEC_ENC_AND_AUTH_TLS)
Crypto_Config_CryptoLib(SADB_TYPE_MARIADB, CRYPTOGRAPHY_TYPE_KMCCRYPTO, CRYPTO_TC_CREATE_FECF_TRUE, TC_PROCESS_SDLS_PDUS_FALSE, TC_NO_PUS_HDR,
TC_IGNORE_SA_STATE_FALSE, TC_IGNORE_ANTI_REPLAY_TRUE, TC_UNIQUE_SA_PER_MAP_ID_FALSE,
TC_CHECK_FECF_TRUE, 0x3F);
Crypto_Config_MariaDB("testuser1", "l0ngp@ssWord", "asec-cmdenc-dev2.jpl.nasa.gov","sadb", 3306, NULL, NULL, NULL, NULL,CRYPTO_TRUE,NULL);
Crypto_Config_MariaDB("testuser1", "l0ngp@ssWord", "asec-cmdenc-dev2.jpl.nasa.gov","sadb", 3306, NULL, NULL, NULL, NULL,CRYPTO_TRUE,NULL,CRYPTO_TRUE);
Crypto_Config_Kmc_Crypto_Service("https", "asec-cmdenc-srv1.jpl.nasa.gov", 8443, "crypto-service", "/home/isaleh/git/KMC/CryptoLib-IbraheemYSaleh/util/etc/local-test-cert.pem", "PEM","/home/isaleh/git/KMC/CryptoLib-IbraheemYSaleh/util/etc/local-test-key.pem",NULL,"/home/isaleh/git/KMC/CryptoLib-IbraheemYSaleh/util/etc/ammos-ca-bundle.crt", NULL, NULL, CRYPTO_FALSE);
Crypto_Config_Add_Gvcid_Managed_Parameter(0, 0x002C, 0, TC_HAS_FECF, TC_NO_SEGMENT_HDRS);
Crypto_Config_Add_Gvcid_Managed_Parameter(0, 0x002C, 1, TC_HAS_FECF, TC_NO_SEGMENT_HDRS);
Expand Down
4 changes: 2 additions & 2 deletions util/src_util/ut_mysql_m_tls_connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ UTEST(MARIA_DB_CONNECTION_TESTS, TLS_TEST) {
char* client_key_password = NULL;
//uint8_t ssl_verify_server_cert = 1;
/*set configuration params*/
status = Crypto_Config_MariaDB(mysql_username, password, mysql_hostname, mysql_database, mysql_port, ssl_cert, ssl_key, ssl_ca, ssl_capath,verify_server,client_key_password);
status = Crypto_Config_MariaDB(mysql_username, password, mysql_hostname, mysql_database, mysql_port, ssl_cert, ssl_key, ssl_ca, ssl_capath,verify_server,client_key_password, CRYPTO_TRUE);
ASSERT_EQ(CRYPTO_LIB_SUCCESS, status);
/*Prepare SADB type from config*/
status = Crypto_Init_Unit_Test_For_DB();
Expand All @@ -108,7 +108,7 @@ UTEST(MARIA_DB_CONNECTION_TESTS, TLS_TEST) {
ssl_ca = "/etc/pki/tls/certs/ammos-ca-bundle.crt";
ssl_capath = "/etc/pki/tls/certs/";
/*set configuration params*/
status = Crypto_Config_MariaDB(mysql_username, password, mysql_hostname, mysql_database, mysql_port, ssl_cert, ssl_key, ssl_ca, ssl_capath,verify_server,client_key_password);
status = Crypto_Config_MariaDB(mysql_username, password, mysql_hostname, mysql_database, mysql_port, ssl_cert, ssl_key, ssl_ca, ssl_capath,verify_server,client_key_password, CRYPTO_TRUE);
ASSERT_EQ(CRYPTO_LIB_SUCCESS, status);
/*Prepare SADB type from config*/
status = Crypto_Init_Unit_Test_For_DB();
Expand Down
2 changes: 1 addition & 1 deletion util/src_util/ut_mysql_tls_connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ UTEST(MARIA_DB_CONNECTION_TESTS, TLS_TEST) {
char* client_key_password = NULL;

/*set configuration params*/
status = Crypto_Config_MariaDB(mysql_username, password, mysql_hostname, mysql_database, mysql_port, ssl_cert, ssl_key, ssl_ca, ssl_capath,verify_server,client_key_password);
status = Crypto_Config_MariaDB(mysql_username, password, mysql_hostname, mysql_database, mysql_port, ssl_cert, ssl_key, ssl_ca, ssl_capath,verify_server,client_key_password, CRYPTO_TRUE);
ASSERT_EQ(CRYPTO_LIB_SUCCESS, status);
/*Prepare SADB type from config*/
status = Crypto_Init_Unit_Test_For_DB();
Expand Down

0 comments on commit 7e868e4

Please sign in to comment.