diff --git a/src/libopensc/pkcs15.h b/src/libopensc/pkcs15.h index 0e97c12c..fd2ce068 100644 --- a/src/libopensc/pkcs15.h +++ b/src/libopensc/pkcs15.h @@ -128,7 +128,8 @@ struct sc_pkcs15_auth_info { /* authentication method: CHV, SEN, SYMBOLIC, ... */ unsigned int auth_method; - int tries_left, max_tries; + int tries_left, max_tries; + int max_unlocks; }; typedef struct sc_pkcs15_auth_info sc_pkcs15_auth_info_t; diff --git a/src/pkcs15init/profile.c b/src/pkcs15init/profile.c index 95ec7f5d..1c560f89 100644 --- a/src/pkcs15init/profile.c +++ b/src/pkcs15init/profile.c @@ -1609,6 +1609,18 @@ do_pin_attempts(struct state *cur, int argc, char **argv) return 0; } +static int +do_pin_maxunlocks(struct state *cur, int argc, char **argv) +{ + struct pin_info *pi = cur->pin; + unsigned int count; + + if (get_uint(cur, argv[0], &count)) + return 1; + pi->pin.max_unlocks = count; + return 0; +} + static int do_pin_type(struct state *cur, int argc, char **argv) { @@ -1814,16 +1826,17 @@ static struct block fs_blocks[] = { * Pin section */ static struct command pi_commands[] = { - { "file", 1, 1, do_pin_file }, - { "offset", 1, 1, do_pin_offset }, - { "attempts", 1, 2, do_pin_attempts }, - { "encoding", 1, 1, do_pin_type }, - { "reference", 1, 1, do_pin_reference}, - { "auth-id", 1, 1, do_pin_authid }, - { "max-length", 1, 1, do_pin_maxlength}, - { "min-length", 1, 1, do_pin_minlength}, - { "stored-length", 1, 1, do_pin_storedlength}, - { "flags", 1, -1, do_pin_flags }, + { "file", 1, 1, do_pin_file }, + { "offset", 1, 1, do_pin_offset }, + { "attempts", 1, 2, do_pin_attempts }, + { "encoding", 1, 1, do_pin_type }, + { "reference", 1, 1, do_pin_reference }, + { "auth-id", 1, 1, do_pin_authid }, + { "max-length", 1, 1, do_pin_maxlength }, + { "min-length", 1, 1, do_pin_minlength }, + { "stored-length", 1, 1, do_pin_storedlength }, + { "max-unlocks", 1, 1, do_pin_maxunlocks }, + { "flags", 1, -1, do_pin_flags }, { NULL, 0, 0, NULL } };