From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Florian Weimer Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] gnutls: Add SNI support Date: Mon, 24 Nov 2014 21:56:25 +0100 Message-ID: <87k32kz5ae.fsf@mid.deneb.enyo.de> References: <87wq6k3i99.fsf@toke.dk> <87oarwhjem.fsf@zigzag.favinet> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1416862621 18791 80.91.229.3 (24 Nov 2014 20:57:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 24 Nov 2014 20:57:01 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 24 21:56:54 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Xt0go-0001As-AU for ged-emacs-devel@m.gmane.org; Mon, 24 Nov 2014 21:56:54 +0100 Original-Received: from localhost ([::1]:54495 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xt0gn-00071M-QD for ged-emacs-devel@m.gmane.org; Mon, 24 Nov 2014 15:56:53 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57408) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xt0gV-00070L-1P for emacs-devel@gnu.org; Mon, 24 Nov 2014 15:56:41 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xt0gO-0008QQ-Sd for emacs-devel@gnu.org; Mon, 24 Nov 2014 15:56:34 -0500 Original-Received: from albireo.enyo.de ([46.237.207.196]:51255) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xt0gO-0008QK-Bu for emacs-devel@gnu.org; Mon, 24 Nov 2014 15:56:28 -0500 Original-Received: from [172.17.203.2] (helo=deneb.enyo.de) by albireo.enyo.de with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) id 1Xt0gL-00082a-Tc for emacs-devel@gnu.org; Mon, 24 Nov 2014 21:56:25 +0100 Original-Received: from fw by deneb.enyo.de with local (Exim 4.80) (envelope-from ) id 1Xt0gL-0001Jh-Ld for emacs-devel@gnu.org; Mon, 24 Nov 2014 21:56:25 +0100 In-Reply-To: <87oarwhjem.fsf@zigzag.favinet> (Thien-Thi Nguyen's message of "Mon, 24 Nov 2014 13:28:49 +0100") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 46.237.207.196 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:178208 Archived-At: * Thien-Thi Nguyen: > + /* Quick and dirty test of the hostname; shouldn't be an IP. If it > + contains letters, we assume it's a hostname, unless it contains a > + : in which case we assume it's a literal IPv6 address. */ > + for(c =3D c_hostname; c; c++) { > + if(c >=3D 'a') send_hostname =3D 1; > + if(c =3D=3D ':') {send_hostname =3D 0; break;} > + } > > Aside from the whitespace and brace placement, this code is buggy: =E2=80= =98c=E2=80=99 > is of type =E2=80=98char *=E2=80=99 and cannot be meaningfully compared d= irectly to 'a'. And what about uppercase names? Or domain names which do not contain letters? (I think to be absolutely correct, you need to track the kind of name resolution you have performed on the name.)