Reset PW3 validation directly in modifyPw3Pin
This commit is contained in:
@@ -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());
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user