[gnutls-devel] GnuTLS | added clientHello extension permutation (!1737)

Read-only notification of GnuTLS library development activities gnutls-devel at lists.gnutls.org
Sat Apr 1 09:29:27 CEST 2023




Daiki Ueno started a new discussion on lib/hello_ext.c: https://gitlab.com/gnutls/gnutls/-/merge_requests/1737#note_1337655752

>  	}
>  
> +	/* To shuffle extension sending order */
> +	extensions_t shuffled_exts[MAX_EXT_TYPES];
> +	ret = shuffle_exts(shuffled_exts, MAX_EXT_TYPES);
> +	if (ret < 0)
> +		return gnutls_assert_val(ret);
> +
> +	/* ordering dumbfw and pre_shared_key as last extensions */
> +	extensions_t temp = shuffled_exts[MAX_EXT_TYPES - 2];
> +	shuffled_exts[MAX_EXT_TYPES - 2] = GNUTLS_EXTENSION_DUMBFW;
> +	shuffled_exts[GNUTLS_EXTENSION_DUMBFW] = temp;
> +
> +	temp = shuffled_exts[MAX_EXT_TYPES - 1];
> +	shuffled_exts[MAX_EXT_TYPES - 1] = GNUTLS_EXTENSION_PRE_SHARED_KEY;
> +	shuffled_exts[GNUTLS_EXTENSION_PRE_SHARED_KEY] = temp;

Now we have 3 places doing element swapping; maybe we could define an inline function for that?

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/-/merge_requests/1737#note_1337655752
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/20230401/f79249b4/attachment-0001.html>


More information about the Gnutls-devel mailing list