[gnutls-devel] GnuTLS | p11tool: fix admin user PIN initialization (!776)

Development of GNU's TLS library gnutls-devel at lists.gnutls.org
Thu Oct 18 17:26:21 CEST 2018


Patrick Steuer started a new discussion on src/pkcs11.c:

> -				pin = getpass("Enter Administrators's new PIN: ");
> -			if (pin == NULL)
> +			getenv_copy(tmp, sizeof(tmp), "GNUTLS_OLD_SO_PIN");
> +			if (tmp[0] == 0) {
> +				fprintf(stderr, "Use GNUTLS_OLD_SO_PIN in batch mode\n");
>  				app_exit(1);
> +			}
> +		}
> +
> +		if (tmp[0] != 0)
> +			oldpin = tmp;
> +
> +		if (info->so_pin != NULL) {
> +			snprintf(newpin, sizeof(newpin), "%s", info->so_pin);
> +		} else {
> +			getenv_copy(newpin, sizeof(newpin), "GNUTLS_NEW_SO_PIN");

E.g. here it works differently: only ask user to enter pin if env var is not set.

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/merge_requests/776#note_109974042
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gnutls-devel/attachments/20181018/8b486f62/attachment-0001.html>


More information about the Gnutls-devel mailing list