Differences From Artifact [c23e82a84b]:
- File
cackey.c
— part of check-in
[f276873873]
at
2010-05-17 20:20:16
on branch trunk
— Updated to not set "Le" when asking to sign/decrypt (discovered from
ActivClient APDU dump)
Reverted last commit where reads of 0 bytes were converted to no-ops (user: rkeene, size: 148354) [annotate] [blame] [check-ins using]
To Artifact [ace314276a]:
- File cackey.c — part of check-in [a42647e45a] at 2010-05-17 21:39:00 on branch trunk — Updated to deal with reads of unknown size (user: rkeene, size: 148519) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
1144 1145 1146 1147 1148 1149 1150 | bytes_to_copy = *respdata_len; if (recv_len < bytes_to_copy) { bytes_to_copy = recv_len; } | | > > > > | 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 | bytes_to_copy = *respdata_len; if (recv_len < bytes_to_copy) { bytes_to_copy = recv_len; } CACKEY_DEBUG_PRINTF("Copying %lu bytes to the buffer (recv'd %lu bytes, but only %lu bytes left in our buffer)", (unsigned long) bytes_to_copy, (unsigned long) recv_len, (unsigned long) *respdata_len); memcpy(respdata, recv_buf, bytes_to_copy); respdata += bytes_to_copy; *respdata_len = bytes_to_copy; tmp_respdata_len -= bytes_to_copy; } else { if (recv_len != 0) { CACKEY_DEBUG_PRINTF("Throwing away %lu bytes, nowhere to put them!", (unsigned long) recv_len); } } if (major_rc == 0x61) { /* We need to READ */ CACKEY_DEBUG_PRINTF("Buffer read required"); if (minor_rc == 0x00) { minor_rc = 253; } pcsc_getresp_ret = cackey_send_apdu(slot, GSCIS_CLASS_ISO7816, GSCIS_INSTR_GET_RESPONSE, 0x00, 0x00, 0, NULL, minor_rc, respcode, respdata, &tmp_respdata_len); if (pcsc_getresp_ret != CACKEY_PCSC_S_OK) { CACKEY_DEBUG_PRINTF("Buffer read failed! Returning in failure"); /* End Smartcard Transaction */ cackey_end_transaction(slot); |
︙ | ︙ |