all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Glenn Morris <rgm@gnu.org>
Cc: Emacs developers <emacs-devel@gnu.org>,
	Noam Postavsky <npostavs@users.sourceforge.net>
Subject: Re: master 583995c: GnuTLS HMAC and symmetric cipher support
Date: Tue, 18 Jul 2017 00:45:52 -0700	[thread overview]
Message-ID: <22246710-dc3b-f146-1812-cc374a709f0b@cs.ucla.edu> (raw)
In-Reply-To: <niwp76pj7w.fsf@fencepost.gnu.org>

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

Glenn Morris wrote:
> Since 583995c, make check on hydra crashes when loading the gnutls tests.
> It uses gnutls 3.2.21. I installed that on my rhel7 system (with
> --disable-non-suiteb-curves) and reproduced the crash. The

I don't see how the crash can occur with vanilla GnuTLS 3.2.21, as its 
gnutls_cipher_list returns a list of IDs that does not contain 
GNUTLS_CIPHER_UNKNOWN. Perhaps you were using a modified GnuTLS 3.2.21. Or 
possibly I'm misreading the GnuTLS source code, though I don't see how.

As you're observing the problem I installed the attached, which is similar to 
the patch that worked for you.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Port-gnutls.c-to-older-buggier-GnuTLS.patch --]
[-- Type: text/x-patch; name="0001-Port-gnutls.c-to-older-buggier-GnuTLS.patch", Size: 1693 bytes --]

From 376151481b2172dbb08d25bb5946f0f627f7453d Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Tue, 18 Jul 2017 00:37:03 -0700
Subject: [PATCH] Port gnutls.c to older (buggier?) GnuTLS

Problem reported for GnuTLS 3.2.1 by Glenn Morris in:
http://lists.gnu.org/archive/html/emacs-devel/2017-07/msg00716.html
http://lists.gnu.org/archive/html/emacs-devel/2017-07/msg00742.html
Although I don't see how this bug can occur with vanilla GnuTLS 3.2.1,
perhaps hydra was using a modified GnuTLS.
* src/gnutls.c (Fgnutls_ciphers): Don't assume GNUTLS_CIPHER_NULL
is at the end of the list returned by gnutls_cipher_list,
or that the earlier ciphers all have non-null names.
---
 src/gnutls.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/gnutls.c b/src/gnutls.c
index 9fbaea2..e406d66 100644
--- a/src/gnutls.c
+++ b/src/gnutls.c
@@ -1854,12 +1854,17 @@ The alist key is the cipher name. */)
 
 #ifdef HAVE_GNUTLS3_CIPHER
   const gnutls_cipher_algorithm_t *gciphers = gnutls_cipher_list ();
-  for (ptrdiff_t pos = 0; gciphers[pos] != GNUTLS_CIPHER_NULL; pos++)
+  for (ptrdiff_t pos = 0; gciphers[pos] != 0; pos++)
     {
       gnutls_cipher_algorithm_t gca = gciphers[pos];
+      if (gca == GNUTLS_CIPHER_NULL)
+	continue;
+      char const *cipher_name = gnutls_cipher_get_name (gca);
+      if (!cipher_name)
+	continue;
 
       /* A symbol representing the GnuTLS cipher.  */
-      Lisp_Object cipher_symbol = intern (gnutls_cipher_get_name (gca));
+      Lisp_Object cipher_symbol = intern (cipher_name);
 
       ptrdiff_t cipher_tag_size = gnutls_cipher_get_tag_size (gca);
 
-- 
2.7.4


  reply	other threads:[~2017-07-18  7:45 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20170714150706.13106.18905@vcs0.savannah.gnu.org>
     [not found] ` <20170714150707.5E9B322DF8@vcs0.savannah.gnu.org>
2017-07-17  0:05   ` master 583995c: GnuTLS HMAC and symmetric cipher support Glenn Morris
2017-07-17 14:18     ` Ted Zlatanov
2017-07-17 14:30       ` Michael Albinus
2017-07-17 14:50         ` Ted Zlatanov
2017-07-17 18:22           ` Michael Albinus
2017-07-17 17:12       ` Glenn Morris
2017-07-17 17:19         ` Noam Postavsky
2017-07-17 18:20           ` Glenn Morris
2017-07-17 18:45             ` Noam Postavsky
2017-07-17 19:27               ` Glenn Morris
2017-07-17 19:44                 ` Paul Eggert
2017-07-17 21:37                   ` Glenn Morris
2017-07-17 21:58                     ` Paul Eggert
2017-07-17 22:14                       ` Glenn Morris
2017-07-18  0:59                         ` Paul Eggert
2017-07-18  2:33                           ` Glenn Morris
2017-07-18  7:45                             ` Paul Eggert [this message]
2017-07-18 18:44                               ` Glenn Morris
2017-07-18 20:44                                 ` Paul Eggert
2017-07-18 21:02                                   ` Glenn Morris
2017-07-18 21:16                                     ` Paul Eggert
2017-07-18 21:29                                       ` Glenn Morris
2017-07-23 19:18         ` Ted Zlatanov

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=22246710-dc3b-f146-1812-cc374a709f0b@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=emacs-devel@gnu.org \
    --cc=npostavs@users.sourceforge.net \
    --cc=rgm@gnu.org \
    /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.