From a759b76e4a0945a42e70c212e6a103018c5bbfe9 Mon Sep 17 00:00:00 2001 From: Pol Henarejos Date: Tue, 23 Jun 2026 12:46:46 +0200 Subject: [PATCH] Fix F-3 for hmacSecretMC Signed-off-by: Pol Henarejos --- src/fido/cbor_make_credential.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/fido/cbor_make_credential.c b/src/fido/cbor_make_credential.c index 46ae19a..730a249 100644 --- a/src/fido/cbor_make_credential.c +++ b/src/fido/cbor_make_credential.c @@ -395,6 +395,16 @@ int cbor_make_credential(const uint8_t *data, size_t len) { if (hmac_secret_mc && extensions.hmac_secret != ptrue) { CBOR_ERROR(CTAP2_ERR_MISSING_PARAMETER); } + if (hmac_secret_mc) { + if (kax.present == false || kay.present == false || crv == 0 || hmac_alg == 0 || + salt_enc.present == false || salt_auth.present == false) { + CBOR_ERROR(CTAP2_ERR_MISSING_PARAMETER); + } + if (salt_enc.len != 32 + (hmacSecretPinUvAuthProtocol - 1) * IV_SIZE && + salt_enc.len != 64 + (hmacSecretPinUvAuthProtocol - 1) * IV_SIZE) { + CBOR_ERROR(CTAP1_ERR_INVALID_PARAMETER); + } + } if (options.up == ptrue || options.up == NULL) { //14.1 if (pinUvAuthParam.present == true) {