summaryrefslogtreecommitdiff
path: root/cpp/test/IceSSL/configuration/AllTests.cpp
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2017-03-27 17:44:39 +0200
committerJose <jose@zeroc.com>2017-03-27 17:44:39 +0200
commitb18cce8da2ccb1d541b226450d13663d6f442b1c (patch)
tree81afdb344081362511dc73381df89f5face0713c /cpp/test/IceSSL/configuration/AllTests.cpp
parentPotential fix for IceDiscovery/simple test failure on Windows CI VMs (diff)
downloadice-b18cce8da2ccb1d541b226450d13663d6f442b1c.tar.bz2
ice-b18cce8da2ccb1d541b226450d13663d6f442b1c.tar.xz
ice-b18cce8da2ccb1d541b226450d13663d6f442b1c.zip
Fix (ICE-7708) - Add property to enable Schannel SCH_USE_STRONG_CRYPTO
Diffstat (limited to 'cpp/test/IceSSL/configuration/AllTests.cpp')
-rw-r--r--cpp/test/IceSSL/configuration/AllTests.cpp59
1 files changed, 59 insertions, 0 deletions
diff --git a/cpp/test/IceSSL/configuration/AllTests.cpp b/cpp/test/IceSSL/configuration/AllTests.cpp
index 66eae51e144..b619416eff5 100644
--- a/cpp/test/IceSSL/configuration/AllTests.cpp
+++ b/cpp/test/IceSSL/configuration/AllTests.cpp
@@ -2807,6 +2807,65 @@ allTests(const CommunicatorPtr& communicator, const string& testDir, bool p12)
fact->destroyServer(server);
comm->destroy();
}
+
+ {
+ //
+ // Client and server should negotiate to use RC4 as it is enabled in both.
+ //
+ InitializationData initData;
+ initData.properties = createClientProps(defaultProps, p12, "c_rsa_ca1", "cacert1");
+
+ CommunicatorPtr comm = initialize(initData);
+ Test::ServerFactoryPrxPtr fact = ICE_CHECKED_CAST(Test::ServerFactoryPrx, comm->stringToProxy(factoryRef));
+ test(fact);
+
+ Test::Properties d = createServerProps(defaultProps, p12, "s_rsa_ca1", "cacert1");
+ d["IceSSL.Ciphers"] = "RC4";
+
+ Test::ServerPrxPtr server = fact->createServer(d);
+ try
+ {
+ server->checkCipher("RC4");
+ info = ICE_DYNAMIC_CAST(IceSSL::ConnectionInfo, server->ice_getConnection()->getInfo());
+ test(info->cipher.compare(0, 4, "RC4") == 0);
+ }
+ catch(const LocalException& ex)
+ {
+ cerr << ex << endl;
+ test(false);
+ }
+ fact->destroyServer(server);
+ comm->destroy();
+ }
+
+ {
+ //
+ // Client only enables RC4 weak cypher, server does not allow it when using
+ // IceSSL.SchannelStrongCrypto
+ //
+ InitializationData initData;
+ initData.properties = createClientProps(defaultProps, p12, "c_rsa_ca1", "cacert1");
+ initData.properties->setProperty("IceSSL.SchannelStrongCrypto", "1");
+
+ CommunicatorPtr comm = initialize(initData);
+ Test::ServerFactoryPrxPtr fact = ICE_CHECKED_CAST(Test::ServerFactoryPrx, comm->stringToProxy(factoryRef));
+ test(fact);
+
+ Test::Properties d = createServerProps(defaultProps, p12, "s_rsa_ca1", "cacert1");
+ d["IceSSL.Ciphers"] = "RC4";
+
+ Test::ServerPrxPtr server = fact->createServer(d);
+ try
+ {
+ server->checkCipher("RC4");
+ test(false);
+ }
+ catch(const LocalException&)
+ {
+ }
+ fact->destroyServer(server);
+ comm->destroy();
+ }
# endif
//