From 71c0e865dcf6cb71ddf13abbbec061ca1a77a815 Mon Sep 17 00:00:00 2001 From: Pol Henarejos Date: Mon, 28 Nov 2022 18:27:12 +0100 Subject: [PATCH] Fixed RP attachment to token. Signed-off-by: Pol Henarejos --- src/fido/cbor_client_pin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fido/cbor_client_pin.c b/src/fido/cbor_client_pin.c index e1d0fcc..bf6a21e 100644 --- a/src/fido/cbor_client_pin.c +++ b/src/fido/cbor_client_pin.c @@ -544,7 +544,7 @@ int cbor_client_pin(const uint8_t *data, size_t len) { permissions = CTAP_PERMISSION_MC | CTAP_PERMISSION_GA; paut.permissions = permissions; if (rpId.present == true) { - memcpy(paut.rp_id_hash, rpId.data, 32); + mbedtls_sha256((uint8_t *)rpId.data, rpId.len, paut.rp_id_hash, 0); paut.has_rp_id = true; } uint8_t pinUvAuthToken_enc[32+IV_SIZE];