spice-gtk/0019-Empty-host-subject-from-qemu-should-only-validate-ho.patch
2012-10-25 18:11:18 +02:00

33 lines
1.3 KiB
Diff

From f2da5d094a111f8562dfd6081ec163bc643c1fae Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@redhat.com>
Date: Thu, 18 Oct 2012 19:40:38 +0200
Subject: [PATCH 19/21] Empty host subject from qemu should only validate
hostname
Validate empty host subject from qemu exactly like when no explicit
host subject is specified.
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.12.1