Fix tools interpretation of util_getpass return value
A negative value means a error and not "No PIN entered". Signed-off-by: Nuno Goncalves <nunojpg@gmail.com>
This commit is contained in:
parent
423375c6f8
commit
9eb706ba29
|
@ -1094,7 +1094,7 @@ static int do_verify(int argc, char **argv)
|
||||||
printf("Please enter PIN: ");
|
printf("Please enter PIN: ");
|
||||||
r = util_getpass(&pin, &len, stdin);
|
r = util_getpass(&pin, &len, stdin);
|
||||||
if (r < 0) {
|
if (r < 0) {
|
||||||
printf("No PIN entered - aborting VERIFY.\n");
|
printf("util_getpass error.\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1246,7 +1246,7 @@ static int login(CK_SESSION_HANDLE session, int login_type)
|
||||||
|
|
||||||
r = util_getpass(&pin, &len, stdin);
|
r = util_getpass(&pin, &len, stdin);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
util_fatal("No PIN entered");
|
util_fatal("util_getpass error");
|
||||||
pin_allocated = 1;
|
pin_allocated = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue