From d25388974780e1d142ec35aaceb0fbc0e72bf9e7 Mon Sep 17 00:00:00 2001 From: Pol Henarejos Date: Mon, 6 Nov 2023 11:57:09 +0100 Subject: [PATCH] Use get_version_major and get_version_minor as pointers. Signed-off-by: Pol Henarejos --- src/usb/hid/hid.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/usb/hid/hid.c b/src/usb/hid/hid.c index 1969a7b..f238eb9 100644 --- a/src/usb/hid/hid.c +++ b/src/usb/hid/hid.c @@ -29,8 +29,8 @@ static bool mounted = false; extern int cbor_process(uint8_t, const uint8_t *, size_t); extern void init_fido(); bool is_nitrokey = false; -extern uint8_t get_version_major(); -extern uint8_t get_version_minor(); +uint8_t (*get_version_major)() = NULL; +uint8_t (*get_version_minor)() = NULL; typedef struct msg_packet { uint16_t len; @@ -360,8 +360,8 @@ int driver_process_usb_packet_hid(uint16_t read) { memcpy(resp->nonce, req->nonce, sizeof(resp->nonce)); resp->cid = 0x01000000; resp->versionInterface = CTAPHID_IF_VERSION; - resp->versionMajor = get_version_major(); - resp->versionMinor = get_version_minor(); + resp->versionMajor = get_version_major ? get_version_major() : HSM_SDK_VERSION_MAJOR; + resp->versionMinor = get_version_minor ? get_version_minor() : HSM_SDK_VERSION_MINOR; resp->capFlags = CAPFLAG_WINK | CAPFLAG_CBOR; ctap_resp->cid = ctap_req->cid;