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

Christophe Fergeau cfergeau at redhat.com
Thu Feb 21 13:50:43 UTC 2019


On Wed, Feb 20, 2019 at 05:57:30PM +0000, Frediano Ziglio wrote:
> 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.

Acked-by: Christophe Fergeau <cfergeau at redhat.com>

This begs the question of what to do with the rest of the VERIFY_PUBKEY
code paths. Maybe they are used without migration, but my guess would be
that they aren't. It's probably enough to check when was the last time
ovirt used that, if ever.

Christophe

> 
> 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
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20190221/e4ba24ca/attachment.sig>


More information about the Spice-devel mailing list