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>
This commit is contained in:
Claudio Cambra 2023-02-07 14:05:13 +01:00
parent 8483a4553a
commit 4ded5e1b38

View file

@ -1124,7 +1124,8 @@ void ClientSideEncryption::forgetSensitiveData(const AccountPtr &account)
void ClientSideEncryption::handlePrivateKeyDeleted(const QKeychain::Job* const incoming) 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(); qCWarning(lcCse) << "Private key could not be deleted:" << incoming->errorString();
return; return;
} }
@ -1137,7 +1138,8 @@ void ClientSideEncryption::handlePrivateKeyDeleted(const QKeychain::Job* const i
void ClientSideEncryption::handleCertificateDeleted(const QKeychain::Job* const incoming) 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(); qCWarning(lcCse) << "Certificate could not be deleted:" << incoming->errorString();
return; return;
} }
@ -1150,7 +1152,8 @@ void ClientSideEncryption::handleCertificateDeleted(const QKeychain::Job* const
void ClientSideEncryption::handleMnemonicDeleted(const QKeychain::Job* const incoming) 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(); qCWarning(lcCse) << "Mnemonic could not be deleted:" << incoming->errorString();
return; return;
} }