Skip to content

Commit

Permalink
reverse the credential list to keep behavior unchanged
Browse files Browse the repository at this point in the history
  • Loading branch information
z4yx committed Aug 6, 2024
1 parent 9ddef55 commit 6b7bb6d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions applets/ctap/ctap.c
Original file line number Diff line number Diff line change
Expand Up @@ -997,6 +997,11 @@ static uint8_t ctap_get_assertion(CborEncoder *encoder, uint8_t *params, size_t
}
// 7-f
if (number_of_credentials == 0) return CTAP2_ERR_NO_CREDENTIALS;
for (int i = 0; i < number_of_credentials/2; i++) { // reverse the list
int tmp = credential_list[number_of_credentials-1-i];
credential_list[number_of_credentials-1-i] = credential_list[i];
credential_list[i] = tmp;
}
}
// fetch dc and get private key
if (read_file(DC_FILE, &dc, credential_list[credential_counter] * (int) sizeof(CTAP_discoverable_credential),
Expand Down

0 comments on commit 6b7bb6d

Please sign in to comment.