summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2016-10-13 16:48:52 +0200
committerNikos Mavrogiannopoulos <nmav@redhat.com>2016-10-14 12:54:19 +0200
commit8200043c9d8a47d69143e041e8e954339d06205d (patch)
tree2c8aeeee6100f6339263e7f3d25b30710a9ef7f6
parent1e23101fdcbaab6030d5d1a6379d991b022f0778 (diff)
downloadgnutls-8200043c9d8a47d69143e041e8e954339d06205d.tar.gz
p11tool: avoid asking the security officer PIN twice on initialization
-rw-r--r--src/pkcs11.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/pkcs11.c b/src/pkcs11.c
index 5f9dd82028..e9900ec284 100644
--- a/src/pkcs11.c
+++ b/src/pkcs11.c
@@ -740,6 +740,9 @@ pkcs11_init(FILE * outfile, const char *url, const char *label,
if (pin == NULL || pin[0] == '\n')
exit(1);
+ /* do not ask the SO PIN twice */
+ setenv("GNUTLS_SO_PIN", so_pin, 0);
+
ret = gnutls_pkcs11_token_set_pin(url, NULL, pin, GNUTLS_PIN_USER);
if (ret < 0) {
fprintf(stderr, "Error in %s:%d: %s\n", __func__, __LINE__,