[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] gnutls: Add SNI support
From: |
Thien-Thi Nguyen |
Subject: |
Re: [PATCH] gnutls: Add SNI support |
Date: |
Mon, 24 Nov 2014 13:28:49 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
() Toke Høiland-Jørgensen <address@hidden>
() Mon, 24 Nov 2014 13:17:22 +0100
+ char *c; bool send_hostname = 0;
/* Placeholders for the property list elements. */
Lisp_Object priority_string;
@@ -1375,6 +1381,22 @@ one trustfile (usually a CA bundle). */)
if (ret < GNUTLS_E_SUCCESS)
return gnutls_make_error (ret);
+ /* 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 = c_hostname; c; c++) {
+ if(c >= 'a') send_hostname = 1;
+ if(c == ':') {send_hostname = 0; break;}
+ }
Aside from the whitespace and brace placement, this code is buggy: ‘c’
is of type ‘char *’ and cannot be meaningfully compared directly to 'a'.
--
Thien-Thi Nguyen
GPG key: 4C807502
(if you're human and you know it)
read my lisp: (responsep (questions 'technical)
(not (via 'mailing-list)))
=> nil
signature.asc
Description: PGP signature