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 17:37:51 -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> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1500327519 29362 195.159.176.226 (17 Jul 2017 21:38:39 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 17 Jul 2017 21:38:39 +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 Mon Jul 17 23:38:35 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 1dXDit-0007P3-0b for ged-emacs-devel@m.gmane.org; Mon, 17 Jul 2017 23:38:35 +0200 Original-Received: from localhost ([::1]:52687 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXDiy-00065Z-My for ged-emacs-devel@m.gmane.org; Mon, 17 Jul 2017 17:38:40 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40683) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXDiM-00065E-G4 for emacs-devel@gnu.org; Mon, 17 Jul 2017 17:38:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dXDiL-00039b-Kw for emacs-devel@gnu.org; Mon, 17 Jul 2017 17:38:02 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:40839) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXDiB-0002wk-SM; Mon, 17 Jul 2017 17:37:51 -0400 Original-Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1dXDiB-0002WR-Eq; Mon, 17 Jul 2017 17:37:51 -0400 X-Spook: cypherpunk Antiviral nuclear Riot Federal Emergency X-Ran: ab6HnBXi@tp2sPfPJDS'&'UvPZ1J~]&X.t@q*?MFd+74v29RE?P'T^C*w[HDj_Q!duc'\U X-Hue: white X-Attribution: GM In-Reply-To: (Paul Eggert's message of "Mon, 17 Jul 2017 12:44:09 -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:216804 Archived-At: Paul Eggert wrote: >> gnutls_mac_get_name and gnutls_digest_get_name can >> also apparently return NULL > > As I recall, they can't return NULL in the contexts where they're > used, as a previous call already established the validities of their > arguments. It's not obvious to me that 2 and 3 below are any different to 1, save for the fact that GNUTLS_CIPHER_NULL == 1 (and GNUTLS_CIPHER_UNKNOWN == 0, which is maybe what happens to stop 2 and 3 crashing in the same way 1 does. Seems a bit like a happy accident?): 1. Fgnutls_ciphers. Can intern NULL and crash. const gnutls_cipher_algorithm_t *gciphers = gnutls_cipher_list (); for (ptrdiff_t pos = 0; gciphers[pos] != GNUTLS_CIPHER_NULL; pos++) { gnutls_cipher_algorithm_t gca = gciphers[pos]; Lisp_Object cipher_symbol = intern (gnutls_cipher_get_name (gca)); ... } 2. Fgnutls_macs. const gnutls_mac_algorithm_t *macs = gnutls_mac_list (); for (ptrdiff_t pos = 0; macs[pos] != 0; pos++) { const gnutls_mac_algorithm_t gma = macs[pos]; Lisp_Object gma_symbol = intern (gnutls_mac_get_name (gma)); ... } 3. Fgnutls_digests. const gnutls_digest_algorithm_t *digests = gnutls_digest_list (); for (ptrdiff_t pos = 0; digests[pos] != 0; pos++) { const gnutls_digest_algorithm_t gda = digests[pos]; Lisp_Object gda_symbol = intern (gnutls_digest_get_name (gda)); ... }