mirror of
https://github.com/trussed-dev/piv-authenticator.git
synced 2026-06-20 04:16:15 -07:00
Fix spec compliance issue
This commit is contained in:
+2
-2
@@ -228,8 +228,8 @@ impl TryFrom<&[u8]> for ResetRetryCounter {
|
||||
return Err(Status::IncorrectDataParameter);
|
||||
}
|
||||
Ok(Self {
|
||||
pin: data[..8].try_into().unwrap(),
|
||||
puk: data[8..].try_into().unwrap(),
|
||||
puk: data[..8].try_into().unwrap(),
|
||||
pin: data[8..].try_into().unwrap(),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@ pub const DISCOVERY_OBJECT: [u8; 18] = hex!(
|
||||
4f 0b // PIV AID
|
||||
a000000308000010000100
|
||||
5f2f 02 // PIN usage Policy
|
||||
4000"
|
||||
4010"
|
||||
);
|
||||
|
||||
pub const CARD_CAP: [u8; 27] = hex!(
|
||||
|
||||
+5
-1
@@ -302,7 +302,11 @@ impl<'a, T: Client> LoadedAuthenticator<'a, T> {
|
||||
// should we logout here?
|
||||
self.state.volatile.app_security_status.pin_verified = false;
|
||||
let remaining = self.state.persistent.remaining_pin_retries(self.trussed);
|
||||
Err(Status::RemainingRetries(remaining))
|
||||
if remaining == 0 {
|
||||
Err(Status::OperationBlocked)
|
||||
} else {
|
||||
Err(Status::RemainingRetries(remaining))
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Err(Status::FunctionNotSupported)
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
cmd_resp: [
|
||||
GetData(
|
||||
input: "5C 01 7E",
|
||||
output: Data("7e 12 4f 0b a000000308000010000100 5f2f 02 4000")
|
||||
output: Data("7e 12 4f 0b a000000308000010000100 5f2f 02 4010")
|
||||
),
|
||||
GetData(
|
||||
input: "5C 03 5FC102",
|
||||
@@ -133,7 +133,7 @@
|
||||
),
|
||||
VerifyApplicationPin(pin: "FFEEDDCCBBAA9988", expected_status: RemainingRetries(2)),
|
||||
VerifyApplicationPin(pin: "FFEEDDCCBBAA9988", expected_status: RemainingRetries(1)),
|
||||
VerifyApplicationPin(pin: "FFEEDDCCBBAA9988", expected_status: RemainingRetries(0)),
|
||||
VerifyApplicationPin(pin: "FFEEDDCCBBAA9988", expected_status: OperationBlocked),
|
||||
Reset(),
|
||||
]
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user