Use get_version_major and get_version_minor as pointers.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos 2023-11-06 11:57:09 +01:00
parent c9cb330a07
commit d253889747
No known key found for this signature in database
GPG key ID: C0095B7870A4CCD3

View file

@ -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;