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 4f8930a..6591537 100644 (file)
@@ -42,9 +42,6 @@ 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}              \
@@ -52,9 +49,6 @@ cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} \
 %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 \
         -DAPP_USER="security_test_user"
index f93a9ea..d623ad3 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 53ee42e..49001e2 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 fde318e..06694ec 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)