[PATCH] Server name indication encoding fails if multiple server names are given
Simon Josefsson
simon at josefsson.org
Mon Jan 7 22:15:53 CET 2008
"mark.phillips at virgin.net" <mark.phillips at virgin.net> writes:
> The code in lib/ext_server_name.c _gnutls_server_name_send_params() fails when
> more than one server name is specified (via the gnutls_server_name_set API).
>
> The loop in _gnutls_server_name_send_params uses a hardcoded index of "0"
> (instead of "i") to retrieve the server name which is copied into the
> ClientHello message, this means that the second server name will be incorrect.
>
> The fix is trivial - simply change the [0] to [i] in the following line:-
> memcpy (p,
> session->security_parameters.extensions.
> server_names[0].name, len);
>
> This is line 199 of the latest version of the file - http://
> git.savannah.gnu.org/gitweb/?p=gnutls.git;a=blob;f=lib/ext_server_name.c;hb=
> 0b7c039057a03d3259b296808114adcc2c492f62
Many thanks for a good bug report and suggested patch. I have installed
the patch.
/Simon
> diff -u lib/ext_server_name.c.orig lib/ext_server_name.c
> --- lib/ext_server_name.c.orig 2008-01-07 14:09:56.574035900 +0000
> +++ lib/ext_server_name.c 2008-01-07 14:10:20.106942500 +0000
> @@ -196,7 +196,7 @@
>
> memcpy (p,
> session->security_parameters.extensions.
> - server_names[0].name, len);
> + server_names[i].name, len);
> p += len;
> break;
> default:
>
> _______________________________________________
> Gnutls-devel mailing list
> Gnutls-devel at gnu.org
> http://lists.gnu.org/mailman/listinfo/gnutls-devel
More information about the Gnutls-devel
mailing list