From 8b77624d6927983af73f611b50803d72219be370 Mon Sep 17 00:00:00 2001 From: z4yx Date: Sat, 5 Aug 2023 10:08:21 +0800 Subject: [PATCH] enlarge the CTAP buffer --- interfaces/USB/class/ctaphid/ctaphid.c | 1 + interfaces/USB/class/ctaphid/ctaphid.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/interfaces/USB/class/ctaphid/ctaphid.c b/interfaces/USB/class/ctaphid/ctaphid.c index ba99e9aa..a9b1a1fe 100644 --- a/interfaces/USB/class/ctaphid/ctaphid.c +++ b/interfaces/USB/class/ctaphid/ctaphid.c @@ -147,6 +147,7 @@ uint8_t CTAPHID_Loop(uint8_t wait_for_user) { } channel.bcnt_total = (uint16_t)MSG_LEN(frame); if (channel.bcnt_total > MAX_CTAP_BUFSIZE) { + DBG_MSG("bcnt_total=%hu exceeds MAX_CTAP_BUFSIZE\n", channel.bcnt_total); CTAPHID_SendErrorResponse(frame.cid, ERR_INVALID_LEN); return LOOP_SUCCESS; } diff --git a/interfaces/USB/class/ctaphid/ctaphid.h b/interfaces/USB/class/ctaphid/ctaphid.h index fb858a10..af61f87b 100644 --- a/interfaces/USB/class/ctaphid/ctaphid.h +++ b/interfaces/USB/class/ctaphid/ctaphid.h @@ -93,7 +93,7 @@ typedef struct { #define LOOP_SUCCESS 0x00 #define LOOP_CANCEL 0x01 -#define MAX_CTAP_BUFSIZE 1280 +#define MAX_CTAP_BUFSIZE 1300 typedef struct { uint32_t cid;