From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: master 583995c: GnuTLS HMAC and symmetric cipher support Date: Tue, 18 Jul 2017 14:16:06 -0700 Organization: UCLA Computer Science Department Message-ID: <826e42eb-7032-62aa-7746-b93fe683f484@cs.ucla.edu> 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> <22246710-dc3b-f146-1812-cc374a709f0b@cs.ucla.edu> <5kzic131co.fsf@fencepost.gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------4A77C9D2B050DE55A9BB2274" X-Trace: blaine.gmane.org 1500412614 14414 195.159.176.226 (18 Jul 2017 21:16:54 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 18 Jul 2017 21:16:54 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 Cc: Emacs developers , Noam Postavsky To: Glenn Morris Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jul 18 23:16:47 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 1dXZrF-00036W-1i for ged-emacs-devel@m.gmane.org; Tue, 18 Jul 2017 23:16:41 +0200 Original-Received: from localhost ([::1]:58650 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXZrK-0007gt-Cw for ged-emacs-devel@m.gmane.org; Tue, 18 Jul 2017 17:16:46 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41717) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXZqo-0007ga-78 for emacs-devel@gnu.org; Tue, 18 Jul 2017 17:16:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dXZqk-0001D3-7m for emacs-devel@gnu.org; Tue, 18 Jul 2017 17:16:14 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:59330) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dXZqj-0001B6-U1; Tue, 18 Jul 2017 17:16:10 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 167EC160183; Tue, 18 Jul 2017 14:16:08 -0700 (PDT) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id Dn92ssLUH11R; Tue, 18 Jul 2017 14:16:07 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 5797C160191; Tue, 18 Jul 2017 14:16:07 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id cJzP8Y3cFV1c; Tue, 18 Jul 2017 14:16:07 -0700 (PDT) Original-Received: from [192.168.1.9] (unknown [47.153.184.153]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 33481160183; Tue, 18 Jul 2017 14:16:07 -0700 (PDT) In-Reply-To: <5kzic131co.fsf@fencepost.gnu.org> Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 131.179.128.68 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:216863 Archived-At: This is a multi-part message in MIME format. --------------4A77C9D2B050DE55A9BB2274 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Glenn Morris wrote: > Your example doesn't correspond to how the code in Emacs used to be. > Change it to: >=20 > for (int pos =3D 0; gciphers[pos] !=3D GNUTLS_CIPHER_NULL; pos++) >=20 > and it fails for me, just as Emacs used to: Weirder and weirder. First, with that change the code still works for me = (I=20 tried it with GnuTLS 3.4.10). Second, if I read the GnuTLS 3.2.21 source = code,=20 the changed code should still work for you too. This is because the test=20 gciphers[pos] !=3D GNUTLS_CIPHER_NULL should succeed one iteration before= the test=20 gciphers[pos] !=3D 0 succeeds. >=20 > gciphers[17] =3D=3D GNUTLS_CIPHER_UNKNOWN ?!? >=20 > As I said, it seems to be a happy accident that GNUTLS_CIPHER_UNKNOWN =3D= =3D 0. > So your example as written happens to skip it. >=20 > I hope we have now established I'm not mad or lying... :) Sorry, not established yet. :-) Quite possibly I'm the crazy one, of cour= se.=20 Still, there's something very odd going on here. To make sure we're on the same page I am attaching the changed code, whic= h still=20 works for me. --------------4A77C9D2B050DE55A9BB2274 Content-Type: text/x-csrc; name="gs1.c" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="gs1.c" #include #include int main (void) { const gnutls_cipher_algorithm_t *gciphers =3D gnutls_cipher_list (); for (int pos =3D 0; gciphers[pos] !=3D GNUTLS_CIPHER_NULL; pos++) { gnutls_cipher_algorithm_t gca =3D gciphers[pos]; if (gca =3D=3D GNUTLS_CIPHER_UNKNOWN) return printf ("gciphers[%d] =3D=3D GNUTLS_CIPHER_UNKNOWN ?!?\n", pos), = 1; } return 0; } --------------4A77C9D2B050DE55A9BB2274--