Funktioniert bei mir anscheinend wie erwartet (NK3Amini, ebenfalls FW 1.8.3)
> nitropy-v0.11.3-x64-windows-binary.exe nk3 secrets add-otp --protect-with-pin --touch-button --hash sha1 --kind totp Test AAAAAAAAAAAA
Command line tool to interact with Nitrokey devices 0.11.3
Please touch the device if it blinks
PIN is required to run this command.
Current PIN (8 attempts left):
Please touch the device if it blinks
Done
> nitropy-v0.11.3-x64-windows-binary.exe nk3 secrets list
Command line tool to interact with Nitrokey devices 0.11.3
Please provide PIN to show PIN-protected entries (if any), or press ENTER to skip
Please touch the device if it blinks
Current PIN (8 attempts left):
No PIN provided
01. ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
> nitropy-v0.11.3-x64-windows-binary.exe nk3 secrets list
Command line tool to interact with Nitrokey devices 0.11.3
Please provide PIN to show PIN-protected entries (if any), or press ENTER to skip
Please touch the device if it blinks
Current PIN (8 attempts left):
Please touch the device if it blinks
01. ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
02. Test Totp/Sha1 touch required,PIN required
georg@heka:~> nitropy nk3 secrets add-otp --protect-with-pin --touch-button --hash sha1 --kind totp Test AAAAAAAAAAAA Command line tool to interact with Nitrokey devices 0.12.0 Please touch the device if it blinks PIN is required to run this command. Current PIN (8 attempts left): Please touch the device if it blinks Done georg@heka:~> nitropy nk3 secrets list Command line tool to interact with Nitrokey devices 0.12.0 Please provide PIN to show PIN-protected entries (if any), or press ENTER to skip Please touch the device if it blinks Current PIN (8 attempts left): Please touch the device if it blinks 01. HmacSlot2 Hmac/Sha1 02. Test Totp/Sha1 touch required,PIN required georg@heka:~>
Ich habe zwischenzeitlich meine secret app mittels NitokeyApp2 zurückgesetzt, den Befehl abgesetzt, in der NitrokeyApp2 die pin gesetzt, nochmals den Befehl abgesetzt und credentials gelistet.
Parallel habe ich mir das in der NitrokeyApp2 auch angeschaut. Ich denke, das ist das erwartbare Ergebnis.
georg@heka:~> nitropy nk3 secrets add-otp --protect-with-pin --touch-button --hash sha1 --kind totp Test AAAAAAAAAAAA Command line tool to interact with Nitrokey devices 0.12.0 Please touch the device if it blinks PIN is required to run this command. Health check notes: - Application does not have a PIN. Set PIN before the first use. Aborted! georg@heka:~> nitropy nk3 secrets add-otp --protect-with-pin --touch-button --hash sha1 --kind totp Test AAAAAAAAAAAA Command line tool to interact with Nitrokey devices 0.12.0 Please touch the device if it blinks PIN is required to run this command. Current PIN (8 attempts left): Please touch the device if it blinks Done georg@heka:~> nitropy nk3 secrets list Command line tool to interact with Nitrokey devices 0.12.0 Please provide PIN to show PIN-protected entries (if any), or press ENTER to skip Please touch the device if it blinks Current PIN (8 attempts left): Please touch the device if it blinks 01. Test Totp/Sha1 touch required,PIN required georg@heka:~>
@ion Das mit dem HMAC scheint ja auf die FW abzuzielen wenn ich das richtig verstehe. Wie ich aber dem Log entnehmen konnte, werden die Optionen einfach nicht an den NK3 gesendet.
Funktioniert wie erwartet. (sudo, da ich mich für den Test nicht mit udev auseinandersetzen wollte.)
Vielleicht entdeckst Du im Vergleich zu Deinem Log-File ja den entscheidenden Unterschied:
904 INFO pynitrokey.cli Python version: 3.11.2
904 INFO pynitrokey.cli Cli arguments: ['nk3', 'secrets', 'add-otp', '--protect-with-pin', '--touch-button', '--hash', 'sha1', '--kind', 'totp', 'Test', 'AAAAA']
905 INFO pynitrokey.cli pynitrokey version: 0.12.0
907 INFO pynitrokey.cli cryptography version: 46.0.7
908 INFO pynitrokey.cli fido2 version: 2.1.1
910 INFO pynitrokey.cli nethsm version: 2.1.0
911 INFO pynitrokey.cli nitrokey version: 0.4.2
912 INFO pynitrokey.cli pyusb version: 1.3.1
1369 DEBUG root print: Please touch the device if it blinks
1369 INFO otpapp Sending CCIDInstruction.Select (data: 12 bytes)
1417 INFO otpapp Received [9000] (data: 14 bytes)
1417 INFO otpapp TLV-decoding of data successful
1417 INFO otpapp Setting new credential: b'Test', Kind.Totp, Algorithm.Sha1, counter: 0, touch_button_required=True, pin_based_encryption=True
1417 INFO otpapp Sending Instruction.Put (data: 20 bytes)
1561 INFO otpapp Received [6982] (data: 0 bytes)
1561 DEBUG root print: PIN is required to run this command.
1561 INFO otpapp Sending CCIDInstruction.Select (data: 12 bytes)
1597 INFO otpapp Received [9000] (data: 14 bytes)
1597 INFO otpapp TLV-decoding of data successful
1597 INFO otpapp Sending CCIDInstruction.Select (data: 12 bytes)
1633 INFO otpapp Received [9000] (data: 14 bytes)
1633 INFO otpapp TLV-decoding of data successful
1633 INFO otpapp Sending CCIDInstruction.Select (data: 12 bytes)
1669 INFO otpapp Received [9000] (data: 14 bytes)
1669 INFO otpapp TLV-decoding of data successful
4548 DEBUG root print: Please touch the device if it blinks
4548 INFO otpapp Sending Instruction.VerifyPIN (data: 13 bytes)
8554 INFO otpapp Received [9000] (data: 0 bytes)
8554 INFO otpapp Setting new credential: b'Test', Kind.Totp, Algorithm.Sha1, counter: 0, touch_button_required=True, pin_based_encryption=True
8555 INFO otpapp Sending Instruction.Put (data: 20 bytes)
8806 INFO otpapp Received [9000] (data: 0 bytes)
8806 DEBUG root print: Done
@czietz siehe meinem Log, es wird nicht an den NK übergeben.
So wie bei dir in dem Block 1417. Bei mir ist das alles false. Obwohl in Block 904 wie bei dir die Option gesetzt sind. @ion
Das anschließenden setzen der Touch Anforderung geht, nur die PIN kann man nicht nachträglich setzen.