[gnutls-devel] GnuTLS | locks: couple of improvements using Gnulib glthread (!1485)

Read-only notification of GnuTLS library development activities gnutls-devel at lists.gnutls.org
Mon Nov 15 18:47:23 CET 2021




Daiki Ueno commented on a discussion on lib/tpm2_esys.c: https://gitlab.com/gnutls/gnutls/-/merge_requests/1485#note_733683249

>  
> -int install_tpm2_key(struct tpm2_info_st *info, gnutls_privkey_t pkey,
> -		     unsigned int parent, bool emptyauth,
> -		     gnutls_datum_t *privdata, gnutls_datum_t *pubdata)
> +GNUTLS_ONCE(tcti_once);
> +
> +void
> +tpm2_tcti_deinit(void)
> +{
> +	if (tcti_ctx) {
> +		Tss2_TctiLdr_Finalize(&tcti_ctx);
> +	}
> +}
> +
> +static void
> +tcti_once_init(void)

We could conditionalize it for implicit and explicit initialization, as we [do](https://github.com/p11-glue/p11-kit/blob/master/common/library.h#L73) in p11-kit (though it also indicates that gnutls reinitialization wouldn't work if it is linked with p11-kit).

Considering this and the documentation of `gnutls_global_init` ("This function can be called many times, but will only do something the first time."), I'm learning to stop supporting the reinitialization scenario.

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/-/merge_requests/1485#note_733683249
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/20211115/14dfdfac/attachment-0001.html>


More information about the Gnutls-devel mailing list