From b87eb3f2782db302df779c3c6e713b18c84fd3f1 Mon Sep 17 00:00:00 2001 From: Pol Henarejos Date: Mon, 3 Oct 2022 10:43:24 +0200 Subject: [PATCH] Credentials are sequentially returned only if allowList is empty. Also, user data is returned only when more than 1 credential is returned (and thus, are discoverable). Signed-off-by: Pol Henarejos --- src/fido/cbor_get_assertion.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fido/cbor_get_assertion.c b/src/fido/cbor_get_assertion.c index 5e8ed1f..28f1083 100644 --- a/src/fido/cbor_get_assertion.c +++ b/src/fido/cbor_get_assertion.c @@ -481,7 +481,7 @@ int cbor_get_assertion(const uint8_t *data, size_t len, bool next) { if (selcred->opts.present == true && selcred->opts.rk == ptrue) { CBOR_CHECK(cbor_encode_uint(&mapEncoder, 0x04)); uint8_t lu = 1; - if (numberOfCredentials > 1 && next == false && allowList_len == 0) { + if (numberOfCredentials > 1 && allowList_len == 0) { if (selcred->userName.present == true) lu++; if (selcred->userDisplayName.present == true) @@ -490,7 +490,7 @@ int cbor_get_assertion(const uint8_t *data, size_t len, bool next) { CBOR_CHECK(cbor_encoder_create_map(&mapEncoder, &mapEncoder2, lu)); CBOR_CHECK(cbor_encode_text_stringz(&mapEncoder2, "id")); CBOR_CHECK(cbor_encode_byte_string(&mapEncoder2, selcred->userId.data, selcred->userId.len)); - if (numberOfCredentials > 1 && next == false && allowList_len == 0) { + if (numberOfCredentials > 1 && allowList_len == 0) { if (selcred->userName.present == true) { CBOR_CHECK(cbor_encode_text_stringz(&mapEncoder2, "name")); CBOR_CHECK(cbor_encode_text_stringz(&mapEncoder2, selcred->userName.data));