summaryrefslogtreecommitdiff
path: root/src/common.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common.c')
-rw-r--r--src/common.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/common.c b/src/common.c
index 04d1356ff7..3a7ded6929 100644
--- a/src/common.c
+++ b/src/common.c
@@ -886,9 +886,25 @@ int len;
return 0;
}
+static int token_callback(void* user, const char* label, const unsigned retry)
+{
+char buf[32];
+char *p;
+
+ if (retry > 0) {
+ fprintf(stderr, "Could not find token %s\n", label);
+ return -1;
+ }
+ printf("Please insert token '%s' in slot and press enter\n", label);
+ p = fgets(buf, sizeof(buf), stdin);
+
+ return 0;
+}
+
void pkcs11_common(void)
{
gnutls_pkcs11_set_pin_function (pin_callback, NULL);
+ gnutls_pkcs11_set_token_function(token_callback, NULL);
}