Consider adding a custom libgnutls version which exports a few missing fucntions for DH & ECDH support
There is a Gnutls issue on the matter open for a while now: https://gitlab.com/gnutls/gnutls/-/issues/894
We want to implement DH & ECDH secret agreement support in Proton / Wine. This is needed to support online mode in a number of games, e. g., Red Dead Redemption 2. Gnutls is extensively used by various Wine libraries as cryptographic backend, so it would be very inconvenient to pull some other library for this only purpose, given Gnutls has everything inside it and just misses a bit of exported API to make this usable for applications.
Gnutls already exports a number of functions for DH & ECDH key management (importing, exporting and parameters generation). The few missing (which are available internally in Gnutls for FIPS support) are: gnutls_dh_compute_key gnutls_dh_generate_key gnutls_ecdh_compute_key gnutls_ecdh_generate_key
These functions are actually exported for internal testing purposes with underscore prefix if the library is configured with --enable-fips140-mode. I am attaching a PoC patch which exports those functions (the one I am testing the Wine implementation with).