[pkg-opensc-commit] [opensc] 167/295: Fix tools interpretation of util_getpass return value

Eric Dorland eric at moszumanska.debian.org
Sat Jun 24 21:11:28 UTC 2017


This is an automated email from the git hooks/post-receive script.

eric pushed a commit to branch master
in repository opensc.

commit 9eb706ba293756122b6eed42276ee45ac02b6b6e
Author: Nuno Goncalves <nunojpg at gmail.com>
Date:   Tue Jan 31 17:32:51 2017 +0100

    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 at gmail.com>
---
 src/tools/opensc-explorer.c | 2 +-
 src/tools/pkcs11-tool.c     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/tools/opensc-explorer.c b/src/tools/opensc-explorer.c
index 91a2fe2..8ec63cf 100644
--- a/src/tools/opensc-explorer.c
+++ b/src/tools/opensc-explorer.c
@@ -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;
 			}
 
diff --git a/src/tools/pkcs11-tool.c b/src/tools/pkcs11-tool.c
index 931f083..b966ddd 100644
--- a/src/tools/pkcs11-tool.c
+++ b/src/tools/pkcs11-tool.c
@@ -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;
 	}
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opensc/opensc.git



More information about the pkg-opensc-commit mailing list