Skip to content

How do I unblock my key after several failed generate attempts? #148

@antifuchs

Description

@antifuchs

Environment

  • OS: macOS 13.3.1
  • age-plugin-yubikey version: 0.4.0

What were you trying to do

I tried generating a key on a blank yubikey 5c nano.

What happened

I failed multiple times to correctly identify what the plugin was asking me to do (namely, enter the pin 123456), locking myself out:

:;    age-plugin-yubikey --generate --pin-policy once --touch-policy cached
🎲 Generating key...

Enter PIN for YubiKey with serial 15748267 (default is 123456): [hidden]
Error: Invalid PIN (1 try remaining before it is blocked)

[ Did this not do what you expected? Could an error be more useful? ]
[ Tell us: https://str4d.xyz/age-plugin-yubikey/report              ]
:;    age-plugin-yubikey --generate --pin-policy once --touch-policy cached
🎲 Generating key...

Enter PIN for YubiKey with serial 15748267 (default is 123456): [hidden]
Error: Invalid PIN (0 tries remaining before it is blocked)

[ Did this not do what you expected? Could an error be more useful? ]
[ Tell us: https://str4d.xyz/age-plugin-yubikey/report              ]
:;    age-plugin-yubikey --generate --pin-policy once --touch-policy cached
🎲 Generating key...

Enter PIN for YubiKey with serial 15748267 (default is 123456): [hidden]
Error: Invalid PIN (0 tries remaining before it is blocked)

[ Did this not do what you expected? Could an error be more useful? ]
[ Tell us: https://str4d.xyz/age-plugin-yubikey/report              ]
:;    age-plugin-yubikey --list-all
:;    age-plugin-yubikey --generate --pin-policy once --touch-policy cached
🎲 Generating key...

Enter PIN for YubiKey with serial 15748267 (default is 123456): [hidden]
Error: Invalid PIN (0 tries remaining before it is blocked)

[ Did this not do what you expected? Could an error be more useful? ]
[ Tell us: https://str4d.xyz/age-plugin-yubikey/report              ]

The attempts above, I failed to remember that it's not asking me the PIN for the GPG PIV app, but asks me to enter the default PIN. Oops.

So - how do I get it out of this state? I tried factory-resetting it with gpg --card-edit, which didn't work (and in retrospect can't do anything either, since they're different apps on the key).

Metadata

Metadata

Assignees

No one assigned

    Labels

    I-error-handlingProblems and improvements related to error handling

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions