Skip to content

Commit bb88b46

Browse files
[io/usb/u2f]: use internal crc16 function for OS.
1 parent ed4711c commit bb88b46

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

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)