Unblock of test PIV card - Error indicating the PUK supplied is incorrect

117 views
Skip to first unread message

Jill Branton

unread,
Nov 3, 2021, 10:00:34 AM11/3/21
to piv-tes...@list.nist.gov

Hi,

Believe that I managed to block my #16 PIV card trying to pair it with my Mac.  Using OpenSC as outlined by David Cooper below, the return using 1234 and 9999999 (seven nines) is that the PUK is incorrect.  

Was unable to find different information as to what the PUK should be.  Also tried without user input as indicated it could be a problem with some readers.

>pkcs15-tool.exe --unblock-pin --puk 1234 --pin 123456

The sanity-check returns "Using reader with a card: SCM Microsystems Inc. SCR33x USB Smart Card Reader 0 not using the cardos driver, card is fine."  My reader is rather old but seems to be working fine.  Also have #15 with expired certificates.


Perhaps all this information was in the package with the cards, however someone else in our organization distributed and did not forward. 

Thanks,

Jill

From: David A. Cooper [david.cooper at nist.gov]
Sent: Friday, June 14, 2013 1:23 PM
To: Obremski, Christopher D.
Cc: piv-test-cards
Subject: Resetting the PIV Card Application PIN on a test PIV Card

A status word of '69 83' does seem to indicate that the corresponding PIN has been locked. The PIV Card Application PINs and (where applicable) Global PINs on the test PIV Cards have been configured with a reset counter of 10. After 10 consecutive incorrect attempts to authenticate to the card using one of these PINs, the ability to authenticate to the card using that PIN will be blocked.

While there is no mechanism available to reset the Global PIN once it has become blocked, the PIV Card Application PIN may be reset using the RESET RETRY COUNTER card command, which is described in NIST Special Publication 800-73-3 Part 2<http://csrc.nist.gov/publications/nistpubs/800-73-3/sp800-73-3_PART2_piv-card-applic-card-common-interface.pdf>. The RESET RETRY COUNTER card command needs to be provided the PIN Unblocking Key (PUK) and the new value for the PIV Card Application PIN. The value of the PUK for test PIV Cards 1, 9, and 16, is "1234." The value of the PUK for all of the other test PIV Cards is "99999999."

So, the Application Protocol Data Unit (APDU) (i.e., card command) to send to test PIV Card 1, 9, or 16, to reset the PIV Card Application PIN to its original value of "123456" is:
00:2C:00:80:10:31:32:33:34:FF:FF:FF:FF:31:32:33:34:35:36:FF:FF
The APDU to send to test PIV Card 2, 4, 5, 6, 8, 10, 11, 12, 13, 14, or 15, to reset the PIV Card Application PIN to its original value of "123456" is:
00:2C:00:80:10:39:39:39:39:39:39:39:39:31:32:33:34:35:36:FF:FF
The APDU to send to test PIV Card 3 or 7 to reset the PIV Card Application PIN to its original value of "90909090" is:
00:2C:00:80:10:39:39:39:39:39:39:39:39:39:30:39:30:39:30:39:30

As Doug mentioned, OpenSC may be used to send the APDU to the card to reset the PIN.

Dave


--
Ping Identity
Jill Branton
Solutions Architect - Government
jillb...@pingidentity.com

Connect with us: Glassdoor logo LinkedIn logo twitter logo facebook logo youtube logo Blog logo



--
Ping Identity
Jill Branton
Solutions Architect - Government
jillb...@pingidentity.com

Connect with us: Glassdoor logo LinkedIn logo twitter logo facebook logo youtube logo Blog logo


CONFIDENTIALITY NOTICE: This email may contain confidential and privileged material for the sole use of the intended recipient(s). Any review, use, distribution or disclosure by others is strictly prohibited.  If you have received this communication in error, please notify the sender immediately by e-mail and delete the message and any file attachments from your computer. Thank you.

David A. Cooper

unread,
Nov 3, 2021, 10:25:42 AM11/3/21
to Jill Branton, piv-tes...@list.nist.gov
Hello Jill,

All of the information about the test cards is available at https://csrc.nist.gov/Projects/piv/nist-piv-test-cards.

If you are using version 2 of the test cards, then all 16 cards have the same PUK: 99999999 (eight nines) - see Appendix B of https://doi.org/10.6028/NIST.IR.8347). This is the same as cards 2 - 8 and 9 - 15 of the version 2 cards.

Douglas E Engert

unread,
Nov 3, 2021, 11:56:58 AM11/3/21
to piv-tes...@list.nist.gov


