summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@redhat.com>2012-04-03 15:58:45 +0200
committerChristophe Fergeau <cfergeau@redhat.com>2012-04-04 09:52:33 +0200
commitebdc7f6f5a357c36cc86cb474fb72ae628fa38d6 (patch)
treef55adee2358a03eac167407152ec2fe813b08d59
parent841606361937df552f4e130fccd2420fa71f0dda (diff)
Move secure channel fixup to secure channel setter
The secure channel names need to be fixed for compatibility with older spice versions. However, it's better to do it directly when m_secure_channels is set rather than waiting until its first use
-rw-r--r--SpiceXPI/src/plugin/plugin.cpp29
1 files changed, 14 insertions, 15 deletions
diff --git a/SpiceXPI/src/plugin/plugin.cpp b/SpiceXPI/src/plugin/plugin.cpp
index 1f42214..8ba0ba6 100644
--- a/SpiceXPI/src/plugin/plugin.cpp
+++ b/SpiceXPI/src/plugin/plugin.cpp
@@ -328,6 +328,20 @@ char *nsPluginInstance::GetSSLChannels() const
void nsPluginInstance::SetSSLChannels(const char *aSSLChannels)
{
m_ssl_channels = aSSLChannels;
+
+ /*
+ * HACK -- remove leading s from m_SSLChannels, e.g. "main" not "smain"
+ * RHEL5 uses 'smain' and 'sinpusts
+ * RHEL6 uses 'main' and 'inputs'
+ */
+ std::size_t found = 0;
+ while ((found = m_ssl_channels.find("smain", found)) != std::string::npos)
+ m_ssl_channels.replace(found, 5, "main");
+
+ found = 0;
+ while ((found = m_ssl_channels.find("sinputs", found)) != std::string::npos)
+ m_ssl_channels.replace(found, 7, "inputs");
+ /* HACK */
}
//* attribute string TrustStore; */
@@ -682,21 +696,6 @@ void nsPluginInstance::Connect()
SendBool(CONTROLLER_SEND_CAD, m_send_ctrlaltdel);
SendBool(CONTROLLER_ENABLE_USB_AUTOSHARE, m_usb_auto_share);
SendStr(CONTROLLER_USB_FILTER, m_usb_filter.c_str());
-
- /*
- * HACK -- remove leading s from m_SSLChannels, e.g. "main" not "smain"
- * RHEL5 uses 'smain' and 'sinpusts
- * RHEL6 uses 'main' and 'inputs'
- */
- std::size_t found = 0;
- while ((found = m_ssl_channels.find("smain", found)) != std::string::npos)
- m_ssl_channels.replace(found, 5, "main");
-
- found = 0;
- while ((found = m_ssl_channels.find("sinputs", found)) != std::string::npos)
- m_ssl_channels.replace(found, 7, "inputs");
- /* HACK */
-
SendStr(CONTROLLER_SECURE_CHANNELS, m_ssl_channels.c_str());
SendStr(CONTROLLER_CA_FILE, m_trust_store_file.c_str());
SendStr(CONTROLLER_HOST_SUBJECT, m_host_subject.c_str());