Nitrokey / pynitrokey

Python client for Nitrokey devices
Apache License 2.0
93 stars 28 forks source link

nk3 test/fido2: early exit if pin not set - fixes #411 #440

Closed daringer closed 9 months ago

daringer commented 9 months ago

Remove pin prompt from nk3 test, if fido2 is activated and pin is required (set) on the target device.

Checklist

Make sure to run make check and make fix before creating a PR, otherwise the CI will fail.

Test Environment and Execution

Relevant Output Example

❯ nitropy nk3 test 
Command line tool to interact with Nitrokey devices 0.4.39
Found 1 Nitrokey 3 device(s):
- Nitrokey 3 at /dev/hidraw12
Critical error:
FIDO2 tests activated: Device requires pin, but not set

Fixes #411

daringer commented 9 months ago

that was the other option I had in mind, will do

daringer commented 9 months ago

now it's like that:

❯ nitropy nk3 test
Command line tool to interact with Nitrokey devices 0.4.39
Found 1 Nitrokey 3 device(s):
- Nitrokey 3 at /dev/hidraw9

Running tests for Nitrokey 3 at /dev/hidraw9

[1/4]   uuid        UUID query                  SUCCESS     xxxxxxxxxxxxxxxxxxx
[2/4]   version     Firmware version query      SUCCESS     v1.5.0
[3/4]   status      Device status               SUCCESS     Status(init_status=<InitStatus: 0>, ifs_blocks=214, efs_blocks=457, variant=<Variant.NRF52: 2>)
[4/4]   fido2       FIDO2                       FAILURE     FIDO2 pin is set, but not provided

4 tests, 3 successful, 0 skipped, 1 failed

Summary: 1 device(s) tested, 0 successful, 1 failed
daringer commented 9 months ago

but I broke some typing ... fixed....