From 7d63985313258ffd1dd233a288f1f0c7fea5c361 Mon Sep 17 00:00:00 2001 From: Evgeny Eremin Date: Fri, 26 Mar 2021 16:07:49 +0300 Subject: [PATCH] [nemo-qml-plugin-devicelock] Handle SecurityCodeExpired while Unlocking. Contributes to JB#53701 --- src/nemo-devicelock/host/hostdevicelock.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/nemo-devicelock/host/hostdevicelock.cpp b/src/nemo-devicelock/host/hostdevicelock.cpp index c7fd561..d94e4f7 100644 --- a/src/nemo-devicelock/host/hostdevicelock.cpp +++ b/src/nemo-devicelock/host/hostdevicelock.cpp @@ -160,7 +160,13 @@ void HostDeviceLock::enterSecurityCode(const QString &code) case LockedOut: lockedOut(); break; - default: + case Evaluating: + // Set currentCode to use it as oldCode in case evaluation + // reveals it is expired and must be changed with a newCode + m_currentCode = code; + unlockFinished(result, Authenticator::SecurityCode); + break; + default: unlockFinished(result, Authenticator::SecurityCode); break; } @@ -241,6 +247,9 @@ void HostDeviceLock::unlockFinished(int result, Authenticator::Method method) } break; case SecurityCodeExpired: + enterCodeChangeState(&HostAuthenticationInput::feedback); + authenticationResumed(AuthenticationInput::SecurityCodeExpired, QVariantMap(), Authenticator::SecurityCode); + break; case SecurityCodeInHistory: case LockedOut: if (m_state == Canceled) {