Skip to content

Commit

Permalink
Use fido_cred_verify_self when the authenticator does not return an x5c
Browse files Browse the repository at this point in the history
  • Loading branch information
James-ZHANG authored and LDVG committed Oct 14, 2024
1 parent 5c7ed8f commit 7c00303
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions examples/cred.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,13 @@ verify_cred(int type, const char *fmt, const unsigned char *authdata_ptr,
if (r != FIDO_OK)
errx(1, "fido_cred_set_attstmt: %s (0x%x)", fido_strerr(r), r);

r = fido_cred_verify(cred);
if (r != FIDO_OK)
errx(1, "fido_cred_verify: %s (0x%x)", fido_strerr(r), r);
if (fido_cred_x5c_ptr(cred) == NULL) {
if ((r = fido_cred_verify_self(cred)) != FIDO_OK)
errx(1, "fido_cred_verify_self: %s (0x%x)", fido_strerr(r), r);
} else {
if ((r = fido_cred_verify(cred)) != FIDO_OK)
errx(1, "fido_cred_verify: %s (0x%x)", fido_strerr(r), r);
}

out:
if (key_out != NULL) {
Expand Down

0 comments on commit 7c00303

Please sign in to comment.