Skip to content

Commit

Permalink
[devicelock] Do not check code twice. Contributes to JB#45370
Browse files Browse the repository at this point in the history
Due to a bug this checked security code twice when authentication was
successful. Instead of calling both checkCode and unlockWithCode it
should be calling only unlockWithCode and which itself is calling
checkCode.

Signed-off-by: Tomi Leppänen <tomi.leppanen@jolla.com>
  • Loading branch information
Tomin1 committed Apr 18, 2019
1 parent 2b44347 commit 7d42ec3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/nemo-devicelock/host/hostdevicelock.cpp
Expand Up @@ -148,9 +148,10 @@ void HostDeviceLock::enterSecurityCode(const QString &code)
case Idle:
break;
case Authenticating: {
switch (const int result = checkCode(code)) {
switch (const int result = unlockWithCode(code)) {
case Evaluating:
case Success:
unlockFinished(unlockWithCode(code), Authenticator::SecurityCode);
unlockFinished(result, Authenticator::SecurityCode);
break;
case SecurityCodeExpired:
m_state = EnteringNewSecurityCode;
Expand Down

0 comments on commit 7d42ec3

Please sign in to comment.