Skip to content

Commit

Permalink
[fix] Cred number must be set to 1 when credential is chosen SK-side
Browse files Browse the repository at this point in the history
  • Loading branch information
lpascal-ledger committed Nov 6, 2024
1 parent c84ead4 commit 85263f0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions src/ctap2/get_assertion/get_assertion_ui.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,11 @@ static void ctap_ux_on_user_choice(bool confirm, uint16_t idx) {
ctap2UxState = CTAP2_UX_STATE_NONE;

if (confirm) {
// As the choice is made authenticator-side, according to the spec SK should display 1 and
// only 1 matching credential. This will prevent the client to call getNextAssertion to
// discover more credentials.
globals_get_ctap2_assert_data()->availableCredentials = 1;
// As the choice is made authenticator-side, according to the spec SK should not let the
// client being aware of additional credentials. This will prevent the client to call
// getNextAssertion to discover more credentials.
globals_get_ctap2_assert_data()->availableCredentials =
MIN(globals_get_ctap2_assert_data()->availableCredentials, 1);
get_assertion_confirm(idx);
#ifdef HAVE_NBGL
app_nbgl_status("Login request signed", true, ui_idle);
Expand Down
2 changes: 1 addition & 1 deletion src/ctap2/get_assertion/get_assertion_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ static int sign_and_encode_authData(cbipEncoder_t *encoder,
uint32_t signatureLength;
int status;

PRINTF("Data to sign (szie %d) %.*H\n", authDataLen, authDataLen, authData);
PRINTF("Data to sign (size %d) %.*H\n", authDataLen, authDataLen, authData);

// Add client data hash for the attestation.
// We consider we can add it after authData.
Expand Down

0 comments on commit 85263f0

Please sign in to comment.