Yubico / yubikey-personalization

YubiKey Personalization cross-platform library and tool
https://developers.yubico.com/yubikey-personalization/
BSD 2-Clause "Simplified" License
299 stars 82 forks source link

When I change Admin PIN , the Yubikey4 returns "Error changing the PIN: Bad PIN" #110

Closed iubuntu closed 6 years ago

iubuntu commented 6 years ago

After I selected 1 that "change PIN" in a command line , GUI which can input password is displayed . Although the command line returns "Error changing the PIN: Bad PIN" , It is successful that I change PIN. ------- the log below this line ------ gpg/card> admin Admin commands are allowed

gpg/card> passwd gpg: OpenPGP card no. D276000124***** detected

1 - change PIN 2 - unblock PIN 3 - change Admin PIN 4 - set the Reset Code Q - quit

Your selection? 1 Error changing the PIN: Bad PIN

1 - change PIN 2 - unblock PIN 3 - change Admin PIN 4 - set the Reset Code Q - quit

Your selection? q $

However , When I select "3" to change Admin PIN , the Yubikey4 just returns "Error changing the PIN: Bad PIN" , which means that I con not change the "Admin PIN" . How can I fix this issue ?

------- the log below this line ------

$ gpg --card-edit Reader ...........: Yubico Yubikey 4 OTP U2F CCID ........ General key info..: [none]

gpg/card> admin Admin commands are allowed

gpg/card> passwd gpg: OpenPGP card no. D276000***** detected

1 - change PIN 2 - unblock PIN 3 - change Admin PIN 4 - set the Reset Code Q - quit

Your selection? 3 Error changing the PIN: Bad PIN

klali commented 6 years ago

This is not the correct place for this, this is a bugtracker for the yubikey-personalization software.

However: do you at all get prompted for a pin? if not the error probably lies in your gpg installation and it's interaction with the pinentry component.

Please contact Yubico support if you need more help.

4xvgal commented 5 months ago

im getting this trouble too. Resetting the key(piv), trying to set anything admin pw required but prompt keep saying "BAD PIN" even I'm not typed PIN

4xvgal commented 5 months ago

I figured it out, do factory-reset on edit card prompt, not yubikey software.