name = set-pin;
arg-type = string;
descrip = "Specify the PIN to use on token initialization";
- doc = "";
+ doc = "Alternatively the GNUTLS_PIN environment variable may be used.";
};
flag = {
name = set-so-pin;
arg-type = string;
descrip = "Specify the Security Officer's PIN to use on token initialization";
- doc = "";
+ doc = "Alternatively the GNUTLS_SO_PIN environment variable may be used.";
};
flag = {
if (info->so_pin != NULL)
pin = info->so_pin;
else {
- pin = getpass("Enter Security Officer's PIN: ");
+ pin = getenv("GNUTLS_SO_PIN");
+ if (pin == NULL && info->batch == 0)
+ pin = getpass("Enter Security Officer's PIN: ");
if (pin == NULL)
exit(1);
}
strcpy(so_pin, pin);
- if (info->so_pin != NULL)
+ if (info->so_pin != NULL) {
pin = info->pin;
- else {
- pin = getpass("Enter new User's PIN: ");
+ } else {
+ pin = getenv("GNUTLS_PIN");
+ if (pin == NULL && info->batch == 0)
+ pin = getpass("Enter new User's PIN: ");
if (pin == NULL)
exit(1);
}