Ignore failing row decryption during data removal 23/48123/2
authorKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Mon, 14 Sep 2015 15:23:45 +0000 (17:23 +0200)
committerBartlomiej Grzelewski <b.grzelewski@samsung.com>
Mon, 14 Sep 2015 15:47:41 +0000 (08:47 -0700)
[Problem] When data is removed we don't know the custom user password used to
protect the row. The row decryption is performed with empty password and may
fail.
[Solution] Because row will be deleted we can ignore the failing decryption.
This is a temporary solution. It won't work for tz-store. The problem will be
fixed when new encryption is applied.

[Verification] Run TCT tests.

Change-Id: I9c24704a83c5511bd53218738460f2b546c3dd05

src/manager/service/ckm-logic.cpp

index b0cea2c..217d0cd 100644 (file)
@@ -671,7 +671,11 @@ int CKMLogic::removeDataHelper(
          * Encryption/decryption with user password and with app key should both be done inside the
          * store (import, getKey and generateXKey).
          */
-        handler.crypto.decryptRow(Password(), r);
+        try {
+            handler.crypto.decryptRow(Password(), r);
+        } catch (const Exc::AuthenticationFailed&) {
+            LogDebug("Authentication failed when removing data. Ignored.");
+        }
         m_decider.getStore(r.dataType, r.exportable).destroy(r);
     }