Fix SSSS unlock without a password set

fixes #657
This commit is contained in:
Nicolas Werner 2021-07-25 12:13:24 +02:00
parent d55f7ea12b
commit f4e670d8d5
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9

View file

@ -1028,8 +1028,15 @@ ChatPage::decryptDownloadedSecrets(mtx::secret_storage::AesHmacSha2KeyDescriptio
auto decryptionKey = mtx::crypto::key_from_recoverykey(text.toStdString(), keyDesc);
if (!decryptionKey)
decryptionKey = mtx::crypto::key_from_passphrase(text.toStdString(), keyDesc);
if (!decryptionKey && keyDesc.passphrase) {
try {
decryptionKey =
mtx::crypto::key_from_passphrase(text.toStdString(), keyDesc);
} catch (std::exception &e) {
nhlog::crypto()->error("Failed to derive secret key from passphrase: {}",
e.what());
}
}
if (!decryptionKey) {
QMessageBox::information(