diff options
author | Jose <jose@zeroc.com> | 2017-04-11 17:34:09 +0200 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2017-04-11 17:34:09 +0200 |
commit | 34bd2e640a9d7024a574158f96e66bc3b5ac0ea3 (patch) | |
tree | b5abea216dcdf7663d13566fe848170961d35dd9 | |
parent | UWP test projects updates to support VS 2017 (diff) | |
download | ice-34bd2e640a9d7024a574158f96e66bc3b5ac0ea3.tar.bz2 ice-34bd2e640a9d7024a574158f96e66bc3b5ac0ea3.tar.xz ice-34bd2e640a9d7024a574158f96e66bc3b5ac0ea3.zip |
Rename getEngineVersion -> getOpenSSLVersion, remove getEngineName
-rw-r--r-- | CHANGELOG-3.7.md | 4 | ||||
-rw-r--r-- | cpp/include/IceSSL/OpenSSL.h | 5 | ||||
-rw-r--r-- | cpp/include/IceSSL/Plugin.h | 3 | ||||
-rw-r--r-- | cpp/src/IceSSL/OpenSSLPluginI.cpp | 13 | ||||
-rw-r--r-- | cpp/src/IceSSL/SChannelPluginI.cpp | 14 | ||||
-rw-r--r-- | cpp/src/IceSSL/SecureTransportPluginI.cpp | 14 | ||||
-rw-r--r-- | cpp/test/IceSSL/configuration/AllTests.cpp | 22 |
7 files changed, 18 insertions, 57 deletions
diff --git a/CHANGELOG-3.7.md b/CHANGELOG-3.7.md index dc9e3b61d59..62b307f87eb 100644 --- a/CHANGELOG-3.7.md +++ b/CHANGELOG-3.7.md @@ -272,8 +272,8 @@ These are the changes since the Ice 3.6 release or snapshot described in - Upgrade the UWP IceSSL implementation to support client side certificates and custom certificate verification. -- Added `getEngineName` and `getEngineVersion` functions to `IceSSL::Plugin` to retrieve - the SSL engine name and version used by the Ice runtime. +- Added `getOpenSSLVersion` function to `IceSSL::OpenSSL::Plugin` to retrieve + the OpenSSL version used by the Ice runtime. - Added `getAuthorityKeyIdentifier` and `getSubjectKeyIdentifier` functions to `IceSSL::Certificate`. These functions are not supported on iOS or UWP. diff --git a/cpp/include/IceSSL/OpenSSL.h b/cpp/include/IceSSL/OpenSSL.h index 4f2d8c333a8..66fe89b2302 100644 --- a/cpp/include/IceSSL/OpenSSL.h +++ b/cpp/include/IceSSL/OpenSSL.h @@ -87,6 +87,10 @@ class ICESSL_OPENSSL_API Plugin : public virtual IceSSL::Plugin { public: // + // returns OpenSSL version number. + // + virtual Ice::Long getOpenSSLVersion() const = 0; + // // Establish the OpenSSL context. This must be done before the // plug-in is initialized, therefore the application must define // the property Ice.InitPlugins=0, set the context, and finally @@ -107,6 +111,7 @@ public: virtual SSL_CTX* getContext() = 0; }; +ICE_DEFINE_PTR(PluginPtr, Plugin); } // OpenSSL namespace end diff --git a/cpp/include/IceSSL/Plugin.h b/cpp/include/IceSSL/Plugin.h index cc763e77120..2d9b5372e8b 100644 --- a/cpp/include/IceSSL/Plugin.h +++ b/cpp/include/IceSSL/Plugin.h @@ -429,9 +429,6 @@ class ICESSL_API Plugin : public Ice::Plugin public: virtual ~Plugin(); - - virtual std::string getEngineName() const = 0; - virtual Ice::Long getEngineVersion() const = 0; // // Establish the certificate verifier object. This should be done diff --git a/cpp/src/IceSSL/OpenSSLPluginI.cpp b/cpp/src/IceSSL/OpenSSLPluginI.cpp index 7328dfbf41d..fe8ffec9b8c 100644 --- a/cpp/src/IceSSL/OpenSSLPluginI.cpp +++ b/cpp/src/IceSSL/OpenSSLPluginI.cpp @@ -25,8 +25,7 @@ public: PluginI(const Ice::CommunicatorPtr&); - virtual string getEngineName() const; - virtual Ice::Long getEngineVersion() const; + virtual Ice::Long getOpenSSLVersion() const; virtual IceSSL::CertificatePtr create(x509_st*) const; virtual IceSSL::CertificatePtr load(const std::string&) const; virtual IceSSL::CertificatePtr decode(const std::string&) const; @@ -44,16 +43,8 @@ PluginI::PluginI(const Ice::CommunicatorPtr& com) : { } -string -PluginI::getEngineName() const -{ - ostringstream os; - os << "OpenSSLEngine@" << SSLeay_version(SSLEAY_VERSION); - return os.str(); -} - Ice::Long -PluginI::getEngineVersion() const +PluginI::getOpenSSLVersion() const { return SSLeay(); } diff --git a/cpp/src/IceSSL/SChannelPluginI.cpp b/cpp/src/IceSSL/SChannelPluginI.cpp index 59cb2d11d1e..7b7abb9efa5 100644 --- a/cpp/src/IceSSL/SChannelPluginI.cpp +++ b/cpp/src/IceSSL/SChannelPluginI.cpp @@ -23,8 +23,6 @@ public: PluginI(const Ice::CommunicatorPtr&); - virtual string getEngineName() const; - virtual Ice::Long getEngineVersion() const; virtual IceSSL::CertificatePtr create(CERT_SIGNED_CONTENT_INFO*) const; virtual IceSSL::CertificatePtr load(const std::string&) const; virtual IceSSL::CertificatePtr decode(const std::string&) const; @@ -40,18 +38,6 @@ PluginI::PluginI(const Ice::CommunicatorPtr& com) : { } -string -PluginI::getEngineName() const -{ - return "SChannelEngine"; -} - -Ice::Long -PluginI::getEngineVersion() const -{ - return 0; -} - IceSSL::CertificatePtr PluginI::create(CERT_SIGNED_CONTENT_INFO* cert) const { diff --git a/cpp/src/IceSSL/SecureTransportPluginI.cpp b/cpp/src/IceSSL/SecureTransportPluginI.cpp index 3d11563b521..6c55b28255c 100644 --- a/cpp/src/IceSSL/SecureTransportPluginI.cpp +++ b/cpp/src/IceSSL/SecureTransportPluginI.cpp @@ -25,8 +25,6 @@ public: PluginI(const Ice::CommunicatorPtr&); - virtual string getEngineName() const; - virtual Ice::Long getEngineVersion() const; virtual IceSSL::CertificatePtr create(SecCertificateRef) const; virtual IceSSL::CertificatePtr load(const std::string&) const; virtual IceSSL::CertificatePtr decode(const std::string&) const; @@ -42,18 +40,6 @@ PluginI::PluginI(const Ice::CommunicatorPtr& com) : { } -string -PluginI::getEngineName() const -{ - return "SecureTransport"; -} - -Ice::Long -PluginI::getEngineVersion() const -{ - return 0; -} - IceSSL::CertificatePtr PluginI::create(SecCertificateRef cert) const { diff --git a/cpp/test/IceSSL/configuration/AllTests.cpp b/cpp/test/IceSSL/configuration/AllTests.cpp index 64c223ab151..9cf12e9d03d 100644 --- a/cpp/test/IceSSL/configuration/AllTests.cpp +++ b/cpp/test/IceSSL/configuration/AllTests.cpp @@ -727,8 +727,9 @@ allTests(const CommunicatorPtr& communicator, const string& testDir, bool p12) string sep = ":"; #endif - string engineName; - Ice::Long engineVersion; + +#ifdef ICE_USE_OPENSSL + Ice::Long openSSLVersion; { // // Get the IceSSL engine name and version @@ -736,18 +737,12 @@ allTests(const CommunicatorPtr& communicator, const string& testDir, bool p12) InitializationData initData; initData.properties = createClientProps(defaultProps, p12); CommunicatorPtr comm = initialize(initData); - IceSSL::PluginPtr plugin = ICE_DYNAMIC_CAST(IceSSL::Plugin, comm->getPluginManager()->getPlugin("IceSSL")); + IceSSL::OpenSSL::PluginPtr plugin = ICE_DYNAMIC_CAST(IceSSL::OpenSSL::Plugin, comm->getPluginManager()->getPlugin("IceSSL")); test(plugin); - engineName = plugin->getEngineName(); - engineVersion = plugin->getEngineVersion(); + openSSLVersion = plugin->getOpenSSLVersion(); comm->destroy(); } - -#ifdef ICE_USE_OPENSSL - // - // Parse OpenSSL version from engineName "OpenSSLEngine@OpenSSL 1.0.2g 1 Mar 2016" - // - const string anonCiphers = engineVersion >= 0x10100000L ? "ADH:@SECLEVEL=0" : "ADH"; + const string anonCiphers = openSSLVersion >= 0x10100000L ? "ADH:@SECLEVEL=0" : "ADH"; #endif IceSSL::ConnectionInfoPtr info; @@ -2086,8 +2081,9 @@ allTests(const CommunicatorPtr& communicator, const string& testDir, bool p12) // // OpenSSL < 1.0 doesn't support tls 1.1 so it will fail, we ignore the error in this case. // - if((engineName.find("OpenSSLEngine") != string::npos && engineVersion < 0x10000000L) || - engineName.find("OpenSSLEngine") == string::npos) +#ifdef ICE_USE_OPENSSL + if(openSSLVersion < 0x1000000) +#endif { cerr << ex << endl; test(false); |