diff options
author | Nicolas Werner <nicolas.werner@ymail.com> | 2022-04-08 05:11:24 +0200 |
---|---|---|
committer | Nicolas Werner <nicolas.werner@ymail.com> | 2022-04-08 05:11:24 +0200 |
commit | 864b4b2646f8f5daaaeb0810e4668ba6700071fa (patch) | |
tree | c4c82e801aa240470389aaa7e69de3f28c09efd9 /src/ChatPage.cpp | |
parent | Fix typo in key export (diff) | |
download | nheko-864b4b2646f8f5daaaeb0810e4668ba6700071fa.tar.xz |
Fix SSSS if another client used the wrong base64 format
Diffstat (limited to 'src/ChatPage.cpp')
-rw-r--r-- | src/ChatPage.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/ChatPage.cpp b/src/ChatPage.cpp index 0550c7f3..5425d527 100644 --- a/src/ChatPage.cpp +++ b/src/ChatPage.cpp @@ -1155,8 +1155,8 @@ ChatPage::decryptDownloadedSecrets(mtx::secret_storage::AesHmacSha2KeyDescriptio stripped.remove(' '); stripped.remove('\n'); stripped.remove('\t'); - auto decryptionKey = mtx::crypto::key_from_recoverykey(stripped.toStdString(), keyDesc); + auto decryptionKey = mtx::crypto::key_from_recoverykey(stripped.toStdString(), keyDesc); if (!decryptionKey && keyDesc.passphrase) { try { decryptionKey = mtx::crypto::key_from_passphrase(text.toStdString(), keyDesc); @@ -1180,6 +1180,8 @@ ChatPage::decryptDownloadedSecrets(mtx::secret_storage::AesHmacSha2KeyDescriptio for (const auto &[secretName, encryptedSecret] : secrets) { auto decrypted = mtx::crypto::decrypt(encryptedSecret, *decryptionKey, secretName); + nhlog::crypto()->debug("Secret {} decrypted: {}", secretName, !decrypted.empty()); + if (!decrypted.empty()) { cache::storeSecret(secretName, decrypted); @@ -1222,7 +1224,8 @@ ChatPage::decryptDownloadedSecrets(mtx::secret_storage::AesHmacSha2KeyDescriptio } } - if (!req.signatures.empty()) + if (!req.signatures.empty()) { + nhlog::crypto()->debug("Uploading new signatures: {}", json(req).dump(2)); http::client()->keys_signatures_upload( req, [](const mtx::responses::KeySignaturesUpload &res, mtx::http::RequestErr err) { if (err) { @@ -1240,6 +1243,7 @@ ChatPage::decryptDownloadedSecrets(mtx::secret_storage::AesHmacSha2KeyDescriptio mtx::errors::to_string(e.errcode), e.error); }); + } } void |