- Properly handle max-length in PIN statements; added new stored-length:
PIN blah { max-length = 8; stored-length = 4; } Bug spotted by Victor Tarasov git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1750 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
parent
393de85ac1
commit
db7d3bac6e
|
@ -1279,6 +1279,17 @@ do_pin_maxlength(struct state *cur, int argc, char **argv)
|
|||
{
|
||||
unsigned int len;
|
||||
|
||||
if (get_uint(cur, argv[0], &len))
|
||||
return 1;
|
||||
cur->pin->pin.max_length = len;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
do_pin_storedlength(struct state *cur, int argc, char **argv)
|
||||
{
|
||||
unsigned int len;
|
||||
|
||||
if (get_uint(cur, argv[0], &len))
|
||||
return 1;
|
||||
cur->pin->pin.stored_length = len;
|
||||
|
@ -1416,6 +1427,7 @@ static struct command pi_commands[] = {
|
|||
{ "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 },
|
||||
{ NULL, 0, 0, NULL }
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue