CKM: Revert "Add PASSWORD_PROTECTION_DISABLE feature" 35/56235/1
authorKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Tue, 5 Jan 2016 12:21:16 +0000 (13:21 +0100)
committerKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Tue, 5 Jan 2016 13:18:33 +0000 (14:18 +0100)
This reverts commit 83ce88e2df836f7fe23260f635c6ef69d26c748b.

Change-Id: I59bca49f8c4cb67fabda6a455ff7533a507abb6e

packaging/security-tests.spec
src/ckm/CMakeLists.txt
src/ckm/capi-testcases.cpp
src/ckm/main.cpp

index 4f8930a0d9d235a73f77df9e2ce7908d34adfdb0..6591537552661dba29fd9afcd929cf58ae0c5398 100644 (file)
@@ -42,18 +42,12 @@ cp %{SOURCE1} .
 %build
 export LDFLAGS+="-Wl,--rpath=%{_prefix}/lib"
 
-# password protection enabled
-%define ckm_password_protection_disable 1
-
 cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} \
         -DDPL_LOG="ON"                    \
         -DVERSION=%{version}              \
         -DCMAKE_BUILD_TYPE=%{?build_type:%build_type}%{!?build_type:DEBUG} \
 %if "%{sec_product_feature_security_mdfpp_enable}" == "1"
         -DSECURITY_MDFPP_STATE_ENABLE=1 \
-%endif
-%if 0%{?ckm_password_protection_disable}
-        -DPASSWORD_PROTECTION_DISABLE=1 \
 %endif
         -DCMAKE_VERBOSE_MAKEFILE=ON       \
         -DCYNARA_DB_DIR=%{_localstatedir}/cynara/db \
index f93a9ea99221b70129061e96450b02b7736e2454..d623ad38854dacf5fec9478d265d2ba40ffe0c66 100644 (file)
@@ -27,12 +27,6 @@ ELSE (DEFINED SECURITY_MDFPP_STATE_ENABLED)
     MESSAGE("SECURITY_MDFPP_STATE_ENABLE DISABLED !")
 ENDIF (DEFINED SECURITY_MDFPP_STATE_ENABLED)
 
-# password protection flag
-IF (DEFINED PASSWORD_PROTECTION_DISABLE)
-    MESSAGE("PASSWORD_PROTECTION_DISABLE ENABLED !")
-    ADD_DEFINITIONS("-DPASSWORD_PROTECTION_DISABLE")
-ENDIF (DEFINED PASSWORD_PROTECTION_DISABLE)
-
 # Dependencies
 PKG_CHECK_MODULES(CKM_DEP
     libsmack
index 53ee42ede04f5594d5947585721f1fec442956d8..49001e24fd90e9dad4581bb26e4a66b15d27c113 100644 (file)
@@ -2396,17 +2396,11 @@ RUNNER_CHILD_TEST(T3204_CAPI_get_data_from_locked_database)
        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)
index fde318e07df232f75afc80f0f0dc69bdce63c416..06694ec938ff4835f35e567533ed465fc968f674 100644 (file)
@@ -167,11 +167,9 @@ RUNNER_TEST(T0016_Control_negative_wrong_password)
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = control->lockUserKey(USER_APP_2)),
         "Error=" << CKM::ErrorToString(temp));
-#ifndef PASSWORD_PROTECTION_DISABLE
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_AUTHENTICATION_FAILED == (temp = control->unlockUserKey(USER_APP_2, "incorrect-password")),
         "Error=" << CKM::ErrorToString(temp));
-#endif
     RUNNER_ASSERT_MSG(
         CKM_API_SUCCESS == (temp = control->removeUserData(USER_APP_2)),
         "Error=" << CKM::ErrorToString(temp));
@@ -3366,15 +3364,9 @@ RUNNER_TEST(T1904_get_data_from_locked_database)
 
     int status1 = manager->getKey(CKM::Alias("CertEEE"), CKM::Password(), ptr);
 
-#ifndef PASSWORD_PROTECTION_DISABLE
     RUNNER_ASSERT_MSG(
         CKM_API_ERROR_DB_LOCKED == status1,
         "Could not get key from locked database. Error=" << CKM::ErrorToString(status1));
-#else
-    RUNNER_ASSERT_MSG(
-        CKM_API_ERROR_DB_ALIAS_UNKNOWN == status1,
-        "Could not get key with a wrong alias. Error=" << CKM::ErrorToString(status1));
-#endif
 }
 
 RUNNER_TEST(T1905_deinit)