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-tool: check for expected tags (.pka files)
  • Loading branch information
Frank Braun committed Oct 29, 2019
commit 5729c5ec52309728a6c391cfe478700e2ebc3192
15 changes: 15 additions & 0 deletions src/tools/sc-hsm-tool.c
Original file line number Diff line number Diff line change
Expand Up @@ -1943,6 +1943,11 @@ static int register_public_key(sc_context_t *ctx, sc_card_t *card, const char *i
r = -1;
goto err;
}
if (tag_out != 0x7) {
fprintf(stderr, "Wrong tag when reading public key: got %x, expected %x\n", tag_out, 0x7);
r = -1;
goto err;
}
pk = buf;
pk_len = taglen;
buf += taglen;
Expand All @@ -1953,6 +1958,11 @@ static int register_public_key(sc_context_t *ctx, sc_card_t *card, const char *i
r = -1;
goto err;
}
if (tag_out != 0x1f21) {
fprintf(stderr, "Wrong tag when reading device certificate: got %x, expected %x\n", tag_out, 0x1f21);
r = -1;
goto err;
}
devcert = buf;
devcert_len = taglen;
buf += taglen;
Expand All @@ -1963,6 +1973,11 @@ static int register_public_key(sc_context_t *ctx, sc_card_t *card, const char *i
r = -1;
goto err;
}
if (tag_out != 0x1f21) {
fprintf(stderr, "Wrong tag when reading device CA: got %x, expected %x\n", tag_out, 0x1f21);
r = -1;
goto err;
}
dicacert = buf;
dicacert_len = taglen;

Expand Down