From 7c880699bb9a49037c09b1be990e677a1857af7a Mon Sep 17 00:00:00 2001 From: Daniel Mueller Date: Sat, 1 Jun 2019 11:19:08 -0700 Subject: Clear cached PIN entry as part of pin set command When a PIN is changed using the pin set command, the last action is to confirm the operation with the previously used PIN. This step will cause this PIN, which is now stale and no longer valid, to be cached, which in turn can cause follow up command using the same PIN type to use this wrong cached entry for authentication. To fix this problem, this change explicitly clear the PIN entry from the cache after the PIN has been changed. --- nitrocli/src/tests/otp.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nitrocli/src/tests/otp.rs') diff --git a/nitrocli/src/tests/otp.rs b/nitrocli/src/tests/otp.rs index d99a6f8..39ddf29 100644 --- a/nitrocli/src/tests/otp.rs +++ b/nitrocli/src/tests/otp.rs @@ -51,7 +51,7 @@ fn status(device: nitrokey::DeviceWrapper) -> crate::Result<()> { let mut ncli = Nitrocli::with_dev(device); // Make sure that we have at least something to display by ensuring - // that there are there is one slot programmed. + // that there is one slot programmed. let _ = ncli.handle(&["otp", "set", "0", "the-name", "123456"])?; let out = ncli.handle(&["otp", "status"])?; -- cgit v1.2.1