On 11/3/2021 8:56 AM, 'Jill Branton' via piv-test-cards wrote:
> Hi,
>
> Believe that I managed to block my #16 PIV card trying to pair it with my Mac.  Using OpenSC as outlined by David Cooper below, the return using 1234 and 9999999 (seven nines) is that the PUK is
> incorrect.
>
> Was unable to find different information as to what the PUK should be.  Also tried without user input as indicated it could be a problem with some readers.
>
> >pkcs15-tool.exe --unblock-pin --puk 1234 --pin 123456

So this is on Windows?

In any case the other way to do this is to use what is outlined in David's note:
Look at NIST 800-73-4 "3.2.3 RESET RETRY COUNTER Card Command"

opensc-tool -c default -s "00:2C:00:80:10:31:32:33:34:FF:FF:FF:FF:31:32:33:34:35:36:FF:FF"

The -c default is optional, it says to not use any special driver, just send the APDU.
The above sends the "3.2.3 RESET RETRY COUNTER Card Command" to change PIV pin 0x80 using 0x10 bytes of date
with PUK 31:32:33:34:FF:FF:FF:FF (as hex padded to 8 bytes) and new pin 31:32:33:34:35:36:FF:FF (as hex padded to 8 bytes)

If you get" '63' 'CX' "Reset failed, X indicates the number of further allowed resets" i.e. the pin is not blocked.

If you really don't know the pin, i.e. you may have changed it, you can try X number of times to use a bad PIN so it gets blocked.
Then try the above.
Note that the PUK can get blocked, be careful. Read NIST 800-73-3 says:

"If the PIV Card Application returns status word '63 CX', then the retry counter
associated with the PIN shall not be reset, the security status of the PIN’s key
reference shall be set to FALSE, and the PUK’s retry counter shall be decremented by one."



