Merge branch 'tizen' into ckm
[platform/core/test/security-tests.git] / src / ckm / main.cpp
index 9a7622f..a0517d9 100644 (file)
@@ -168,9 +168,11 @@ 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));
@@ -3371,9 +3373,15 @@ 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)