[gnutls-devel] GnuTLS | Certificate type handling improvements (!1394)

Read-only notification of GnuTLS library development activities gnutls-devel at lists.gnutls.org
Fri Feb 26 16:04:44 CET 2021




Tom commented on a discussion on lib/ext/server_cert_type.c: https://gitlab.com/gnutls/gnutls/-/merge_requests/1394#note_518150268

>  						gnutls_buffer_st* data)
>  {
>  	int ret;
> -	uint8_t cert_type; // Holds an IANA cert type ID
> +	uint8_t cert_type_IANA; // Holds an IANA cert type ID
> +	uint8_t cert_types[GNUTLS_CRT_MAX]; // The list with supported (IANA) cert types. Inv: 0 <= cert type Id < 256
>  	uint8_t i = 0, num_cert_types = 0;
>  	priority_st* cert_priorities;
>  	gnutls_datum_t tmp_cert_types; // For type conversion

What is your rationale for this? Memory efficiency? Scoping? I thought that all local variables are allocated on the stack regardless of where they are defined? The reason that I put all declarations at the top is readability, i.e., one place where all the variables are defined. Can you elaborate on your desire to move some of the declarations?

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/-/merge_requests/1394#note_518150268
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/20210226/107e840a/attachment-0001.html>


More information about the Gnutls-devel mailing list