all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: Robert Pluim <rpluim@gmail.com>, emacs-devel@gnu.org
Subject: Re: The netsec thread
Date: Fri, 23 Aug 2019 12:03:18 -0700	[thread overview]
Message-ID: <791d5bcb-3684-c791-48f5-c1af765a5c9d@cs.ucla.edu> (raw)
In-Reply-To: <87r25cb6vy.fsf@gnus.org>

[-- Attachment #1: Type: text/plain, Size: 1106 bytes --]

Lars Ingebrigtsen wrote:

> I don't have access to a Fedora system to test on

"make check" works for me on Fedora 30 again; thanks.

> Hm...  Since GnuTLS no longer supports compression at all, I would have
> assumed that on newer OS versions this would be a NOOP.

Yes, the newer GnuTLS implementations are stub functions that are marked 
obsolescent, which causes GCC to warn when you compile code calling them, and if 
--enable-gcc-warnings is used this caused the Emacs build to fail. The fix I 
installed was to call these obsolescent functions only in older GnuTLS versions, 
where they are not obsolescent.

Come to think of it, Emacs shouldn't make the :compression feature visible on 
newer-GnuTLS systems, since the feature is obsolescent and just clutters up the 
runtime and data. So I installed the attached patch, which causes this feature 
(and the :encrypt-then-mac feature) to be exported to the Lisp level only if the 
underlying GnuTLS library supports the feature. This gives a bit more info to 
the Lisp code (if it wants it) and simplifies the data and the low-level code 
slightly.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Tweak-gnutls-peer-status-reporting.patch --]
[-- Type: text/x-patch; name="0001-Tweak-gnutls-peer-status-reporting.patch", Size: 2565 bytes --]

From 80376945952943888bb34c7d4ea06972e422eca7 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Fri, 23 Aug 2019 11:50:40 -0700
Subject: [PATCH] Tweak gnutls-peer-status reporting
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* 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.
---
 lisp/net/nsm.el |  3 ++-
 src/gnutls.c    | 16 +++++++---------
 2 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/lisp/net/nsm.el b/lisp/net/nsm.el
index ed700bc9b5..5e8381075b 100644
--- a/lisp/net/nsm.el
+++ b/lisp/net/nsm.el
@@ -692,7 +692,8 @@ nsm-protocol-check--compression
 Use of Transport Layer Security (TLS) and Datagram Transport Layer
 Security (DTLS)\", `https://tools.ietf.org/html/rfc7525'"
   (let ((compression (plist-get status :compression)))
-    (and (string-match "^\\bDEFLATE\\b" compression)
+    (and compression
+	 (string-match "^\\bDEFLATE\\b" compression)
          (format-message
           "compression method (%s) may lead to leakage of sensitive information"
           compression))))
diff --git a/src/gnutls.c b/src/gnutls.c
index 51536b1463..a7ef59ab91 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
-- 
2.17.1


  parent reply	other threads:[~2019-08-23 19:03 UTC|newest]

