support factory_reset.

This commit is contained in:
NIIBE Yutaka
2016-10-14 08:45:01 +09:00
parent 34d0b34144
commit ffa9bf1f94
10 changed files with 60 additions and 38 deletions

View File

@@ -795,6 +795,10 @@ ccid_power_on (struct ccid *c)
memcpy (p + CCID_MSG_HEADER_SIZE, ATR_head, sizeof (ATR_head));
memcpy (p + CCID_MSG_HEADER_SIZE + sizeof (ATR_head),
historical_bytes + 1, historical_bytes[0]);
#ifdef LIFE_CYCLE_MANAGEMENT_SUPPORT
if (file_selection == 255)
p[CCID_MSG_HEADER_SIZE + sizeof (ATR_head) + 7] = 0x03;
#endif
for (i = 1; i < (int)size_atr - 1; i++)
xor_check ^= p[CCID_MSG_HEADER_SIZE + i];
p[CCID_MSG_HEADER_SIZE+size_atr-1] = xor_check;