Skip to content

Commit

Permalink
Trim TOTP key input of whitespace prior to processing
Browse files Browse the repository at this point in the history
  • Loading branch information
droidmonkey committed Jun 12, 2021
1 parent 6a8b070 commit 7cb2991
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/gui/TotpSetupDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit 7cb2991

Please sign in to comment.