Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Sep 25, 2023

Conversation

daringer
Copy link
Collaborator

@daringer daringer commented Sep 19, 2023

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.

  • tested with Python3.11
  • signed commits

Test Environment and Execution

  • OS: Arch
  • device's model: nk3am
  • device's firmware version: 1.5

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 daringer force-pushed the test-no-pin-fail branch 2 times, most recently from 09604da to 5851a91 Compare September 19, 2023 16:08
Copy link
Member

@robin-nitrokey robin-nitrokey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn’t this just fail the fido2 test case instead of aborting all tests?

@daringer
Copy link
Collaborator Author

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

@daringer
Copy link
Collaborator Author

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
Copy link
Collaborator Author

daringer commented Sep 20, 2023

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

@daringer daringer force-pushed the test-no-pin-fail branch 2 times, most recently from 98f0c85 to 44997e7 Compare September 20, 2023 10:23
Copy link
Member

@robin-nitrokey robin-nitrokey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, that’s better! Maybe mention the --pin option in the error message.

@daringer daringer merged commit 8b58ec8 into master Sep 25, 2023
10 checks passed
@daringer daringer deleted the test-no-pin-fail branch September 25, 2023 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

nk3 test: Don’t show touch prompt if PIN is missing
2 participants