authenticationsmartcardapdupin-code

Reset Retry Counter, error: "6d00" -> Instruction code not supported or invalid


I have this command as reference: XX 2C 03 XX

When I send the command: "00 2C 03 01 00" I'm getting error 6d00 (Instruction code not supported or invalid)

Important: I am in a test environment, I am studying the APDU commands. After testing questions I sent the command to verify the PIN containing an invalid PIN 3 times in a row.

Original PIN: 1574

P1 = 0x15
P2 = 0x15

Commands:

>> 0x00,0x20,0x00,0x80,0x08,0x24,p1,p2,0xFF,0xFF,0xFF,0xFF,0xFF
<< 63c2
>> 0x00,0x20,0x00,0x80,0x08,0x24,p1,p2,0xFF,0xFF,0xFF,0xFF,0xFF
<< 63c1
>> 0x00,0x20,0x00,0x80,0x08,0x24,p1,p2,0xFF,0xFF,0xFF,0xFF,0xFF
<< 63c0

After that, I run the command again:

>> 0x00,0x20,0x00,0x80,0x08,0x24,p1,p2,0xFF,0xFF,0xFF,0xFF,0xFF
<< 6983

I want to reset the counter (Reset Retry Counter), so that I can verify the PIN again, for this purpose I am executing the following command:

>> 00 2C 03 00
<< 6d00

Why am I getting this error: "6d00"?


Solution

  • I was forgetting the PUK code, problem solved! The correct is:

    CL ='00' -
    INS='2C' - RESET RETRY COUNTER
    P1 = either
    '00' - Data contains PUK and new PIN
    '01' - Data contains PUK only
    P2 ='01' - Key Reference of the PIN (as <01>)
    Data = either
           PUK | NewPIN, if P1='00'
           PUK         , if P1='01'