mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-10-31 01:50:47 +03:00
parent
d55f7ea12b
commit
f4e670d8d5
1 changed files with 9 additions and 2 deletions
|
@ -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(
|
||||
|
|
Loading…
Reference in a new issue