arekinath / PivApplet

PIV applet for JavaCard 2.2.2 and 3.0.4+ with full ECDSA/ECDH support
111 stars 37 forks source link

INS_RESET does not reset PIN policy #41

Closed MichaelGrafnetter closed 3 years ago

MichaelGrafnetter commented 3 years ago

Hi, is there a specific reason why the PivApplet.processReset() method does not reset slot-specific PIN policies to their default values on INS_RESET? Or is it a bug?

I would expect something like this to be present:

slots[SLOT_9A].pinPolicy = PivSlot.P_ONCE;
slots[SLOT_9C].pinPolicy = PivSlot.P_ALWAYS;
slots[SLOT_9D].pinPolicy = PivSlot.P_ONCE;
slots[SLOT_9E].pinPolicy = PivSlot.P_NEVER;
for (byte i = SLOT_82; i <= SLOT_8C; ++i)
    slots[i].pinPolicy = PivSlot.P_ONCE;
arekinath commented 3 years ago

Looks like a bug to me. Thanks for pointing it out, I'll try to get a fix in for it at some point.

MichaelGrafnetter commented 3 years ago

Great, thanks for the fix! Are you planning on creating a new release, please?

arekinath commented 3 years ago

Released in v0.9.0 now