mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-25 20:48:52 +03:00
Strip space chars from recovery passphrase
This commit is contained in:
parent
57d1dffdbd
commit
6d69248109
1 changed files with 7 additions and 1 deletions
|
@ -1103,7 +1103,13 @@ ChatPage::decryptDownloadedSecrets(mtx::secret_storage::AesHmacSha2KeyDescriptio
|
|||
if (text.isEmpty())
|
||||
return;
|
||||
|
||||
auto decryptionKey = mtx::crypto::key_from_recoverykey(text.toStdString(), keyDesc);
|
||||
// strip space chars from a recovery key. It can't contain those, but some clients insert them
|
||||
// to make them easier to read.
|
||||
QString stripped = text;
|
||||
stripped.remove(' ');
|
||||
stripped.remove('\n');
|
||||
stripped.remove('\t');
|
||||
auto decryptionKey = mtx::crypto::key_from_recoverykey(stripped.toStdString(), keyDesc);
|
||||
|
||||
if (!decryptionKey && keyDesc.passphrase) {
|
||||
try {
|
||||
|
|
Loading…
Reference in a new issue