Просмотр исходного кода

Don't early return in sensitive data deletion for clientsideencryption if the entries were never stored in keychain

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
Claudio Cambra 3 лет назад
Родитель
Сommit
4ded5e1b38
1 измененных файлов с 6 добавлено и 3 удалено
  1. 6 3
      src/libsync/clientsideencryption.cpp

+ 6 - 3
src/libsync/clientsideencryption.cpp

@@ -1124,7 +1124,8 @@ void ClientSideEncryption::forgetSensitiveData(const AccountPtr &account)
 
 void ClientSideEncryption::handlePrivateKeyDeleted(const QKeychain::Job* const incoming)
 {
-    if (incoming->error() != QKeychain::NoError) {
+    const auto error = incoming->error();
+    if (error != QKeychain::NoError && error != QKeychain::EntryNotFound) {
         qCWarning(lcCse) << "Private key could not be deleted:" << incoming->errorString();
         return;
     }
@@ -1137,7 +1138,8 @@ void ClientSideEncryption::handlePrivateKeyDeleted(const QKeychain::Job* const i
 
 void ClientSideEncryption::handleCertificateDeleted(const QKeychain::Job* const incoming)
 {
-    if (incoming->error() != QKeychain::NoError) {
+    const auto error = incoming->error();
+    if (error != QKeychain::NoError && error != QKeychain::EntryNotFound) {
         qCWarning(lcCse) << "Certificate could not be deleted:" << incoming->errorString();
         return;
     }
@@ -1150,7 +1152,8 @@ void ClientSideEncryption::handleCertificateDeleted(const QKeychain::Job* const
 
 void ClientSideEncryption::handleMnemonicDeleted(const QKeychain::Job* const incoming)
 {
-    if (incoming->error() != QKeychain::NoError) {
+    const auto error = incoming->error();
+    if (error != QKeychain::NoError && error != QKeychain::EntryNotFound) {
         qCWarning(lcCse) << "Mnemonic could not be deleted:" << incoming->errorString();
         return;
     }