diff options
author | Benoit Foucher <benoit@zeroc.com> | 2009-10-21 17:02:37 +0200 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2009-10-21 17:02:37 +0200 |
commit | a80b3c8cbb203c78b061e99e1a764685af4a93e9 (patch) | |
tree | 5448b1dd66499b8fc9e46c618aa65b6687855946 /cpp/src/IceSSL/TrustManager.cpp | |
parent | Bug 4311 - change Ice::Service::start signature (diff) | |
download | ice-a80b3c8cbb203c78b061e99e1a764685af4a93e9.tar.bz2 ice-a80b3c8cbb203c78b061e99e1a764685af4a93e9.tar.xz ice-a80b3c8cbb203c78b061e99e1a764685af4a93e9.zip |
- Removed old IceSSL::ConnectionInfo struct, it's now replaced with
IceSSL::NativeConnectionInfo.
- Removed Ice::ConnectionInfo endpoint attribute.
- Added Ice::Connection::getEndpoint() method.
- Added Ice::ConnectionInfo adapterName and incoming attributes.
- Replaced Tcp and Udp prefixes with TCP and UDP in endpoint/info classes.
- Added IPEndpointInfo and IPConnectionInfo intermediate classes.
- Fixed 2058: deprecate ice_hash for Ice.Object & Ice.LocalObject, added ice_getHash
- Fixed bug where Ice::Endpoint comparison would only compare the endpoint object addresses rather than the endpoint attributes like in Java and C#.
- Added ice_getHash implementation for endpoints and cleaned up Reference::hash to use HashUtil.h helper methods.
- Added test/Ice/info and removed endpoint info test from test/Ice/proxy.
Diffstat (limited to 'cpp/src/IceSSL/TrustManager.cpp')
-rw-r--r-- | cpp/src/IceSSL/TrustManager.cpp | 54 |
1 files changed, 15 insertions, 39 deletions
diff --git a/cpp/src/IceSSL/TrustManager.cpp b/cpp/src/IceSSL/TrustManager.cpp index cc36d651ddc..31f8709b9b7 100644 --- a/cpp/src/IceSSL/TrustManager.cpp +++ b/cpp/src/IceSSL/TrustManager.cpp @@ -62,7 +62,7 @@ TrustManager::TrustManager(const Ice::CommunicatorPtr& communicator) : } bool -TrustManager::verify(const ConnectionInfo& info) +TrustManager::verify(const NativeConnectionInfoPtr& info) { list<list<DistinguishedName> > reject, accept; @@ -70,15 +70,15 @@ TrustManager::verify(const ConnectionInfo& info) { reject.push_back(_rejectAll); } - if(info.incoming) + if(info->incoming) { if(_rejectAllServer.size() > 0) { reject.push_back(_rejectAllServer); } - if(info.adapterName.size() > 0) + if(info->adapterName.size() > 0) { - map<string, list<DistinguishedName> >::const_iterator p = _rejectServer.find(info.adapterName); + map<string, list<DistinguishedName> >::const_iterator p = _rejectServer.find(info->adapterName); if(p != _rejectServer.end()) { reject.push_back(p->second); @@ -97,15 +97,15 @@ TrustManager::verify(const ConnectionInfo& info) { accept.push_back(_acceptAll); } - if(info.incoming) + if(info->incoming) { if(_acceptAllServer.size() > 0) { accept.push_back(_acceptAllServer); } - if(info.adapterName.size() > 0) + if(info->adapterName.size() > 0) { - map<string, list<DistinguishedName> >::const_iterator p = _acceptServer.find(info.adapterName); + map<string, list<DistinguishedName> >::const_iterator p = _acceptServer.find(info->adapterName); if(p != _acceptServer.end()) { accept.push_back(p->second); @@ -131,50 +131,26 @@ TrustManager::verify(const ConnectionInfo& info) // // If there is no certificate then we match false. // - if(info.certs.size() != 0) + if(info->nativeCerts.size() != 0) { - DistinguishedName subject = info.certs[0]->getSubjectDN(); + DistinguishedName subject = info->nativeCerts[0]->getSubjectDN(); if(_traceLevel > 0) { Ice::Trace trace(_communicator->getLogger(), "Security"); - if(info.incoming) + if(info->incoming) { trace << "trust manager evaluating client:\n" << "subject = " << string(subject) << '\n' - << "adapter = " << info.adapterName << '\n' - << "local addr = " << IceInternal::addrToString(info.localAddr) << '\n' - << "remote addr = "; - if(info.remoteAddr.ss_family == AF_UNSPEC) - { - // - // The remote address may not be available when using Windows XP Service Pack 2 - // and IPv6 (see populateConnectionInfo). - // - trace << "<not available>"; - } - else - { - trace << IceInternal::addrToString(info.remoteAddr); - } + << "adapter = " << info->adapterName << '\n' + << "local addr = " << info->localAddress << ":" << info->localPort << '\n' + << "remote addr = " << info->remoteAddress << ":" << info->remotePort; } else { trace << "trust manager evaluating server:\n" << "subject = " << string(subject) << '\n' - << "local addr = " << IceInternal::addrToString(info.localAddr) << '\n' - << "remote addr = "; - if(info.remoteAddr.ss_family == AF_UNSPEC) - { - // - // The remote address may not be available when using Windows XP Service Pack 2 - // and IPv6 (see populateConnectionInfo). - // - trace << "<not available>"; - } - else - { - trace << IceInternal::addrToString(info.remoteAddr); - } + << "local addr = " << info->localAddress << ":" << info->localPort << '\n' + << "remote addr = " << info->remoteAddress << ":" << info->remotePort; } } |