[Spice-devel] [PATCH spice-gtk] Empty host subject from qemu should only validate hostname

Christophe Fergeau cfergeau at redhat.com
Fri Oct 19 02:17:43 PDT 2012


On Thu, Oct 18, 2012 at 07:41:35PM +0200, Marc-André Lureau wrote:
> Validate empty host subject from qemu exactly like when no explicit
> host subject is specified.

Looks good, have you tested that it works? I tried to fix it a while ago
as it seemed easy enough, provided a scratch build to the reporter, but
this did not work as expected at all ;)
ACK if this has been tested.

Christophe

> 
> https://bugzilla.redhat.com/show_bug.cgi?id=858228
> ---
>  gtk/channel-main.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/gtk/channel-main.c b/gtk/channel-main.c
> index 21428cf..6b9ba8d 100644
> --- a/gtk/channel-main.c
> +++ b/gtk/channel-main.c
> @@ -1729,6 +1729,10 @@ static gboolean migrate_connect(gpointer data)
>                           "verify", SPICE_SESSION_VERIFY_PUBKEY,
>                           NULL);
>              g_byte_array_unref(pubkey);
> +        } else if (info->cert_subject_size == 0 ||
> +                   strlen((const char*)info->cert_subject_data) == 0) {
> +            /* only verify hostname if no cert subject */
> +            g_object_set(mig->session, "verify", SPICE_SESSION_VERIFY_HOSTNAME, NULL);
>          } else {
>              gchar *subject = g_alloca(info->cert_subject_size + 1);
>              strncpy(subject, (const char*)info->cert_subject_data, info->cert_subject_size);
> -- 
> 1.7.11.7
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20121019/19c1ac3d/attachment.pgp>


More information about the Spice-devel mailing list