diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2016-10-13 16:37:45 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2016-10-14 12:53:29 +0200 |
commit | 0a85708fb0b4f661427a48003c12fbc760ceed2e (patch) | |
tree | 1a7a2dde1e5b71ca844f154d905646f7bdffa820 | |
parent | 58e5e8521b1f2298ee06596eb864268c50b6f344 (diff) | |
download | gnutls-0a85708fb0b4f661427a48003c12fbc760ceed2e.tar.gz |
p11tool: corrected check of PIN existance in token initialization
-rw-r--r-- | src/pkcs11.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pkcs11.c b/src/pkcs11.c index e6cb677778..8c5cb09224 100644 --- a/src/pkcs11.c +++ b/src/pkcs11.c @@ -712,7 +712,7 @@ pkcs11_init(FILE * outfile, const char *url, const char *label, strcpy(so_pin, pin); - if (info->so_pin != NULL) { + if (info->pin != NULL) { pin = info->pin; } else { pin = getenv("GNUTLS_PIN"); @@ -722,7 +722,7 @@ pkcs11_init(FILE * outfile, const char *url, const char *label, exit(1); } - if (pin[0] == '\n') + if (pin == NULL || pin[0] == '\n') exit(1); ret = gnutls_pkcs11_token_init(url, so_pin, label); |