Reset PW3 validation directly in modifyPw3Pin

This commit is contained in:
Dominik Schürmann
2017-11-05 19:10:59 +01:00
parent 2cf3e27e51
commit da186ca49f
2 changed files with 2 additions and 5 deletions

View File

@@ -209,10 +209,6 @@ public class SecurityTokenConnection {
}
}
public void resetPw3Validation() {
mPw3Validated = false;
}
@VisibleForTesting
void determineTokenType() throws IOException {
tokenType = mTransport.getTokenTypeIfAvailable();
@@ -291,6 +287,8 @@ public class SecurityTokenConnection {
CommandApdu changePin = commandFactory.createChangePw3Command(pin, newAdminPin);
ResponseApdu response = communicate(changePin);
mPw3Validated = false;
if (!response.isSuccess()) {
throw new CardException("Failed to change PIN", response.getSw());
}

View File

@@ -296,7 +296,6 @@ public class SecurityTokenOperationActivity extends BaseSecurityTokenActivity {
// Order is important for Gnuk, otherwise it will be set up in "admin less mode".
// http://www.fsij.org/doc-gnuk/gnuk-passphrase-setting.html#set-up-pw1-pw3-and-reset-code
stConnection.modifyPw3Pin(newAdminPin, adminPin);
stConnection.resetPw3Validation();
stConnection.resetPin(newPin, new Passphrase(new String(newAdminPin)));
break;