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:
Nuno Goncalves 2017-01-31 17:32:51 +01:00 committed by Frank Morgner
parent 423375c6f8
commit 9eb706ba29
2 changed files with 2 additions and 2 deletions

View File

@ -1094,7 +1094,7 @@ static int do_verify(int argc, char **argv)
printf("Please enter PIN: ");
r = util_getpass(&pin, &len, stdin);
if (r < 0) {
printf("No PIN entered - aborting VERIFY.\n");
printf("util_getpass error.\n");
return -1;
}

View File

@ -1246,7 +1246,7 @@ static int login(CK_SESSION_HANDLE session, int login_type)
r = util_getpass(&pin, &len, stdin);
if (r < 0)
util_fatal("No PIN entered");
util_fatal("util_getpass error");
pin_allocated = 1;
}