Thread overview: 104+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-20 11:33 The netsec thread Lars Ingebrigtsen
2018-07-20 12:24 ` Eli Zaretskii
2018-07-20 12:33   ` Lars Ingebrigtsen
2018-07-20 12:36     ` Lars Ingebrigtsen
2018-07-20 12:41     ` Eli Zaretskii
2018-07-20 12:45       ` Lars Ingebrigtsen
2018-07-23  1:52         ` Jimmy Yuen Ho Wong
2018-07-23  1:55           ` Brett Gilio
2018-07-23  2:32           ` Eli Zaretskii
2018-07-23 12:46             ` Lars Ingebrigtsen
2018-07-23 13:31               ` Andy Moreton
2018-07-23 14:43                 ` Jimmy Yuen Ho Wong
2018-07-23 14:46                   ` Andy Moreton
2018-07-23 15:48                     ` Lars Ingebrigtsen
2018-07-23 16:54                       ` Andy Moreton
2018-07-23 19:34                         ` Andy Moreton
2018-07-24  8:24                           ` Lars Ingebrigtsen
2018-07-24  9:34                             ` Andy Moreton
2018-07-24 11:54                               ` Andy Moreton
2018-07-24 12:09                                 ` Noam Postavsky
2018-07-24 13:59                                   ` Jimmy Yuen Ho Wong
2018-07-24 14:11                                     ` Lars Ingebrigtsen
2018-07-24 18:21                                     ` Andy Moreton
2019-07-28 18:18                                     ` Lars Ingebrigtsen
2019-07-28 18:27                                       ` Eli Zaretskii
2019-07-28 18:33                                         ` Lars Ingebrigtsen
2019-07-28 18:34                                         ` Lars Ingebrigtsen
2019-07-28 19:08                                         ` Lars Ingebrigtsen
2019-07-28 19:12                                           ` Eli Zaretskii
2019-07-29 11:12                                             ` Lars Ingebrigtsen
2019-07-29  7:50                                           ` Robert Pluim
2019-07-29  8:11                                             ` Robert Pluim
2019-07-29 11:18                                               ` Lars Ingebrigtsen
2019-07-29 11:14                                             ` Lars Ingebrigtsen
2019-07-29 14:02                                               ` Robert Pluim
2019-07-30 11:30                                                 ` Lars Ingebrigtsen
2019-07-30 13:12                                                   ` Robert Pluim
2019-07-30 13:32                                                     ` Lars Ingebrigtsen
2019-07-30 15:05                                                       ` Robert Pluim
2019-08-07 12:27                                                         ` Robert Pluim
2019-08-07 18:41                                                           ` Lars Ingebrigtsen
2019-08-23  2:58                                                             ` Lars Ingebrigtsen
2019-08-23  8:19                                                               ` Paul Eggert
2019-08-23  8:52                                                                 ` Lars Ingebrigtsen
2019-08-23  9:01                                                                   ` Lars Ingebrigtsen
2019-08-23 19:03                                                                   ` Paul Eggert [this message]
2019-08-25  5:33                                                                     ` Lars Ingebrigtsen
2019-09-03  9:49                                                                       ` Robert Pluim
2019-09-03 13:30                                                                         ` Paul Eggert
2019-09-03 15:37                                                                           ` Robert Pluim
2019-09-03 19:20                                                                             ` Paul Eggert
2019-09-03 20:02                                                                               ` Robert Pluim
2019-09-04 13:12                                                                                 ` Lars Ingebrigtsen
2019-09-04 19:34                                                                                   ` Robert Pluim
2019-09-04 21:35                                                                                     ` Paul Eggert
2019-09-04 21:54                                                                                       ` Robert Pluim
2019-09-05 12:12                                                                                         ` Robert Pluim
2019-09-05 18:50                                                                                           ` Paul Eggert
2019-09-05 19:34                                                                                             ` Robert Pluim
2019-09-04 13:10                                                                               ` Lars Ingebrigtsen
2019-08-23  9:09                                                               ` Eli Zaretskii
2019-08-23  9:40                                                                 ` Robert Pluim
2019-08-23 12:18                                                                   ` Eli Zaretskii
2019-08-23 12:39                                                                     ` Robert Pluim
2019-08-23 13:03                                                                       ` Eli Zaretskii
2019-08-23 13:20                                                                         ` Robert Pluim
2019-08-23 14:15                                                                           ` Eli Zaretskii
2019-08-23 14:27                                                                             ` Robert Pluim
2019-08-23 14:40                                                                               ` Eli Zaretskii
2019-08-23 14:58                                                                                 ` Robert Pluim
2019-08-23 15:04                                                                                   ` Eli Zaretskii
2019-08-23  9:58                                                                 ` Lars Ingebrigtsen
2019-08-23 12:43                                                                   ` Eli Zaretskii
2019-08-25  5:32                                                                     ` Lars Ingebrigtsen
2019-08-25 22:29                                                                       ` Richard Stallman
2019-08-26  4:16                                                                         ` Lars Ingebrigtsen
2018-07-23 15:22               ` Eli Zaretskii
2018-07-22 14:48     ` Lars Ingebrigtsen
2018-07-23  0:12       ` Jimmy Yuen Ho Wong
2018-07-23  8:17         ` Robert Pluim
2018-07-23 14:58           ` Jimmy Yuen Ho Wong
2018-07-23 15:06             ` Robert Pluim
2018-07-23 15:37             ` Lars Ingebrigtsen
2018-07-23 15:51               ` Jimmy Yuen Ho Wong
2018-07-23 16:06                 ` Noam Postavsky
2018-07-23 16:11                   ` Lars Ingebrigtsen
2018-07-23 15:04           ` Eli Zaretskii
2018-07-23 15:24             ` Jimmy Yuen Ho Wong
2018-07-23 15:34               ` Robert Pluim
2018-07-23 16:38                 ` Jimmy Yuen Ho Wong
2018-07-23 17:25                   ` Robert Pluim
2018-07-23 17:54                     ` Eli Zaretskii
2018-07-23 20:51                       ` Robert Pluim
2018-07-23  9:55         ` Lars Ingebrigtsen
2018-07-23 15:22           ` Jimmy Yuen Ho Wong
2018-07-23 15:46             ` Lars Ingebrigtsen
2018-07-23 15:48               ` Jimmy Yuen Ho Wong
2018-07-23 15:49               ` Noam Postavsky
2018-07-23 16:13                 ` Lars Ingebrigtsen
2018-07-23 10:23         ` Andreas Schwab
2018-07-20 12:55 ` Jimmy Yuen Ho Wong
2018-07-20 12:59   ` Jimmy Yuen Ho Wong
2018-07-20 13:00   ` Lars Ingebrigtsen
2018-07-20 13:11     ` Jimmy Yuen Ho Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=791d5bcb-3684-c791-48f5-c1af765a5c9d@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=emacs-devel@gnu.org \
    --cc=larsi@gnus.org \
    --cc=rpluim@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.