>
> The sanity-check returns "Using reader with a card: SCM Microsystems Inc. SCR33x USB Smart Card Reader 0 not using the cardos driver, card is fine."  My reader is rather old but seems to be
> working fine.  Also have #15 with expired certificates. padded to 8 bytes
>
>
> Perhaps all this information was in the package with the cards, however someone else in our organization distributed and did not forward.
>
> Thanks,
>
> Jill
>
> From: David A. Cooper [david.cooper at nist.gov <http://nist.gov/>]
> Sent: Friday, June 14, 2013 1:23 PM
> To: Obremski, Christopher D.
> Cc: piv-test-cards
> Subject: Resetting the PIV Card Application PIN on a test PIV Card
>
> A status word of '69 83' does seem to indicate that the corresponding PIN has been locked. The PIV Card Application PINs and (where applicable) Global PINs on the test PIV Cards have been
> configured with a reset counter of 10. After 10 consecutive incorrect attempts to authenticate to the card using one of these PINs, the ability to authenticate to the card using that PIN will be
> blocked.
>
> While there is no mechanism available to reset the Global PIN once it has become blocked, the PIV Card Application PIN may be reset using the RESET RETRY COUNTER card command, which is described
> in NIST Special Publication 800-73-3 Part 2<http://csrc.nist.gov/publications/nistpubs/800-73-3/sp800-73-3_PART2_piv-card-applic-card-common-interface.pdf
> <http://csrc.nist.gov/publications/nistpubs/800-73-3/sp800-73-3_PART2_piv-card-applic-card-common-interface.pdf>>. The RESET RETRY COUNTER card command needs to be provided the PIN Unblocking Key
> (PUK) and the new value for the PIV Card Application PIN. The value of the PUK for test PIV Cards 1, 9, and 16, is "1234." The value of the PUK for all of the other test PIV Cards is "99999999."
>
> So, the Application Protocol Data Unit (APDU) (i.e., card command) to send to test PIV Card 1, 9, or 16, to reset the PIV Card Application PIN to its original value of "123456" is:
> 00:2C:00:80:10:31:32:33:34:FF:FF:FF:FF:31:32:33:34:35:36:FF:FF
> The APDU to send to test PIV Card 2, 4, 5, 6, 8, 10, 11, 12, 13, 14, or 15, to reset the PIV Card Application PIN to its original value of "123456" is:
> 00:2C:00:80:10:39:39:39:39:39:39:39:39:31:32:33:34:35:36:FF:FF
> The APDU to send to test PIV Card 3 or 7 to reset the PIV Card Application PIN to its original value of "90909090" is:
> 00:2C:00:80:10:39:39:39:39:39:39:39:39:39:30:39:30:39:30:39:30
>
> As Doug mentioned, OpenSC may be used to send the APDU to the card to reset the PIN.
>
> Dave
>
>
> --
> <https://www.pingidentity.com>Ping Identity <https://www.pingidentity.com>
> Jill Branton
> Solutions Architect - Government
> jillb...@pingidentity.com <mailto:jillb...@pingidentity.com>
>
> Connect with us: Glassdoor logo <https://www.glassdoor.com/Overview/Working-at-Ping-Identity-EI_IE380907.11,24.htm> LinkedIn logo <https://www.linkedin.com/company/21870> twitter logo
> <https://twitter.com/pingidentity> facebook logo <https://www.facebook.com/pingidentitypage> youtube logo <https://www.youtube.com/user/PingIdentityTV> Blog logo
> <https://www.pingidentity.com/en/blog.html>
>
> <https://www.gartner.com/reviews/vendor/write/ping-identity/?utm_content=vlp-write&refVal=vlp-ping-identity-32202&utm_campaign=vendor&utm_source=ping-identity&utm_medium=web&arwol=false><https://hub.pingidentity.com/survey/3568-survey-remote-work-fuels-zero-trust><https://www.pingidentity.com/en/resources/client-library/misc/2021-consumer-survey-passwords-privacy-brand-loyalty.html><https://www.pingidentity.com/content/dam/ping-6-2-assets/images/misc/emailSignature/2021/consumer-survey1.png><https://www.pingidentity.com/en/resources/client-library/misc/2021-consumer-survey-passwords-privacy-brand-loyalty.html>
>
>
>
>
> --
> <https://www.pingidentity.com>Ping Identity <https://www.pingidentity.com>
> Jill Branton
> Solutions Architect - Government
> jillb...@pingidentity.com <mailto:jillb...@pingidentity.com>
>
> Connect with us: Glassdoor logo <https://www.glassdoor.com/Overview/Working-at-Ping-Identity-EI_IE380907.11,24.htm> LinkedIn logo <https://www.linkedin.com/company/21870> twitter logo
> <https://twitter.com/pingidentity> facebook logo <https://www.facebook.com/pingidentitypage> youtube logo <https://www.youtube.com/user/PingIdentityTV> Blog logo
> <https://www.pingidentity.com/en/blog.html>
>
> <https://www.gartner.com/reviews/vendor/write/ping-identity/?utm_content=vlp-write&refVal=vlp-ping-identity-32202&utm_campaign=vendor&utm_source=ping-identity&utm_medium=web&arwol=false><https://hub.pingidentity.com/survey/3568-survey-remote-work-fuels-zero-trust><https://www.pingidentity.com/en/resources/client-library/misc/2021-consumer-survey-passwords-privacy-brand-loyalty.html><https://www.pingidentity.com/content/dam/ping-6-2-assets/images/misc/emailSignature/2021/consumer-survey1.png><https://www.pingidentity.com/en/resources/client-library/misc/2021-consumer-survey-passwords-privacy-brand-loyalty.html>
>
>
>
> /CONFIDENTIALITY NOTICE: This email may contain confidential and privileged material for the sole use of the intended recipient(s). Any review, use, distribution or disclosure by others is strictly
> prohibited.  If you have received this communication in error, please notify the sender immediately by e-mail and delete the message and any file attachments from your computer. Thank you./
>
> --
> To unsubscribe from this group, send email to piv-test-card...@list.nist.gov
> Visit this group at https://groups.google.com/a/list.nist.gov/d/forum/piv-test-cards <https://groups.google.com/a/list.nist.gov/d/forum/piv-test-cards>
> ---
> To unsubscribe from this group and stop receiving emails from it, send an email to piv-test-card...@list.nist.gov <mailto:piv-test-card...@list.nist.gov>.

--

Douglas E. Engert <DEEn...@gmail.com>

David A. Cooper

unread,
Nov 3, 2021, 12:05:43 PM11/3/21
to piv-tes...@list.nist.gov
Yes. But as I noted, if these are version 2 test cards, then the PUK is
99999999 (eight nines) and so the command would be:

opensc-tool -c default -s
"00:2C:00:80:10:39:39:39:39:39:39:39:39:31:32:33:34:35:36:FF:FF"

Jill Branton

unread,
Nov 3, 2021, 1:08:09 PM11/3/21
to David A. Cooper, piv-tes...@list.nist.gov
Thank you very much David!  For the help today and original instructions.

I had read the number of nines incorrectly and was unable to find the version 2 NIST Test card documentation.  Maybe need new glasses.

Thank you again,
Jill


Jill Branton

unread,
Nov 4, 2021, 7:00:16 AM11/4/21
to piv-test-cards, deen...@gmail.com
Hi Douglas,

Thank you for your reply - it did not make it to my inbox until the summary of activity came over.  Greatly appreciate your reaching out.

Yes, I was on a virtual Windows Server 2019 running in Fusion - but pretty sure that I blocked the PIN trying to pair my Mac OS (which I later read that I didn't want to do anyway). Had just received the test PIV card and was just trying to get it set up. You are very good with APDU - which is somewhat foreign to me.  The pkcs15-tools command worked for me with the correct number of nines in the PUK.

Thank you,
Jill
Reply all
Reply to author
Forward
0 new messages