[Spice-devel] [PATCH spice-gtk] channel-main: Do not use not present protocol fields

Frediano Ziglio fziglio at redhat.com
Wed Feb 20 17:57:30 UTC 2019


Commit 9cf6d39b369f9c22615fc329e307126721125ecd ("server,proto:
tell the clients to connect to the migration target before migraton
starts", dated 18th September 2011) removed these fields.
Avoid to use them. If nobody complained in more than 7 years
it means this path of the code is not used.

Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
 src/channel-main.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/src/channel-main.c b/src/channel-main.c
index f8be9ff8..6274b594 100644
--- a/src/channel-main.c
+++ b/src/channel-main.c
@@ -2301,16 +2301,7 @@ static gboolean migrate_connect(gpointer data)
     sport = info->sport;
     host = (char*)info->host_data;
 
-    if (c->peer_hdr.major_version == 2 && c->peer_hdr.minor_version < 1) {
-        GByteArray *pubkey = g_byte_array_new();
-
-        g_byte_array_append(pubkey, info->pub_key_data, info->pub_key_size);
-        g_object_set(mig->session,
-                     "pubkey", pubkey,
-                     "verify", SPICE_SESSION_VERIFY_PUBKEY,
-                     NULL);
-        g_byte_array_unref(pubkey);
-    } else if (info->cert_subject_size == 0 ||
+    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);
-- 
2.20.1



More information about the Spice-devel mailing list