diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2016-10-13 16:37:45 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2016-10-13 16:37:45 +0200 |
commit | 85dcbfa786ac5a3f857640e59b9b38202b8a5f09 (patch) | |
tree | 91b6a41cf0cd19d1359f3cf0cadfb895ec2f0752 /src | |
parent | b885f3fac1c15d7a58b60cb71fb3276fc004ac88 (diff) | |
download | gnutls-85dcbfa786ac5a3f857640e59b9b38202b8a5f09.tar.gz |
p11tool: corrected check of PIN existance in token initialization
Diffstat (limited to 'src')
-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 62f0be6b91..e590f67bf0 100644 --- a/src/pkcs11.c +++ b/src/pkcs11.c @@ -886,7 +886,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"); @@ -896,7 +896,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); |