From 21a212f9e256a05a0fc67260d338d612cba77266 Mon Sep 17 00:00:00 2001 From: Ted Zlatanov Date: Tue, 19 Dec 2017 12:43:56 -0500 Subject: Collect GnuTLS extensions and use them to set %DUMBFW if supported * lisp/net/gnutls.el (gnutls-boot-parameters): Use it to set %DUMBFW only when it's supported as "ClientHello Padding" (Bug#25061). * src/gnutls.c (Fgnutls_available_p): Get extension names and put them in the GnuTLS capabilities, using a hard-coded limit of 100 since GnuTLS MAX_EXT_TYPES is not exported. --- src/gnutls.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gnutls.c b/src/gnutls.c index 4622011bc10..8db201ae834 100644 --- a/src/gnutls.c +++ b/src/gnutls.c @@ -2415,7 +2415,10 @@ GnuTLS 3 or higher : the list will contain `gnutls3'. GnuTLS MACs : the list will contain `macs'. GnuTLS digests : the list will contain `digests'. GnuTLS symmetric ciphers: the list will contain `ciphers'. -GnuTLS AEAD ciphers : the list will contain `AEAD-ciphers'. */) +GnuTLS AEAD ciphers : the list will contain `AEAD-ciphers'. +%DUMBFW : the list will contain `ClientHello\ Padding'. +Any GnuTLS extension with ID up to 100 + : the list will contain its name. */) (void) { Lisp_Object capabilities = Qnil; @@ -2436,6 +2439,15 @@ GnuTLS AEAD ciphers : the list will contain `AEAD-ciphers'. */) capabilities = Fcons (intern("macs"), capabilities); # endif /* HAVE_GNUTLS3 */ + for (unsigned int ext=0; ext < 100; ext++) + { + const char* name = gnutls_ext_get_name(ext); + if (name != NULL) + { + capabilities = Fcons (intern(name), capabilities); + } + } + # ifdef WINDOWSNT Lisp_Object found = Fassq (Qgnutls, Vlibrary_cache); if (CONSP (found)) -- cgit v1.2.1