summaryrefslogtreecommitdiff
path: root/src/gnutls.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2019-08-23 11:50:40 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2019-08-23 11:52:03 -0700
commit80376945952943888bb34c7d4ea06972e422eca7 (patch)
tree1fab93d6937a12c331c4675b57a074981d4c081c /src/gnutls.c
parentc5210fd00af7c3e261a52864e799e16ed6a1b165 (diff)
downloademacs-80376945952943888bb34c7d4ea06972e422eca7.tar.gz
Tweak gnutls-peer-status reporting
* src/gnutls.c (Fgnutls_peer_status): Report :compression and :encrypt-then-mac only if the underlying GnuTLS library has the corresponding features. This give the Elisp caller a bit more information about the peer status. * lisp/net/nsm.el (nsm-protocol-check--compression): Don’t worry about compression in newer GnuTLS versions that do not support compression.
Diffstat (limited to 'src/gnutls.c')
-rw-r--r--src/gnutls.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/gnutls.c b/src/gnutls.c
index 51536b14632..a7ef59ab919 100644
--- a/src/gnutls.c
+++ b/src/gnutls.c
@@ -1493,20 +1493,18 @@ returned as the :certificate entry. */)
/* Compression name. */
#ifdef HAVE_GNUTLS_COMPRESSION_GET
- Lisp_Object compression = build_string (gnutls_compression_get_name
- (gnutls_compression_get (state)));
-#else
- Lisp_Object compression = build_string ("NULL");
+ result = nconc2
+ (result, list2 (intern (":compression"),
+ build_string (gnutls_compression_get_name
+ (gnutls_compression_get (state)))));
#endif
- result = nconc2 (result, list2 (intern (":compression"), compression));
/* Encrypt-then-MAC. */
- Lisp_Object etm_status = Qnil;
#ifdef HAVE_GNUTLS_ETM_STATUS
- if (gnutls_session_etm_status (state))
- etm_status = Qt;
+ result = nconc2
+ (result, list2 (intern (":encrypt-then-mac"),
+ gnutls_session_etm_status (state) ? Qt : Qnil));
#endif
- result = nconc2 (result, list2 (intern (":encrypt-then-mac"), etm_status));
/* Renegotiation Indication */
result = nconc2