Skip to content

Commit a2f1dc2

Browse files
Merge pull request #1176 from LedgerHQ/spo-api-level-24-backport
Spo api level 24 backport
2 parents dd57b59 + 09d473f commit a2f1dc2

File tree

4 files changed

+23
-3
lines changed

4 files changed

+23
-3
lines changed

lib_ccid/include/ccid_types.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,7 @@ typedef struct {
149149
uint16_t tx_message_length;
150150
uint16_t tx_message_offset;
151151

152-
uint8_t *tx_packet_buffer;
153-
uint8_t tx_packet_length;
152+
uint8_t tx_packet_length;
154153

155154
ccid_protocol_data_t0_t protocol_data;
156155

lib_ccid/src/ccid_transport.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ void CCID_TRANSPORT_tx(ccid_transport_t *handle,
150150
// Fill header
151151
if (buffer) {
152152
tx_packet_buffer[0] = handle->bulk_msg_header.in.msg_type;
153-
U4LE_ENCODE(handle->tx_packet_buffer, 1, handle->bulk_msg_header.in.length);
153+
U4LE_ENCODE(tx_packet_buffer, 1, handle->bulk_msg_header.in.length);
154154
tx_packet_buffer[5] = handle->bulk_msg_header.in.slot_number;
155155
tx_packet_buffer[6] = handle->bulk_msg_header.in.seq_number;
156156
tx_packet_buffer[7] = handle->bulk_msg_header.in.status;

lib_stusb/src/usbd_ledger.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -674,6 +674,18 @@ void USBD_LEDGER_start(void)
674674
USBD_Start(&usbd_ledger_data.usbd_handle);
675675
usbd_ledger_data.state = USBD_LEDGER_STATE_RUNNING;
676676
}
677+
else {
678+
for (int index = 0; index < usbd_ledger_data.nb_of_class; index++) {
679+
usbd_class_info_t *class_info = usbd_ledger_data.class[index];
680+
if (class_info) {
681+
if (class_info->init) {
682+
USBD_StatusTypeDef ret = ((usbd_class_init_t) PIC(class_info->init))(
683+
&usbd_ledger_data.usbd_handle, class_info->cookie);
684+
UNUSED(ret);
685+
}
686+
}
687+
}
688+
}
677689
}
678690

679691
void USB_LEDGER_stop(void)

lib_stusb/src/usbd_ledger_hid_u2f.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
#include "u2f_types.h"
2424
#include "usbd_ledger_hid_u2f.h"
2525

26+
#ifdef HAVE_BOLOS
27+
#include "cx_crc_internal.h"
28+
#endif // !HAVE_BOLOS
2629

2730
/* Private enumerations ------------------------------------------------------*/
2831
enum ledger_hid_u2f_state_t {
@@ -607,9 +610,15 @@ int32_t USBD_LEDGER_HID_U2F_data_ready(USBD_HandleTypeDef *pdev,
607610
// so no way to check the value
608611
}
609612

613+
#ifdef HAVE_BOLOS
614+
uint16_t crc = cx_crc16_update_internal(0,
615+
handle->transport_data.rx_message_buffer,
616+
handle->transport_data.rx_message_length);
617+
#else // !HAVE_BOLOS
610618
uint16_t crc = cx_crc16_update(0,
611619
handle->transport_data.rx_message_buffer,
612620
handle->transport_data.rx_message_length);
621+
#endif // !HAVE_BOLOS
613622
if (!length_ok) {
614623
error_msg[0] = 0x67;
615624
error_msg[1] = 0x00;

0 commit comments

Comments
 (0)