return 200;
}
- if (Result[*ResultLen-2] == 0x61) {
+/* if (Result[*ResultLen-2] == 0x61) {
uint8_t La = Result[*ResultLen-1];
uint8_t get_response[5] = {apdu[0], ISO7816_GET_RESPONSE, 0x00, 0x00, La};
return EMVExchangeEx(channel, false, LeaveFieldON, get_response, sizeof(get_response), Result, MaxResultLen, ResultLen, sw, tlv);
- }
+ }*/
*ResultLen -= 2;
isw = Result[*ResultLen] * 0x0100 + Result[*ResultLen + 1];
} else if (apdu_len > 5 && apdu_len == 5 + apdu[4] + 1) {
// there is Lc, data and Le
} else {
- apdu_len++; // no Le, add Le = 0x00 because some vendors require it for contactless
+ if (apdu[1] != 0xc0)
+ apdu_len++; // no Le, add Le = 0x00 because some vendors require it for contactless
}
}
return EMVExchangeEx(channel, false, LeaveFieldON, APDU, apdu_len, Result, MaxResultLen, ResultLen, sw, tlv);
int FIDORegister(uint8_t *params, uint8_t *Result, size_t MaxResultLen, size_t *ResultLen, uint16_t *sw)
{
- uint8_t APDU[4 + 64] = {0x00, 0x01, 0x03, 0x00, 64, 0x00};
- memcpy(APDU, params, 64);
- return FIDOExchange(APDU, 4 + 64, Result, MaxResultLen, ResultLen, sw);
+ uint8_t APDU[5 + 64] = {0x00, 0x01, 0x03, 0x00, 64, 0x00};
+ memcpy(APDU + 5, params, 64);
+ return FIDOExchange(APDU, 5 + 64, Result, MaxResultLen, ResultLen, sw);
}
int FIDOAuthentication(uint8_t *params, uint8_t paramslen, uint8_t controlb, uint8_t *Result, size_t MaxResultLen, size_t *ResultLen, uint16_t *sw)
{
uint8_t APDU[APDU_COMMAND_LEN] = {0x00, 0x02, controlb, 0x00, paramslen, 0x00};
- memcpy(APDU+5, params, paramslen);
+ memcpy(APDU + 5, params, paramslen);
int apdu_len = 5 + paramslen;
return FIDOExchange(APDU, apdu_len, Result, MaxResultLen, ResultLen, sw);
}
int FIDO2GetInfo(uint8_t *Result, size_t MaxResultLen, size_t *ResultLen, uint16_t *sw)
{
- uint8_t APDU[5] = {0x80, 0x10, 0x00, 0x00, fido2CmdGetInfo};
+ uint8_t APDU[6] = {0x80, 0x10, 0x00, 0x00, 0x01, fido2CmdGetInfo};
return FIDOExchange(APDU, sizeof(APDU), Result, MaxResultLen, ResultLen, sw);
}