Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sc-hsm-tool: Add options for public key authentication #1711

Closed
wants to merge 23 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
sc-hsm: strlen() -> strnlen()
  • Loading branch information
Frank Braun committed Oct 29, 2019
commit de3d8e4cdf377fc7c22aebdcdd22128a0b3f6885
2 changes: 1 addition & 1 deletion src/libopensc/card-sc-hsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1501,7 +1501,7 @@ static int verify_certificate(sc_card_t *card, const u8 *cert, size_t cert_len,
/* select public key for verification */
r = get_CAR(car, card->ctx, cert, cert_len);
LOG_TEST_RET(card->ctx, r, "cannot parse CAR");
car_len = strlen((const char*) car);
car_len = strnlen((const char*) car, sizeof car);

if ((r = sc_asn1_put_tag(tag, car, car_len, pukref, sizeof(pukref), &ptr)) < 0) {
fprintf(stderr, "Error formatting ASN.1 sequence: %s\n", sc_strerror(r));
Expand Down