unlock with password when resetPassword called in case of first start of device
authorkyungwook tak <k.tak@samsung.com>
Tue, 10 Feb 2015 01:17:12 +0000 (10:17 +0900)
committerMaciej J. Karpiuk <m.karpiuk2@samsung.com>
Tue, 17 Feb 2015 11:12:22 +0000 (12:12 +0100)
Change-Id: I536b7b5ff2448990bd0c5fdda87730b34e13c16f
Signed-off-by: kyungwook tak <k.tak@samsung.com>
src/manager/service/ckm-logic.cpp

index a685770..35808bf 100644 (file)
@@ -231,7 +231,11 @@ RawBuffer CKMLogic::resetUserPassword(
 
     try {
         if (0 == m_userDataMap.count(user)) {
-            retCode = CKM_API_ERROR_BAD_REQUEST;
+            // Check if key exists. If exists we must return error
+            FileSystem fs(user);
+            auto wrappedDKEKMain = fs.getDKEK();
+            if (!wrappedDKEKMain.empty())
+                retCode = CKM_API_ERROR_BAD_REQUEST;
         } else {
             saveDKEKFile(user, newPassword);
         }