[gnutls-devel] GnuTLS | x509: pin/password callback support for openssl encrypted private keys (!1459)

Read-only notification of GnuTLS library development activities gnutls-devel at lists.gnutls.org
Sat Aug 14 16:31:31 CEST 2021




Craig commented on a discussion on lib/x509/privkey.c: https://gitlab.com/gnutls/gnutls/-/merge_requests/1459#note_651192181

>  		    /* use the callback if any */
>  			ret = _gnutls_retrieve_pin(&key->pin, "key:", "", 0, pin, sizeof(pin));
>  			if (ret == 0) {
> -				password = pin;
> +				ret = gnutls_x509_privkey_import_pkcs8(key, data, format, pin, flags);
>  			}
> -
> -			ret =
> -			    gnutls_x509_privkey_import_pkcs8(key, data, format,
> -						     password, flags);

Sorry if I'm missing something, but isn't the line in your proposed else statement what's happening on (unmodified) line 750?  It tries the function-supplied password and then only tries the callback version if that failed and the GNUTLS_PKCS_PLAIN flag isn't set.

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/-/merge_requests/1459#note_651192181
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/20210814/d3906023/attachment.html>


More information about the Gnutls-devel mailing list