const int USER_APP = 5000;
const int GROUP_APP = 5000;
const char* USER_PASS = "user-pass";
-const char* TEST_LABEL = "test_label";
const char *const TEST_OBJECT1 = "OBJECT1";
const std::string TEST_ALIAS1 = aliasWithLabel(TEST_LABEL,TEST_OBJECT1);
const char* TEST_SYSTEM_ALIAS = "system-alias-1";
RUNNER_CHILD_TEST(T30207_user_app_save_RSA_key_C_API)
{
- ScopedAccessProvider ap("mylabel");
+ ScopedAccessProvider ap(TEST_LABEL);
ap.allowAPI("key-manager::api-storage", "rw");
ap.applyAndSwithToUser(USER_APP, GROUP_APP);
RUNNER_CHILD_TEST(T30208_user_app_save_AES_key_C_API)
{
- AccessProvider ap("mylabel");
+ AccessProvider ap(TEST_LABEL);
ap.allowAPI("key-manager::api-storage", "rw");
ap.applyAndSwithToUser(USER_APP, GROUP_APP);
RUNNER_CHILD_TEST(T30209_user_app_save_AES_key_passwd_C_API)
{
- AccessProvider ap("mylabel");
+ AccessProvider ap(TEST_LABEL);
ap.allowAPI("key-manager::api-storage", "rw");
ap.applyAndSwithToUser(USER_APP, GROUP_APP);
RUNNER_CHILD_TEST(T30210_app_user_save_RSA_keys_exportable_flag)
{
- ScopedAccessProvider ap("mylabel");
+ ScopedAccessProvider ap(TEST_LABEL);
ap.allowAPI("key-manager::api-storage", "rw");
ap.applyAndSwithToUser(USER_APP, GROUP_APP);
RUNNER_CHILD_TEST(T30211_app_user_save_AES_keys_exportable_flag)
{
- AccessProvider ap("mylabel");
+ AccessProvider ap(TEST_LABEL);
ap.allowAPI("key-manager::api-storage", "rw");
ap.applyAndSwithToUser(USER_APP, GROUP_APP);
RUNNER_CHILD_TEST(T3043_app_user_save_bin_data_C_API)
{
- ScopedAccessProvider ap("mylabel");
+ ScopedAccessProvider ap(TEST_LABEL);
ap.allowAPI("key-manager::api-storage", "rw");
ap.applyAndSwithToUser(USER_APP, GROUP_APP);
{
int temp;
- ScopedAccessProvider ap("mylabel");
+ ScopedAccessProvider ap(TEST_LABEL);
ap.allowAPI("key-manager::api-storage", "rw");
ap.applyAndSwithToUser(USER_APP, GROUP_APP);
{
int temp;
- AccessProvider ap("mylabel");
+ AccessProvider ap(TEST_LABEL);
ap.allowAPI("key-manager::api-storage", "rw");
ap.applyAndSwithToUser(USER_APP, GROUP_APP);
//RUNNER_TEST_GROUP_INIT(T120_NEGATIVE_TESTS);
-
RUNNER_TEST_GROUP_INIT(T307_CKMC_CAPI_OCSP_TESTS);
RUNNER_TEST(T3071_CAPI_init)
RUNNER_TEST(T3074_CAPI_ckmc_ocsp_check)
{
- RUNNER_IGNORED_MSG("Temporary turned off. Require network feature.");
std::string ee = TestData::getTestCertificateBase64(TestData::MBANK);
std::string im = TestData::getTestCertificateBase64(TestData::SYMANTEC);
}
RUNNER_TEST(T3096_CAPI_TYPE_load_p12_file) {
- const char *p12file = "/usr/share/ckm-test/capi-t3096.p12";
+ const char *p12file = CKM_TEST_DIR "/capi-t3096.p12";
const char *password = "password";
int temp;
}
RUNNER_TEST(T3097_CAPI_TYPE_load_p12_file2) {
- const char *p12file = "/usr/share/ckm-test/capi-t3096.p12";
+ const char *p12file = CKM_TEST_DIR "/capi-t3096.p12";
const char *password = "password";
int temp;
ckmc_pkcs12_s *ppkcs12 = NULL;
int temp;
RUNNER_ASSERT_MSG(
- CKMC_ERROR_INVALID_FORMAT == (temp = ckmc_pkcs12_load("/usr/share/ckm-test/test1801.pkcs12", wrong_passwd, &ppkcs12)),
+ CKMC_ERROR_INVALID_FORMAT == (temp = ckmc_pkcs12_load(CKM_TEST_DIR "/test1801.pkcs12", wrong_passwd, &ppkcs12)),
CKMCReadableError(temp));
}
ckmc_pkcs12_s *ppkcs12 = NULL;
int temp;
RUNNER_ASSERT_MSG(
- CKMC_ERROR_NONE == (temp = ckmc_pkcs12_load("/usr/share/ckm-test/pkcs.p12", NULL, &ppkcs12)),
+ CKMC_ERROR_NONE == (temp = ckmc_pkcs12_load(CKM_TEST_DIR "/pkcs.p12", NULL, &ppkcs12)),
CKMCReadableError(temp));
RUNNER_ASSERT_MSG(NULL != ppkcs12->cert, "no certificate in PKCS12");
RUNNER_CHILD_TEST(T3203_CAPI_lock_database)
{
- RUNNER_IGNORED_MSG("Temporary turned off. The default password for database must be turn off for this test.");
- ScopedDBUnlock unlock(USER_APP, USER_PASS);
- ScopedAccessProvider ap(TEST_LABEL);
- ap.allowAPI("key-manager::api-storage", "rw");
- ap.applyAndSwithToUser(USER_APP, GROUP_APP);
+ ScopedDBUnlock unlock(USER_APP, USER_PASS);
int temp;
RUNNER_ASSERT_MSG( CKMC_ERROR_NONE == (temp = ckmc_lock_user_key(USER_APP)),
RUNNER_CHILD_TEST(T3204_CAPI_get_data_from_locked_database)
{
- RUNNER_IGNORED_MSG("Temporary turned off. The default password for database must be turn off for this test.");
ScopedAccessProvider ap(TEST_LABEL);
ap.allowAPI("key-manager::api-storage", "rw");
ap.applyAndSwithToUser(USER_APP, GROUP_APP);
char *password = NULL;
ckmc_key_s *test_key = NULL;
-#ifndef PASSWORD_PROTECTION_DISABLE
RUNNER_ASSERT_MSG(
CKMC_ERROR_DB_LOCKED == (temp = ckmc_get_key(alias.c_str(), password, &test_key)),
CKMCReadableError(temp));
RUNNER_ASSERT_MSG(NULL == test_key, "Key value should not be changed");
-#else
- RUNNER_ASSERT_MSG(
- CKMC_ERROR_DB_ALIAS_UNKNOWN == (temp = ckmc_get_key(alias.c_str(), password, &test_key)),
- CKMCReadableError(temp));
-#endif
}
RUNNER_TEST(T3204_deinit)