Skip to content

Commit

Permalink
Santize TOTP key prior to storin in OTP format
Browse files Browse the repository at this point in the history
  • Loading branch information
droidmonkey committed Feb 4, 2019
1 parent 79029ab commit 543d3e6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/totp/totp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,10 @@ QString Totp::writeSettings(const QSharedPointer<Totp::Settings>& settings,
return urlstring;
} else if (settings->keeOtp) {
// KeeOtp output
return QString("key=%1&size=%2&step=%3").arg(settings->key).arg(settings->digits).arg(settings->step);
return QString("key=%1&size=%2&step=%3")
.arg(QString(Base32::sanitizeInput(settings->key.toLatin1())))
.arg(settings->digits)
.arg(settings->step);
} else if (!settings->encoder.shortName.isEmpty()) {
// Semicolon output [step];[encoder]
return QString("%1;%2").arg(settings->step).arg(settings->encoder.shortName);
Expand Down

0 comments on commit 543d3e6

Please sign in to comment.