-int FIDO2MakeCredential(uint8_t *params, uint8_t paramslen, uint8_t *Result, size_t MaxResultLen, size_t *ResultLen, uint16_t *sw) {
- uint8_t data[paramslen + 1];
- data[0] = fido2CmdMakeCredential;
- memcpy(&data[1], params, paramslen);
- return FIDOExchange((sAPDU){0x80, 0x10, 0x00, 0x00, sizeof(data), data}, Result, MaxResultLen, ResultLen, sw);
+int FIDO2MakeCredential(uint8_t *params, uint8_t paramslen, uint8_t *Result, size_t MaxResultLen, size_t *ResultLen, uint16_t *sw)
+{
+ uint8_t APDU[APDU_COMMAND_LEN] = {0x80, 0x10, 0x00, 0x00, paramslen + 1, fido2CmdMakeCredential, 0x00};
+ memcpy(APDU+6, params, paramslen);
+ int apdu_len = 5 + paramslen + 1;
+ return FIDOExchange(APDU, apdu_len, Result, MaxResultLen, ResultLen, sw);