Skip to content

Commit

Permalink
dtrust-tool: validate PIN length
Browse files Browse the repository at this point in the history
  • Loading branch information
hamarituc authored and xhanulik committed Mar 5, 2024
1 parent 96bc6a1 commit 3f0175c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/tools/dtrust-tool.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ unlock_transport_protection(sc_card_t *card)
data.cmd = SC_PIN_CMD_CHANGE;
data.pin_type = SC_AC_CHV;
data.pin_reference = 0x87;
data.pin1.min_length = 5;
data.pin1.max_length = 5;
data.pin2.min_length = 6;
data.pin2.max_length = 12;

if (card->reader->capabilities & SC_READER_CAP_PIN_PAD) {
printf("Please enter PINs on the reader's pin pad.\n");
Expand Down

0 comments on commit 3f0175c

Please sign in to comment.