[gnutls-devel] GnuTLS | doc: mention ClientHello extensions shuffling (!1738)

Read-only notification of GnuTLS library development activities gnutls-devel at lists.gnutls.org
Fri Apr 14 01:28:13 CEST 2023




Daiki Ueno commented on a discussion on lib/hello_ext.c: https://gitlab.com/gnutls/gnutls/-/merge_requests/1738#note_1352287369

>  	/* Initializing extensions array */
>  	for (i = 0; i < MAX_EXT_TYPES; i++) {
> -		shuffled_exts[i] = i;
> +		indices[i] = i;
>  	}
>  
> -	/* ordering dumbfw and pre_shared_key as last extensions */
> -	swap_exts(&shuffled_exts[MAX_EXT_TYPES - 2],
> -		  &shuffled_exts[GNUTLS_EXTENSION_DUMBFW]);
> -	swap_exts(&shuffled_exts[MAX_EXT_TYPES - 1],
> -		  &shuffled_exts[GNUTLS_EXTENSION_PRE_SHARED_KEY]);
> -
> -	if (session->internals.priorities->no_exts_shuffle == 1)
> -		goto next;
> +	if (!session->internals.priorities->no_shuffle_extensions) {
> +		/* Ordering padding and pre_shared_key as last extensions */

It needs to be done that way, because the extension array is supposed to be sparse so user-defined extensions can be inserted with `gnutls_ext_register`.

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/-/merge_requests/1738#note_1352287369
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/20230413/61e06fa2/attachment.html>


More information about the Gnutls-devel mailing list