From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Glenn Morris Newsgroups: gmane.emacs.devel Subject: Re: master 583995c: GnuTLS HMAC and symmetric cipher support Date: Mon, 17 Jul 2017 22:33:23 -0400 Message-ID: References: <20170714150706.13106.18905@vcs0.savannah.gnu.org> <20170714150707.5E9B322DF8@vcs0.savannah.gnu.org> <87eftfdu5g.fsf@lifelogs.com> <7kzic356o4.fsf@fencepost.gnu.org> <34d18yexh0.fsf@fencepost.gnu.org> <2ztw2auan0.fsf@fencepost.gnu.org> <3f44fabe-80b7-8a01-2b64-0a33b2a311b3@cs.ucla.edu> <02lgnm1zjh.fsf@fencepost.gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1500345277 12105 195.159.176.226 (18 Jul 2017 02:34:37 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 18 Jul 2017 02:34:37 +0000 (UTC) User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) Cc: Emacs developers , Noam Postavsky To: Paul Eggert Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jul 18 04:34:29 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dXIL7-0002Iq-LF for ged-emacs-devel@m.gmane.org; Tue, 18 Jul 2017 04:34:22 +0200 Original-Received: from localhost ([::1]:53507 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXILD-0006aq-54 for ged-emacs-devel@m.gmane.org; Mon, 17 Jul 2017 22:34:27 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56611) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXIKT-0006aa-DZ for emacs-devel@gnu.org; Mon, 17 Jul 2017 22:33:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dXIKS-00078z-CV for emacs-devel@gnu.org; Mon, 17 Jul 2017 22:33:41 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:44368) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXIKB-00072U-Sf; Mon, 17 Jul 2017 22:33:23 -0400 Original-Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1dXIKB-00084i-9N; Mon, 17 Jul 2017 22:33:23 -0400 X-Spook: Craig Livingstone Tsunami Eco terrorism David John Oates X-Ran: [?UGAHMN1l4%Cm)D6\wt~U=i,_OKb~n@'3u:yI2:tAFmgU2Z: (Paul Eggert's message of "Mon, 17 Jul 2017 17:59:10 -0700") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:216812 Archived-At: Paul Eggert wrote: > looks only at GnuTLS cipher IDs returned by gnutls_cipher_list, and > GNUTLS_CIPHER_UNKNOWN is not one of those cipher IDs. I feel like you've missed the first half of the discussion, so I'll summarize it: 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 backtrace is at http://lists.gnu.org/archive/html/emacs-devel/2017-07/msg00716.html . Specifically, I find it crashes because gnutls_cipher_list returns a list containing GNUTLS_CIPHER_UNKNOWN. The following patch fixes it for me: *** /tmp/uOhC3f_gnutls.c 2017-07-17 19:32:32.851361998 -0700 --- src/gnutls.c 2017-07-17 12:03:27.514906186 -0700 *************** *** 1857,1870 **** for (ptrdiff_t pos = 0; gciphers[pos] != GNUTLS_CIPHER_NULL; pos++) { gnutls_cipher_algorithm_t gca = gciphers[pos]; /* A symbol representing the GnuTLS cipher. */ ! Lisp_Object cipher_symbol = intern (gnutls_cipher_get_name (gca)); ! ptrdiff_t cipher_tag_size = gnutls_cipher_get_tag_size (gca); ! Lisp_Object cp ! = listn (CONSTYPE_HEAP, 15, cipher_symbol, QCcipher_id, make_number (gca), QCtype, Qgnutls_type_cipher, QCcipher_aead_capable, cipher_tag_size == 0 ? Qnil : Qt, --- 1857,1877 ---- for (ptrdiff_t pos = 0; gciphers[pos] != GNUTLS_CIPHER_NULL; pos++) { gnutls_cipher_algorithm_t gca = gciphers[pos]; + const char *cipher_name; + Lisp_Object cipher_symbol, cp; + ptrdiff_t cipher_tag_size; + + cipher_name = gnutls_cipher_get_name (gca); + + if (! cipher_name) + continue; /* A symbol representing the GnuTLS cipher. */ ! cipher_symbol = intern (cipher_name); ! cipher_tag_size = gnutls_cipher_get_tag_size (gca); ! cp = listn (CONSTYPE_HEAP, 15, cipher_symbol, QCcipher_id, make_number (gca), QCtype, Qgnutls_type_cipher, QCcipher_aead_capable, cipher_tag_size == 0 ? Qnil : Qt,