Check-in [de23309dd3]
Overview
Comment:Updated extended modes to use BER encoding and added some basic comments
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | piv
Files: files | file ages | folders
SHA1:de23309dd3aacee632637f2a11bff5287c5258c1
User & Date: rkeene on 2013-01-14 17:53:54
Other Links: manifest | tags
Context
2013-01-14
17:56
Updated documentation for cackey_get_data check-in: a02a881547 user: rkeene tags: piv
17:53
Updated extended modes to use BER encoding and added some basic comments check-in: de23309dd3 user: rkeene tags: piv
2013-01-10
19:39
Added debug messages for newly supported features which may not function. Updated to not use newly supported features, which seem to fail sometimes. check-in: 1b3d97f6ef user: rkeene tags: piv
Changes

Modified cackey.c from [fc1d1ef268] to [d345cec881].

  1433   1433   	xmit_buf[xmit_len++] = instruction;
  1434   1434   	xmit_buf[xmit_len++] = p1;
  1435   1435   	xmit_buf[xmit_len++] = p2;
  1436   1436   	if (data) {
  1437   1437   		if (lc > 255) {
  1438   1438   			CACKEY_DEBUG_PRINTF("CAUTION!  Using an Lc greater than 255 is untested.  Lc = %u", lc);
  1439   1439   
  1440         -			xmit_buf[xmit_len++] = 0x80; /* XXX UNTESTED */
         1440  +			xmit_buf[xmit_len++] = 0x82; /* XXX UNTESTED */
  1441   1441   			xmit_buf[xmit_len++] = (lc & 0xff00) >> 8;
  1442   1442   			xmit_buf[xmit_len++] = lc & 0xff;
  1443   1443   		} else {
  1444   1444   			xmit_buf[xmit_len++] = lc;
  1445   1445   		}
  1446   1446   		for (idx = 0; idx < lc; idx++) {
  1447   1447   			xmit_buf[xmit_len++] = data[idx];
................................................................................
  1448   1448   		}
  1449   1449   	}
  1450   1450   
  1451   1451   	if (le != 0x00) {
  1452   1452   		if (le > 256) {
  1453   1453   			CACKEY_DEBUG_PRINTF("CAUTION!  Using an Le greater than 256 is untested.  Le = %u", le);
  1454   1454   
  1455         -			xmit_buf[xmit_len++] = 0x80; /* XXX UNTESTED */
         1455  +			xmit_buf[xmit_len++] = 0x82; /* XXX UNTESTED */
  1456   1456   			xmit_buf[xmit_len++] = (le & 0xff00) >> 8;
  1457   1457   			xmit_buf[xmit_len++] = le & 0xff;
  1458   1458   		} else if (le == 256) {
  1459   1459   			xmit_buf[xmit_len++] = 0x00;
  1460   1460   		} else {
  1461   1461   			xmit_buf[xmit_len++] = le;
  1462   1462   		}
................................................................................
  1702   1702   	max_offset = count;
  1703   1703   	max_count = CACKEY_APDU_MTU;
  1704   1704   
  1705   1705   	cmd[2] = oid[0];
  1706   1706   	cmd[3] = oid[1];
  1707   1707   	cmd[4] = oid[2];
  1708   1708   
         1709  +	/* 256 to indicate the largest message size -- not clear if this will work with all messages */
  1709   1710   	send_ret = cackey_send_apdu(slot, GSCIS_CLASS_ISO7816, NISTSP800_73_3_INSTR_GET_DATA, 0x3F, 0xFF, sizeof(cmd), cmd, 256, &respcode, buffer, &count);
  1710   1711   
  1711   1712   	if (send_ret == CACKEY_PCSC_E_RETRY) {
  1712   1713   		CACKEY_DEBUG_PRINTF("ADPU Sending failed, retrying read buffer");
  1713   1714   
  1714   1715   		return(cackey_get_data(slot, buffer, init_count, oid));
  1715   1716   	}