From 7cb2991a1368a082c72a218a74c8f30230da9a4a Mon Sep 17 00:00:00 2001 From: Jonathan White Date: Tue, 8 Jun 2021 19:03:07 -0400 Subject: [PATCH] Trim TOTP key input of whitespace prior to processing * Fixes #6599 --- src/gui/TotpSetupDialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/TotpSetupDialog.cpp b/src/gui/TotpSetupDialog.cpp index b350bedc4..1d403a17c 100644 --- a/src/gui/TotpSetupDialog.cpp +++ b/src/gui/TotpSetupDialog.cpp @@ -46,7 +46,7 @@ void TotpSetupDialog::saveSettings() { // Secret key sanity check // Convert user input to all uppercase and remove '=' - auto key = m_ui->seedEdit->text().toUpper().remove(" ").remove("=").toLatin1(); + auto key = m_ui->seedEdit->text().toUpper().remove(" ").remove("=").trimmed().toLatin1(); auto sanitizedKey = Base32::sanitizeInput(key); // Use startsWith to ignore added '=' for padding at the end if (!sanitizedKey.startsWith(key)) {