1 files changed, 7 insertions, 1 deletions
diff --git a/src/ChatPage.cpp b/src/ChatPage.cpp
index 8bccf728..7c6dde96 100644
--- a/src/ChatPage.cpp
+++ b/src/ChatPage.cpp
@@ -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 {
|