Reset PW3 validation directly in modifyPw3Pin
This commit is contained in:
@@ -209,10 +209,6 @@ public class SecurityTokenConnection {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void resetPw3Validation() {
|
|
||||||
mPw3Validated = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
void determineTokenType() throws IOException {
|
void determineTokenType() throws IOException {
|
||||||
tokenType = mTransport.getTokenTypeIfAvailable();
|
tokenType = mTransport.getTokenTypeIfAvailable();
|
||||||
@@ -291,6 +287,8 @@ public class SecurityTokenConnection {
|
|||||||
CommandApdu changePin = commandFactory.createChangePw3Command(pin, newAdminPin);
|
CommandApdu changePin = commandFactory.createChangePw3Command(pin, newAdminPin);
|
||||||
ResponseApdu response = communicate(changePin);
|
ResponseApdu response = communicate(changePin);
|
||||||
|
|
||||||
|
mPw3Validated = false;
|
||||||
|
|
||||||
if (!response.isSuccess()) {
|
if (!response.isSuccess()) {
|
||||||
throw new CardException("Failed to change PIN", response.getSw());
|
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".
|
// 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
|
// http://www.fsij.org/doc-gnuk/gnuk-passphrase-setting.html#set-up-pw1-pw3-and-reset-code
|
||||||
stConnection.modifyPw3Pin(newAdminPin, adminPin);
|
stConnection.modifyPw3Pin(newAdminPin, adminPin);
|
||||||
stConnection.resetPw3Validation();
|
|
||||||
stConnection.resetPin(newPin, new Passphrase(new String(newAdminPin)));
|
stConnection.resetPin(newPin, new Passphrase(new String(newAdminPin)));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user