diff options
author | Yonit Halperin <yhalperi@redhat.com> | 2011-09-18 21:21:00 +0300 |
---|---|---|
committer | Yonit Halperin <yhalperi@redhat.com> | 2011-09-26 12:17:58 +0300 |
commit | 31ed2519a752b7332ed40d0d7ab02e938c0e65cb (patch) | |
tree | 7812af931012e7ab2ccd9cc6c95b099e274464e1 | |
parent | 59e55605cc0e0cef924a57a14325c3ca9fe2e110 (diff) | |
download | spice-31ed2519a752b7332ed40d0d7ab02e938c0e65cb.tar.gz spice-31ed2519a752b7332ed40d0d7ab02e938c0e65cb.tar.xz spice-31ed2519a752b7332ed40d0d7ab02e938c0e65cb.zip |
client: handle SpiceMsgMainMigrationBegin for 0.8.2
RHBZ 725009, 738270
-rw-r--r-- | client/red_client.cpp | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/client/red_client.cpp b/client/red_client.cpp index d7a3e6a2..f09e3c93 100644 --- a/client/red_client.cpp +++ b/client/red_client.cpp @@ -257,9 +257,15 @@ void* Migrate::worker_main(void *data) void Migrate::start(const SpiceMsgMainMigrationBegin* migrate) { + std::string cert_subject; + uint32_t peer_major; + uint32_t peer_minor; + DBG(0, ""); abort(); - if ((_client.get_peer_major() == 1) && (_client.get_peer_minor() < 1)) { + peer_major = _client.get_peer_major(); + peer_minor = _client.get_peer_minor(); + if ((peer_major == 1) && (peer_minor < 1)) { LOG_INFO("server minor version incompatible for destination authentication" "(missing dest pubkey in SpiceMsgMainMigrationBegin)"); OldRedMigrationBegin* old_migrate = (OldRedMigrationBegin*)migrate; @@ -271,8 +277,17 @@ void Migrate::start(const SpiceMsgMainMigrationBegin* migrate) _host.assign((char *)migrate->host_data); _port = migrate->port ? migrate->port : -1; _sport = migrate->sport ? migrate->sport : -1; - _auth_options.type_flags = RedPeer::HostAuthOptions::HOST_AUTH_OP_PUBKEY; - _auth_options.host_pubkey.assign(migrate->pub_key_data, migrate->pub_key_data + migrate->pub_key_size); + if ((peer_major == 1) || (peer_major == 2 && peer_minor < 1)) { + _auth_options.type_flags = RedPeer::HostAuthOptions::HOST_AUTH_OP_PUBKEY; + _auth_options.host_pubkey.assign(migrate->pub_key_data, migrate->pub_key_data + + migrate->pub_key_size); + } else { + _auth_options.type_flags = RedPeer::HostAuthOptions::HOST_AUTH_OP_SUBJECT; + _auth_options.CA_file = _client.get_host_auth_options().CA_file; + if (migrate->cert_subject_size != 0) { + _auth_options.set_cert_subject((char *)migrate->cert_subject_data); + } + } } _con_ciphers = _client.get_connection_ciphers(); |