Skip to content

Instantly share code, notes, and snippets.

@vletoux
Created April 17, 2015 14:19
Show Gist options
  • Save vletoux/f9f59f524c6f439cd71c to your computer and use it in GitHub Desktop.
Save vletoux/f9f59f524c6f439cd71c to your computer and use it in GitHub Desktop.
patch to part10_build_modify_pin_block in reader-pcsc.c
@@ -1493,12 +1493,12 @@ static int part10_build_modify_pin_block(struct sc_reader *reader, u8 * buf, siz
else
pin_modify->bNumberMessage = 0x00; /* No messages */
/* Ignore language and T=1 parameters. */
pin_modify->wLangId = HOST_TO_CCID_16(0x0000);
- pin_modify->bMsgIndex1 = 0x00; /* Default message indexes */
- pin_modify->bMsgIndex2 = 0x01;
+ pin_modify->bMsgIndex1 = (data->flags & SC_PIN_CMD_IMPLICIT_CHANGE ? 0x01: 0x00); /* Default message indexes */
+ pin_modify->bMsgIndex2 = (data->flags & SC_PIN_CMD_IMPLICIT_CHANGE ? 0x02: 0x01);
pin_modify->bMsgIndex3 = 0x02;
pin_modify->bTeoPrologue[0] = 0x00;
pin_modify->bTeoPrologue[1] = 0x00;
pin_modify->bTeoPrologue[2] = 0x00;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment