summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2017-03-20 11:11:16 +0100
committerJose <jose@zeroc.com>2017-03-20 11:11:16 +0100
commit11c1140a8041b3dcdd79b9244422e56ebe8da10c (patch)
tree04cba9afe9ec7fb3e723ca45cb76afcfb5cc4885 /cpp/src
parentFixed (ICE-7678) - Python build failure with VS 2015 (diff)
downloadice-11c1140a8041b3dcdd79b9244422e56ebe8da10c.tar.bz2
ice-11c1140a8041b3dcdd79b9244422e56ebe8da10c.tar.xz
ice-11c1140a8041b3dcdd79b9244422e56ebe8da10c.zip
Update IceSSL::ConnectionInfo to use native certs and remove NativeConnectionInfo
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/Glacier2/SessionRouterI.cpp9
-rw-r--r--cpp/src/IceGrid/InternalRegistryI.cpp4
-rw-r--r--cpp/src/IceGrid/RegistryI.cpp7
-rw-r--r--cpp/src/IceSSL/CertificateI.cpp1
-rw-r--r--cpp/src/IceSSL/OpenSSLEngine.cpp2
-rw-r--r--cpp/src/IceSSL/OpenSSLEngine.h2
-rw-r--r--cpp/src/IceSSL/OpenSSLTransceiverI.cpp9
-rw-r--r--cpp/src/IceSSL/OpenSSLTransceiverI.h3
-rwxr-xr-xcpp/src/IceSSL/PluginI.cpp8
-rw-r--r--cpp/src/IceSSL/PluginI.h2
-rw-r--r--cpp/src/IceSSL/SChannelEngine.cpp2
-rw-r--r--cpp/src/IceSSL/SChannelEngine.h2
-rw-r--r--cpp/src/IceSSL/SChannelTransceiverI.cpp9
-rw-r--r--cpp/src/IceSSL/SChannelTransceiverI.h3
-rw-r--r--cpp/src/IceSSL/SSLEngine.cpp9
-rw-r--r--cpp/src/IceSSL/SSLEngine.h4
-rw-r--r--cpp/src/IceSSL/SecureTransportCertificateI.cpp1
-rw-r--r--cpp/src/IceSSL/SecureTransportTransceiverI.cpp11
-rw-r--r--cpp/src/IceSSL/SecureTransportTransceiverI.h3
-rw-r--r--cpp/src/IceSSL/SecureTransportUtil.cpp1
-rw-r--r--cpp/src/IceSSL/TrustManager.cpp7
-rw-r--r--cpp/src/IceSSL/TrustManager.h2
-rw-r--r--cpp/src/IceSSL/UWPTransceiverI.cpp8
-rw-r--r--cpp/src/IceSSL/UWPTransceiverI.h3
-rwxr-xr-xcpp/src/IceSSL/Util.cpp4
-rw-r--r--cpp/src/IceSSL/Util.h6
-rw-r--r--cpp/src/IceSSL/msbuild/icessl++11/icessl++11.vcxproj41
-rw-r--r--cpp/src/IceSSL/msbuild/icessl++11/icessl++11.vcxproj.filters55
-rw-r--r--cpp/src/IceSSL/msbuild/icessl/icessl.vcxproj41
-rw-r--r--cpp/src/IceSSL/msbuild/icessl/icessl.vcxproj.filters57
-rw-r--r--cpp/src/Slice/CPlusPlusUtil.cpp14
-rw-r--r--cpp/src/Slice/JavaUtil.cpp47
-rw-r--r--cpp/src/Slice/JavaUtil.h2
-rw-r--r--cpp/src/slice2cpp/Gen.cpp33
-rw-r--r--cpp/src/slice2cs/CsUtil.cpp29
-rw-r--r--cpp/src/slice2cs/CsUtil.h2
-rw-r--r--cpp/src/slice2cs/Gen.cpp4
-rw-r--r--cpp/src/slice2java/Gen.cpp4
-rw-r--r--cpp/src/slice2java/GenCompat.cpp31
39 files changed, 358 insertions, 124 deletions
diff --git a/cpp/src/Glacier2/SessionRouterI.cpp b/cpp/src/Glacier2/SessionRouterI.cpp
index 19ca27d2d8a..cd150de5fa2 100644
--- a/cpp/src/Glacier2/SessionRouterI.cpp
+++ b/cpp/src/Glacier2/SessionRouterI.cpp
@@ -477,7 +477,7 @@ CreateSession::CreateSession(const SessionRouterIPtr& sessionRouter, const strin
_context["_con.cipher"] = info->cipher;
if(info->certs.size() > 0)
{
- _context["_con.peerCert"] = info->certs[0];
+ _context["_con.peerCert"] = info->certs[0]->encode();
}
}
}
@@ -853,10 +853,13 @@ SessionRouterI::createSessionFromSecureConnection_async(
sslinfo.localPort = ipInfo->localPort;
sslinfo.localHost = ipInfo->localAddress;
sslinfo.cipher = info->cipher;
- sslinfo.certs = info->certs;
+ for(std::vector<IceSSL::CertificatePtr>::const_iterator i = info->certs.begin(); i != info->certs.end(); ++i)
+ {
+ sslinfo.certs.push_back((*i)->encode());
+ }
if(info->certs.size() > 0)
{
- userDN = IceSSL::Certificate::decode(info->certs[0])->getSubjectDN();
+ userDN = info->certs[0]->getSubjectDN();
}
}
catch(const IceSSL::CertificateEncodingException&)
diff --git a/cpp/src/IceGrid/InternalRegistryI.cpp b/cpp/src/IceGrid/InternalRegistryI.cpp
index c97ad6ccffe..5ee57d359a5 100644
--- a/cpp/src/IceGrid/InternalRegistryI.cpp
+++ b/cpp/src/IceGrid/InternalRegistryI.cpp
@@ -70,7 +70,7 @@ InternalRegistryI::registerNode(const InternalNodeInfoPtr& info,
if(sslConnInfo)
{
if (sslConnInfo->certs.empty() ||
- !IceSSL::Certificate::decode(sslConnInfo->certs[0])->getSubjectDN().match("CN=" + info->name))
+ !sslConnInfo->certs[0]->getSubjectDN().match("CN=" + info->name))
{
if(traceLevels->node > 0)
{
@@ -137,7 +137,7 @@ InternalRegistryI::registerReplica(const InternalReplicaInfoPtr& info,
if(sslConnInfo)
{
if (sslConnInfo->certs.empty() ||
- !IceSSL::Certificate::decode(sslConnInfo->certs[0])->getSubjectDN().match("CN=" + info->name))
+ !sslConnInfo->certs[0]->getSubjectDN().match("CN=" + info->name))
{
if(traceLevels->replica > 0)
{
diff --git a/cpp/src/IceGrid/RegistryI.cpp b/cpp/src/IceGrid/RegistryI.cpp
index 09c81d5a40f..3e4405d0d03 100644
--- a/cpp/src/IceGrid/RegistryI.cpp
+++ b/cpp/src/IceGrid/RegistryI.cpp
@@ -1357,10 +1357,13 @@ RegistryI::getSSLInfo(const ConnectionPtr& connection, string& userDN)
sslinfo.localPort = ipInfo->localPort;
sslinfo.localHost = ipInfo->localAddress;
sslinfo.cipher = info->cipher;
- sslinfo.certs = info->certs;
+ for(std::vector<IceSSL::CertificatePtr>::const_iterator i = info->certs.begin(); i != info->certs.end(); ++i)
+ {
+ sslinfo.certs.push_back((*i)->encode());
+ }
if(info->certs.size() > 0)
{
- userDN = IceSSL::Certificate::decode(info->certs[0])->getSubjectDN();
+ userDN = info->certs[0]->getSubjectDN();
}
}
catch(const IceSSL::CertificateEncodingException&)
diff --git a/cpp/src/IceSSL/CertificateI.cpp b/cpp/src/IceSSL/CertificateI.cpp
index fb7969b75f4..cc37c6530e8 100644
--- a/cpp/src/IceSSL/CertificateI.cpp
+++ b/cpp/src/IceSSL/CertificateI.cpp
@@ -17,6 +17,7 @@
#include <IceSSL/CertificateI.h>
#include <Ice/Object.h>
#include <Ice/Base64.h>
+#include <Ice/LocalException.h>
#include <Ice/StringConverter.h>
#include <IceUtil/Time.h>
diff --git a/cpp/src/IceSSL/OpenSSLEngine.cpp b/cpp/src/IceSSL/OpenSSLEngine.cpp
index 950f334484b..269202c1e2e 100644
--- a/cpp/src/IceSSL/OpenSSLEngine.cpp
+++ b/cpp/src/IceSSL/OpenSSLEngine.cpp
@@ -912,7 +912,7 @@ OpenSSL::SSLEngine::destroy()
}
void
-OpenSSL::SSLEngine::verifyPeer(const string& address, const NativeConnectionInfoPtr& info, const string& desc)
+OpenSSL::SSLEngine::verifyPeer(const string& address, const IceSSL::ConnectionInfoPtr& info, const string& desc)
{
#if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER < 0x10002000L
//
diff --git a/cpp/src/IceSSL/OpenSSLEngine.h b/cpp/src/IceSSL/OpenSSLEngine.h
index 5fc92c930c8..f1c2af22566 100644
--- a/cpp/src/IceSSL/OpenSSLEngine.h
+++ b/cpp/src/IceSSL/OpenSSLEngine.h
@@ -31,7 +31,7 @@ public:
virtual void initialize();
virtual void destroy();
- virtual void verifyPeer(const std::string&, const IceSSL::NativeConnectionInfoPtr&, const std::string&);
+ virtual void verifyPeer(const std::string&, const IceSSL::ConnectionInfoPtr&, const std::string&);
virtual IceInternal::TransceiverPtr
createTransceiver(const IceSSL::InstancePtr&, const IceInternal::TransceiverPtr&, const std::string&, bool);
diff --git a/cpp/src/IceSSL/OpenSSLTransceiverI.cpp b/cpp/src/IceSSL/OpenSSLTransceiverI.cpp
index ee10d229f81..9072026fcb4 100644
--- a/cpp/src/IceSSL/OpenSSLTransceiverI.cpp
+++ b/cpp/src/IceSSL/OpenSSLTransceiverI.cpp
@@ -341,7 +341,7 @@ OpenSSL::TransceiverI::initialize(IceInternal::Buffer& readBuffer, IceInternal::
}
_cipher = SSL_get_cipher_name(_ssl); // Nothing needs to be free'd.
- _engine->verifyPeer(_host, ICE_DYNAMIC_CAST(NativeConnectionInfo, getInfo()), toString());
+ _engine->verifyPeer(_host, ICE_DYNAMIC_CAST(ConnectionInfo, getInfo()), toString());
if(_engine->securityTraceLevel() >= 1)
{
@@ -775,14 +775,13 @@ OpenSSL::TransceiverI::toDetailedString() const
Ice::ConnectionInfoPtr
OpenSSL::TransceiverI::getInfo() const
{
- NativeConnectionInfoPtr info = ICE_MAKE_SHARED(NativeConnectionInfo);
+ ConnectionInfoPtr info = ICE_MAKE_SHARED(ConnectionInfo);
info->underlying = _delegate->getInfo();
info->incoming = _incoming;
info->adapterName = _adapterName;
info->cipher = _cipher;
info->certs = _certs;
info->verified = _verified;
- info->nativeCerts = _nativeCerts;
return info;
}
@@ -825,13 +824,11 @@ OpenSSL::TransceiverI::verifyCallback(int ok, X509_STORE_CTX* c)
STACK_OF(X509)* chain = X509_STORE_CTX_get1_chain(c);
if(chain != 0)
{
- _nativeCerts.clear();
_certs.clear();
for(int i = 0; i < sk_X509_num(chain); ++i)
{
CertificatePtr cert = OpenSSL::Certificate::create(X509_dup(sk_X509_value(chain, i)));
- _nativeCerts.push_back(cert);
- _certs.push_back(cert->encode());
+ _certs.push_back(cert);
}
sk_X509_pop_free(chain, X509_free);
}
diff --git a/cpp/src/IceSSL/OpenSSLTransceiverI.h b/cpp/src/IceSSL/OpenSSLTransceiverI.h
index 0bda6849b91..2e01bd918dd 100644
--- a/cpp/src/IceSSL/OpenSSLTransceiverI.h
+++ b/cpp/src/IceSSL/OpenSSLTransceiverI.h
@@ -76,9 +76,8 @@ private:
const IceInternal::TransceiverPtr _delegate;
bool _connected;
std::string _cipher;
- std::vector<std::string> _certs;
+ std::vector<IceSSL::CertificatePtr> _certs;
bool _verified;
- std::vector<IceSSL::CertificatePtr> _nativeCerts;
SSL* _ssl;
#ifdef ICE_USE_IOCP
diff --git a/cpp/src/IceSSL/PluginI.cpp b/cpp/src/IceSSL/PluginI.cpp
index 4e3cd01680a..cb0f20f5f6f 100755
--- a/cpp/src/IceSSL/PluginI.cpp
+++ b/cpp/src/IceSSL/PluginI.cpp
@@ -33,12 +33,6 @@ PasswordPrompt::~PasswordPrompt()
}
#endif
-
-NativeConnectionInfo::~NativeConnectionInfo()
-{
- // Out of line to avoid weak vtable
-}
-
IceSSL::Plugin::~Plugin()
{
// Out of line to avoid weak vtable
@@ -97,7 +91,7 @@ PluginI::destroy()
#ifdef ICE_CPP11_MAPPING
void
-PluginI::setCertificateVerifier(std::function<bool(const std::shared_ptr<NativeConnectionInfo>&)> verifier)
+PluginI::setCertificateVerifier(std::function<bool(const std::shared_ptr<IceSSL::ConnectionInfo>&)> verifier)
{
if(verifier)
{
diff --git a/cpp/src/IceSSL/PluginI.h b/cpp/src/IceSSL/PluginI.h
index 3cb9a14b024..6bd18273d71 100644
--- a/cpp/src/IceSSL/PluginI.h
+++ b/cpp/src/IceSSL/PluginI.h
@@ -32,7 +32,7 @@ public:
// From IceSSL::Plugin.
//
#ifdef ICE_CPP11_MAPPING
- virtual void setCertificateVerifier(std::function<bool(const std::shared_ptr<NativeConnectionInfo>&)>);
+ virtual void setCertificateVerifier(std::function<bool(const std::shared_ptr<ConnectionInfo>&)>);
virtual void setPasswordPrompt(std::function<std::string()>);
#else
virtual void setCertificateVerifier(const CertificateVerifierPtr&);
diff --git a/cpp/src/IceSSL/SChannelEngine.cpp b/cpp/src/IceSSL/SChannelEngine.cpp
index 25c62a81ff0..cc1decdb4ed 100644
--- a/cpp/src/IceSSL/SChannelEngine.cpp
+++ b/cpp/src/IceSSL/SChannelEngine.cpp
@@ -1061,7 +1061,7 @@ SChannel::SSLEngine::destroy()
}
void
-SChannel::SSLEngine::verifyPeer(const string& address, const NativeConnectionInfoPtr& info, const string& desc)
+SChannel::SSLEngine::verifyPeer(const string& address, const IceSSL::ConnectionInfoPtr& info, const string& desc)
{
verifyPeerCertName(address, info);
IceSSL::SSLEngine::verifyPeer(address, info, desc);
diff --git a/cpp/src/IceSSL/SChannelEngine.h b/cpp/src/IceSSL/SChannelEngine.h
index f62ff654677..e37d42b83a2 100644
--- a/cpp/src/IceSSL/SChannelEngine.h
+++ b/cpp/src/IceSSL/SChannelEngine.h
@@ -94,7 +94,7 @@ public:
//
virtual void destroy();
- virtual void verifyPeer(const std::string&, const NativeConnectionInfoPtr&, const std::string&);
+ virtual void verifyPeer(const std::string&, const ConnectionInfoPtr&, const std::string&);
std::string getCipherName(ALG_ID) const;
diff --git a/cpp/src/IceSSL/SChannelTransceiverI.cpp b/cpp/src/IceSSL/SChannelTransceiverI.cpp
index caae4dc7fe0..d837bdad833 100644
--- a/cpp/src/IceSSL/SChannelTransceiverI.cpp
+++ b/cpp/src/IceSSL/SChannelTransceiverI.cpp
@@ -701,9 +701,7 @@ SChannel::TransceiverI::initialize(IceInternal::Buffer& readBuffer, IceInternal:
IceUtilInternal::lastErrorToString());
}
- CertificatePtr certificate = SChannel::Certificate::create(cc);
- _nativeCerts.push_back(certificate);
- _certs.push_back(certificate->encode());
+ _certs.push_back(SChannel::Certificate::create(cc));
}
CertFreeCertificateChain(certChain);
@@ -748,7 +746,7 @@ SChannel::TransceiverI::initialize(IceInternal::Buffer& readBuffer, IceInternal:
IceUtilInternal::lastErrorToString());
}
- _engine->verifyPeer(_host, ICE_DYNAMIC_CAST(NativeConnectionInfo, getInfo()), toString());
+ _engine->verifyPeer(_host, ICE_DYNAMIC_CAST(ConnectionInfo, getInfo()), toString());
_state = StateHandshakeComplete;
if(_instance->engine()->securityTraceLevel() >= 1)
@@ -991,14 +989,13 @@ SChannel::TransceiverI::toDetailedString() const
Ice::ConnectionInfoPtr
SChannel::TransceiverI::getInfo() const
{
- NativeConnectionInfoPtr info = ICE_MAKE_SHARED(NativeConnectionInfo);
+ ConnectionInfoPtr info = ICE_MAKE_SHARED(ConnectionInfo);
info->underlying = _delegate->getInfo();
info->incoming = _incoming;
info->adapterName = _adapterName;
info->cipher = _cipher;
info->certs = _certs;
info->verified = _verified;
- info->nativeCerts = _nativeCerts;
return info;
}
diff --git a/cpp/src/IceSSL/SChannelTransceiverI.h b/cpp/src/IceSSL/SChannelTransceiverI.h
index 2f05011a873..07c7ae7aeff 100644
--- a/cpp/src/IceSSL/SChannelTransceiverI.h
+++ b/cpp/src/IceSSL/SChannelTransceiverI.h
@@ -119,9 +119,8 @@ private:
bool _credentialsInitialized;
SecPkgContext_StreamSizes _sizes;
std::string _cipher;
- std::vector<std::string> _certs;
+ std::vector<IceSSL::CertificatePtr> _certs;
bool _verified;
- std::vector<IceSSL::CertificatePtr> _nativeCerts;
};
typedef IceUtil::Handle<TransceiverI> TransceiverIPtr;
diff --git a/cpp/src/IceSSL/SSLEngine.cpp b/cpp/src/IceSSL/SSLEngine.cpp
index 81f36d38948..bca84dfb066 100644
--- a/cpp/src/IceSSL/SSLEngine.cpp
+++ b/cpp/src/IceSSL/SSLEngine.cpp
@@ -9,6 +9,7 @@
#include <IceSSL/SSLEngine.h>
#include <IceSSL/TrustManager.h>
+#include <IceSSL/ConnectionInfo.h>
#include <IceUtil/StringUtil.h>
@@ -137,15 +138,15 @@ IceSSL::SSLEngine::initialize()
}
void
-IceSSL::SSLEngine::verifyPeerCertName(const string& address, const NativeConnectionInfoPtr& info)
+IceSSL::SSLEngine::verifyPeerCertName(const string& address, const ConnectionInfoPtr& info)
{
//
// For an outgoing connection, we compare the proxy address (if any) against
// fields in the server's certificate (if any).
//
- if(_checkCertName && !info->nativeCerts.empty() && !address.empty())
+ if(_checkCertName && !info->certs.empty() && !address.empty())
{
- const CertificatePtr cert = info->nativeCerts[0];
+ const CertificatePtr cert = info->certs[0];
//
// Extract the IP addresses and the DNS names from the subject
@@ -226,7 +227,7 @@ IceSSL::SSLEngine::verifyPeerCertName(const string& address, const NativeConnect
}
void
-IceSSL::SSLEngine::verifyPeer(const string& address, const NativeConnectionInfoPtr& info, const string& desc)
+IceSSL::SSLEngine::verifyPeer(const string& address, const ConnectionInfoPtr& info, const string& desc)
{
const CertificateVerifierPtr verifier = getCertificateVerifier();
if(_verifyDepthMax > 0 && static_cast<int>(info->certs.size()) > _verifyDepthMax)
diff --git a/cpp/src/IceSSL/SSLEngine.h b/cpp/src/IceSSL/SSLEngine.h
index 422f0c17648..7c05d585245 100644
--- a/cpp/src/IceSSL/SSLEngine.h
+++ b/cpp/src/IceSSL/SSLEngine.h
@@ -58,8 +58,8 @@ public:
//
// Verify peer certificate
//
- virtual void verifyPeer(const std::string&, const NativeConnectionInfoPtr&, const std::string&);
- void verifyPeerCertName(const std::string&, const NativeConnectionInfoPtr&);
+ virtual void verifyPeer(const std::string&, const ConnectionInfoPtr&, const std::string&);
+ void verifyPeerCertName(const std::string&, const ConnectionInfoPtr&);
CertificateVerifierPtr getCertificateVerifier() const;
PasswordPromptPtr getPasswordPrompt() const;
diff --git a/cpp/src/IceSSL/SecureTransportCertificateI.cpp b/cpp/src/IceSSL/SecureTransportCertificateI.cpp
index f988de667a5..32f02fd90d4 100644
--- a/cpp/src/IceSSL/SecureTransportCertificateI.cpp
+++ b/cpp/src/IceSSL/SecureTransportCertificateI.cpp
@@ -13,6 +13,7 @@
#include <IceSSL/SecureTransportUtil.h>
#include <IceSSL/RFC2253.h>
+#include <Ice/LocalException.h>
#include <Ice/UniqueRef.h>
#include <Ice/Base64.h>
diff --git a/cpp/src/IceSSL/SecureTransportTransceiverI.cpp b/cpp/src/IceSSL/SecureTransportTransceiverI.cpp
index 2cbd7fe0bd9..6d83dba98df 100644
--- a/cpp/src/IceSSL/SecureTransportTransceiverI.cpp
+++ b/cpp/src/IceSSL/SecureTransportTransceiverI.cpp
@@ -11,6 +11,7 @@
#include <IceSSL/Instance.h>
#include <IceSSL/SecureTransportEngine.h>
#include <IceSSL/SecureTransportUtil.h>
+#include <IceSSL/ConnectionInfo.h>
#include <Ice/LoggerUtil.h>
#include <Ice/LocalException.h>
@@ -289,10 +290,7 @@ IceSSL::SecureTransport::TransceiverI::initialize(IceInternal::Buffer& readBuffe
{
SecCertificateRef cert = SecTrustGetCertificateAtIndex(_trust.get(), i);
CFRetain(cert);
-
- CertificatePtr certificate = IceSSL::SecureTransport::Certificate::create(cert);
- _nativeCerts.push_back(certificate);
- _certs.push_back(certificate->encode());
+ _certs.push_back(IceSSL::SecureTransport::Certificate::create(cert));
}
assert(_ssl);
@@ -300,7 +298,7 @@ IceSSL::SecureTransport::TransceiverI::initialize(IceInternal::Buffer& readBuffe
SSLGetNegotiatedCipher(_ssl.get(), &cipher);
_cipher = _engine->getCipherName(cipher);
- _engine->verifyPeer(_host, ICE_DYNAMIC_CAST(NativeConnectionInfo, getInfo()), toString());
+ _engine->verifyPeer(_host, ICE_DYNAMIC_CAST(ConnectionInfo, getInfo()), toString());
if(_instance->engine()->securityTraceLevel() >= 1)
{
@@ -528,14 +526,13 @@ IceSSL::SecureTransport::TransceiverI::toDetailedString() const
Ice::ConnectionInfoPtr
IceSSL::SecureTransport::TransceiverI::getInfo() const
{
- NativeConnectionInfoPtr info = ICE_MAKE_SHARED(NativeConnectionInfo);
+ IceSSL::ConnectionInfoPtr info = ICE_MAKE_SHARED(IceSSL::ConnectionInfo);
info->underlying = _delegate->getInfo();
info->incoming = _incoming;
info->adapterName = _adapterName;
info->cipher = _cipher;
info->certs = _certs;
info->verified = _verified;
- info->nativeCerts = _nativeCerts;
return info;
}
diff --git a/cpp/src/IceSSL/SecureTransportTransceiverI.h b/cpp/src/IceSSL/SecureTransportTransceiverI.h
index a73771eabc7..d1e3fc41cd6 100644
--- a/cpp/src/IceSSL/SecureTransportTransceiverI.h
+++ b/cpp/src/IceSSL/SecureTransportTransceiverI.h
@@ -79,9 +79,8 @@ private:
size_t _maxSendPacketSize;
size_t _maxRecvPacketSize;
std::string _cipher;
- std::vector<std::string> _certs;
+ std::vector<CertificatePtr> _certs;
bool _verified;
- std::vector<CertificatePtr> _nativeCerts;
size_t _buffered;
};
typedef IceUtil::Handle<TransceiverI> TransceiverIPtr;
diff --git a/cpp/src/IceSSL/SecureTransportUtil.cpp b/cpp/src/IceSSL/SecureTransportUtil.cpp
index 1108560cd8b..d9e0a793afc 100644
--- a/cpp/src/IceSSL/SecureTransportUtil.cpp
+++ b/cpp/src/IceSSL/SecureTransportUtil.cpp
@@ -12,6 +12,7 @@
#include <Ice/Base64.h>
#include <Ice/UniqueRef.h>
+#include <Ice/LocalException.h>
#include <IceUtil/FileUtil.h>
#include <IceUtil/StringUtil.h>
diff --git a/cpp/src/IceSSL/TrustManager.cpp b/cpp/src/IceSSL/TrustManager.cpp
index 7e57b50db8a..82b3f15ee2c 100644
--- a/cpp/src/IceSSL/TrustManager.cpp
+++ b/cpp/src/IceSSL/TrustManager.cpp
@@ -9,6 +9,7 @@
#include <IceSSL/TrustManager.h>
#include <IceSSL/RFC2253.h>
+#include <IceSSL/ConnectionInfo.h>
#include <Ice/Properties.h>
#include <Ice/Communicator.h>
@@ -62,7 +63,7 @@ TrustManager::TrustManager(const Ice::CommunicatorPtr& communicator) :
}
bool
-TrustManager::verify(const NativeConnectionInfoPtr& info, const std::string& desc)
+TrustManager::verify(const ConnectionInfoPtr& info, const std::string& desc)
{
list<list<DistinguishedName> > reject, accept;
@@ -131,9 +132,9 @@ TrustManager::verify(const NativeConnectionInfoPtr& info, const std::string& des
//
// If there is no certificate then we match false.
//
- if(info->nativeCerts.size() != 0)
+ if(info->certs.size() != 0)
{
- DistinguishedName subject = info->nativeCerts[0]->getSubjectDN();
+ DistinguishedName subject = info->certs[0]->getSubjectDN();
if(_traceLevel > 0)
{
Ice::Trace trace(_communicator->getLogger(), "Security");
diff --git a/cpp/src/IceSSL/TrustManager.h b/cpp/src/IceSSL/TrustManager.h
index 8e5dd5bfeff..a72c874fb17 100644
--- a/cpp/src/IceSSL/TrustManager.h
+++ b/cpp/src/IceSSL/TrustManager.h
@@ -25,7 +25,7 @@ public:
TrustManager(const Ice::CommunicatorPtr&);
- bool verify(const NativeConnectionInfoPtr&, const std::string&);
+ bool verify(const ConnectionInfoPtr&, const std::string&);
private:
diff --git a/cpp/src/IceSSL/UWPTransceiverI.cpp b/cpp/src/IceSSL/UWPTransceiverI.cpp
index b2b1b3f1992..ce90e33ab73 100644
--- a/cpp/src/IceSSL/UWPTransceiverI.cpp
+++ b/cpp/src/IceSSL/UWPTransceiverI.cpp
@@ -197,12 +197,11 @@ UWP::TransceiverI::initialize(IceInternal::Buffer& readBuffer, IceInternal::Buff
for(auto iter = certs->First(); iter->HasCurrent; iter->MoveNext())
{
auto cert = UWP::Certificate::create(iter->Current);
- _nativeCerts.push_back(cert);
- _certs.push_back(cert->encode());
+ _certs.push_back(cert);
}
}
- _engine->verifyPeer(_host, dynamic_pointer_cast<IceSSL::NativeConnectionInfo>(getInfo()), toString());
+ _engine->verifyPeer(_host, dynamic_pointer_cast<IceSSL::ConnectionInfo>(getInfo()), toString());
}
catch(Platform::Exception^ ex)
{
@@ -347,13 +346,12 @@ UWP::TransceiverI::toDetailedString() const
Ice::ConnectionInfoPtr
UWP::TransceiverI::getInfo() const
{
- NativeConnectionInfoPtr info = ICE_MAKE_SHARED(NativeConnectionInfo);
+ ConnectionInfoPtr info = ICE_MAKE_SHARED(ConnectionInfo);
info->verified = _verified;
info->adapterName = _adapterName;
info->incoming = _incoming;
info->underlying = _delegate->getInfo();
info->certs = _certs;
- info->nativeCerts = _nativeCerts;
return info;
}
diff --git a/cpp/src/IceSSL/UWPTransceiverI.h b/cpp/src/IceSSL/UWPTransceiverI.h
index fc9ab74ced9..0dd23404de5 100644
--- a/cpp/src/IceSSL/UWPTransceiverI.h
+++ b/cpp/src/IceSSL/UWPTransceiverI.h
@@ -63,9 +63,8 @@ private:
bool _connected;
bool _upgraded;
- std::vector<std::string> _certs;
+ std::vector<IceSSL::CertificatePtr> _certs;
bool _verified;
- std::vector<IceSSL::CertificatePtr> _nativeCerts;
Windows::Security::Cryptography::Certificates::CertificateChain^ _chain;
};
typedef IceUtil::Handle<TransceiverI> TransceiverIPtr;
diff --git a/cpp/src/IceSSL/Util.cpp b/cpp/src/IceSSL/Util.cpp
index 08f97a0c6fb..02811cdd00d 100755
--- a/cpp/src/IceSSL/Util.cpp
+++ b/cpp/src/IceSSL/Util.cpp
@@ -51,13 +51,13 @@ IceSSL::fromCFString(CFStringRef v)
#endif
#ifdef ICE_CPP11_MAPPING
-IceSSL::CertificateVerifier::CertificateVerifier(std::function<bool(const std::shared_ptr<NativeConnectionInfo>&)> v) :
+IceSSL::CertificateVerifier::CertificateVerifier(std::function<bool(const std::shared_ptr<ConnectionInfo>&)> v) :
_verify(std::move(v))
{
}
bool
-IceSSL::CertificateVerifier::verify(const NativeConnectionInfoPtr& info)
+IceSSL::CertificateVerifier::verify(const ConnectionInfoPtr& info)
{
return _verify(info);
}
diff --git a/cpp/src/IceSSL/Util.h b/cpp/src/IceSSL/Util.h
index ac9697a990e..69471864a27 100644
--- a/cpp/src/IceSSL/Util.h
+++ b/cpp/src/IceSSL/Util.h
@@ -48,12 +48,12 @@ class ICESSL_API CertificateVerifier
{
public:
- CertificateVerifier(std::function<bool(const std::shared_ptr<NativeConnectionInfo>&)>);
- bool verify(const NativeConnectionInfoPtr&);
+ CertificateVerifier(std::function<bool(const std::shared_ptr<ConnectionInfo>&)>);
+ bool verify(const ConnectionInfoPtr&);
private:
- std::function<bool(const std::shared_ptr<NativeConnectionInfo>&)> _verify;
+ std::function<bool(const std::shared_ptr<ConnectionInfo>&)> _verify;
};
using CertificateVerifierPtr = std::shared_ptr<CertificateVerifier>;
diff --git a/cpp/src/IceSSL/msbuild/icessl++11/icessl++11.vcxproj b/cpp/src/IceSSL/msbuild/icessl++11/icessl++11.vcxproj
index 78eda48ca78..60f4ee25263 100644
--- a/cpp/src/IceSSL/msbuild/icessl++11/icessl++11.vcxproj
+++ b/cpp/src/IceSSL/msbuild/icessl++11/icessl++11.vcxproj
@@ -106,6 +106,7 @@
</ItemGroup>
<ItemGroup>
<IceBuilder Include="..\..\..\..\..\slice\IceSSL\ConnectionInfo.ice" />
+ <IceBuilder Include="..\..\..\..\..\slice\IceSSL\ConnectionInfoF.ice" />
<IceBuilder Include="..\..\..\..\..\slice\IceSSL\EndpointInfo.ice" />
</ItemGroup>
<ItemGroup>
@@ -128,6 +129,11 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
+ <ClCompile Include="Win32\Debug\ConnectionInfoF.cpp">
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+ </ClCompile>
<ClCompile Include="Win32\Debug\EndpointInfo.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
@@ -138,6 +144,11 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
+ <ClCompile Include="Win32\Release\ConnectionInfoF.cpp">
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+ </ClCompile>
<ClCompile Include="Win32\Release\EndpointInfo.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
@@ -148,6 +159,11 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
+ <ClCompile Include="x64\Debug\ConnectionInfoF.cpp">
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+ </ClCompile>
<ClCompile Include="x64\Debug\EndpointInfo.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
@@ -158,6 +174,11 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile>
+ <ClCompile Include="x64\Release\ConnectionInfoF.cpp">
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+ </ClCompile>
<ClCompile Include="x64\Release\EndpointInfo.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
@@ -170,6 +191,11 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClInclude>
+ <ClInclude Include="..\..\..\..\include\generated\cpp11\Win32\Debug\IceSSL\ConnectionInfoF.h">
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+ </ClInclude>
<ClInclude Include="..\..\..\..\include\generated\cpp11\Win32\Debug\IceSSL\EndpointInfo.h">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
@@ -180,6 +206,11 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClInclude>
+ <ClInclude Include="..\..\..\..\include\generated\cpp11\Win32\Release\IceSSL\ConnectionInfoF.h">
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+ </ClInclude>
<ClInclude Include="..\..\..\..\include\generated\cpp11\Win32\Release\IceSSL\EndpointInfo.h">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
@@ -190,6 +221,11 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClInclude>
+ <ClInclude Include="..\..\..\..\include\generated\cpp11\x64\Debug\IceSSL\ConnectionInfoF.h">
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+ </ClInclude>
<ClInclude Include="..\..\..\..\include\generated\cpp11\x64\Debug\IceSSL\EndpointInfo.h">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
@@ -200,6 +236,11 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClInclude>
+ <ClInclude Include="..\..\..\..\include\generated\cpp11\x64\Release\IceSSL\ConnectionInfoF.h">
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+ </ClInclude>
<ClInclude Include="..\..\..\..\include\generated\cpp11\x64\Release\IceSSL\EndpointInfo.h">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
diff --git a/cpp/src/IceSSL/msbuild/icessl++11/icessl++11.vcxproj.filters b/cpp/src/IceSSL/msbuild/icessl++11/icessl++11.vcxproj.filters
index c988a7c0d72..19bdeb423ee 100644
--- a/cpp/src/IceSSL/msbuild/icessl++11/icessl++11.vcxproj.filters
+++ b/cpp/src/IceSSL/msbuild/icessl++11/icessl++11.vcxproj.filters
@@ -66,6 +66,9 @@
<IceBuilder Include="..\..\..\..\..\slice\IceSSL\EndpointInfo.ice">
<Filter>Slice Files</Filter>
</IceBuilder>
+ <IceBuilder Include="..\..\..\..\..\slice\IceSSL\ConnectionInfoF.ice">
+ <Filter>Slice Files</Filter>
+ </IceBuilder>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\Util.cpp">
@@ -98,12 +101,30 @@
<ClCompile Include="..\..\ConnectorI.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="..\..\Certificate.cpp">
+ <ClCompile Include="..\..\AcceptorI.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="..\..\AcceptorI.cpp">
+ <ClCompile Include="..\..\SChannelPluginI.cpp">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="..\..\CertificateI.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\SChannelCertificateI.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Win32\Debug\ConnectionInfoF.cpp">
+ <Filter>Source Files\Win32\Debug</Filter>
+ </ClCompile>
+ <ClCompile Include="x64\Debug\ConnectionInfoF.cpp">
+ <Filter>Source Files\x64\Debug</Filter>
+ </ClCompile>
+ <ClCompile Include="Win32\Release\ConnectionInfoF.cpp">
+ <Filter>Source Files\Win32\Release</Filter>
+ </ClCompile>
+ <ClCompile Include="x64\Release\ConnectionInfoF.cpp">
+ <Filter>Source Files\x64\Release</Filter>
+ </ClCompile>
<ClCompile Include="Win32\Debug\ConnectionInfo.cpp">
<Filter>Source Files\Win32\Debug</Filter>
</ClCompile>
@@ -128,12 +149,6 @@
<ClCompile Include="x64\Release\EndpointInfo.cpp">
<Filter>Source Files\x64\Release</Filter>
</ClCompile>
- <ClCompile Include="..\..\SChannelCertificate.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="..\..\SChannelPluginI.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\Util.h">
@@ -184,6 +199,24 @@
<ClInclude Include="..\..\..\..\include\IceSSL\Plugin.h">
<Filter>Header Files</Filter>
</ClInclude>
+ <ClInclude Include="..\..\SChannelEngine.h">
+ <Filter>Source Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\SChannelEngineF.h">
+ <Filter>Source Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\generated\cpp11\Win32\Debug\IceSSL\ConnectionInfoF.h">
+ <Filter>Header Files\Win32\Debug</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\generated\cpp11\x64\Debug\IceSSL\ConnectionInfoF.h">
+ <Filter>Header Files\x64\Debug</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\generated\cpp11\Win32\Release\IceSSL\ConnectionInfoF.h">
+ <Filter>Header Files\Win32\Release</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\generated\cpp11\x64\Release\IceSSL\ConnectionInfoF.h">
+ <Filter>Header Files\x64\Release</Filter>
+ </ClInclude>
<ClInclude Include="..\..\..\..\include\generated\cpp11\Win32\Debug\IceSSL\ConnectionInfo.h">
<Filter>Header Files\Win32\Debug</Filter>
</ClInclude>
@@ -208,11 +241,5 @@
<ClInclude Include="..\..\..\..\include\generated\cpp11\x64\Release\IceSSL\EndpointInfo.h">
<Filter>Header Files\x64\Release</Filter>
</ClInclude>
- <ClInclude Include="..\..\SChannelEngine.h">
- <Filter>Source Files</Filter>
- </ClInclude>
- <ClInclude Include="..\..\SChannelEngineF.h">
- <Filter>Source Files</Filter>
- </ClInclude>
</ItemGroup>
</Project> \ No newline at end of file
diff --git a/cpp/src/IceSSL/msbuild/icessl/icessl.vcxproj b/cpp/src/IceSSL/msbuild/icessl/icessl.vcxproj
index 837279671e5..6af52d8d03a 100644
--- a/cpp/src/IceSSL/msbuild/icessl/icessl.vcxproj
+++ b/cpp/src/IceSSL/msbuild/icessl/icessl.vcxproj
@@ -111,6 +111,7 @@
</ItemGroup>
<ItemGroup>
<IceBuilder Include="..\..\..\..\..\slice\IceSSL\ConnectionInfo.ice" />
+ <IceBuilder Include="..\..\..\..\..\slice\IceSSL\ConnectionInfoF.ice" />
<IceBuilder Include="..\..\..\..\..\slice\IceSSL\EndpointInfo.ice" />
</ItemGroup>
<ItemGroup>
@@ -133,6 +134,11 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
+ <ClCompile Include="Win32\Debug\ConnectionInfoF.cpp">
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+ </ClCompile>
<ClCompile Include="Win32\Debug\EndpointInfo.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
@@ -143,6 +149,11 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
+ <ClCompile Include="Win32\Release\ConnectionInfoF.cpp">
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+ </ClCompile>
<ClCompile Include="Win32\Release\EndpointInfo.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
@@ -153,6 +164,11 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
+ <ClCompile Include="x64\Debug\ConnectionInfoF.cpp">
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+ </ClCompile>
<ClCompile Include="x64\Debug\EndpointInfo.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
@@ -163,6 +179,11 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile>
+ <ClCompile Include="x64\Release\ConnectionInfoF.cpp">
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+ </ClCompile>
<ClCompile Include="x64\Release\EndpointInfo.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
@@ -175,6 +196,11 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClInclude>
+ <ClInclude Include="..\..\..\..\include\generated\cpp98\Win32\Debug\IceSSL\ConnectionInfoF.h">
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+ </ClInclude>
<ClInclude Include="..\..\..\..\include\generated\cpp98\Win32\Debug\IceSSL\EndpointInfo.h">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
@@ -185,6 +211,11 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClInclude>
+ <ClInclude Include="..\..\..\..\include\generated\cpp98\Win32\Release\IceSSL\ConnectionInfoF.h">
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+ </ClInclude>
<ClInclude Include="..\..\..\..\include\generated\cpp98\Win32\Release\IceSSL\EndpointInfo.h">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
@@ -195,6 +226,11 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClInclude>
+ <ClInclude Include="..\..\..\..\include\generated\cpp98\x64\Debug\IceSSL\ConnectionInfoF.h">
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+ </ClInclude>
<ClInclude Include="..\..\..\..\include\generated\cpp98\x64\Debug\IceSSL\EndpointInfo.h">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
@@ -205,6 +241,11 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClInclude>
+ <ClInclude Include="..\..\..\..\include\generated\cpp98\x64\Release\IceSSL\ConnectionInfoF.h">
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+ </ClInclude>
<ClInclude Include="..\..\..\..\include\generated\cpp98\x64\Release\IceSSL\EndpointInfo.h">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
diff --git a/cpp/src/IceSSL/msbuild/icessl/icessl.vcxproj.filters b/cpp/src/IceSSL/msbuild/icessl/icessl.vcxproj.filters
index c82244834e8..1dda8a9208c 100644
--- a/cpp/src/IceSSL/msbuild/icessl/icessl.vcxproj.filters
+++ b/cpp/src/IceSSL/msbuild/icessl/icessl.vcxproj.filters
@@ -66,6 +66,9 @@
<IceBuilder Include="..\..\..\..\..\slice\IceSSL\EndpointInfo.ice">
<Filter>Slice Files</Filter>
</IceBuilder>
+ <IceBuilder Include="..\..\..\..\..\slice\IceSSL\ConnectionInfoF.ice">
+ <Filter>Slice Files</Filter>
+ </IceBuilder>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\TrustManager.cpp">
@@ -95,15 +98,33 @@
<ClCompile Include="..\..\ConnectorI.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="..\..\Certificate.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
<ClCompile Include="..\..\AcceptorI.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\Util.cpp">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="..\..\SChannelPluginI.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\CertificateI.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\SChannelCertificateI.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Win32\Debug\ConnectionInfoF.cpp">
+ <Filter>Source Files\Win32\Debug</Filter>
+ </ClCompile>
+ <ClCompile Include="x64\Debug\ConnectionInfoF.cpp">
+ <Filter>Source Files\x64\Debug</Filter>
+ </ClCompile>
+ <ClCompile Include="Win32\Release\ConnectionInfoF.cpp">
+ <Filter>Source Files\Win32\Release</Filter>
+ </ClCompile>
+ <ClCompile Include="x64\Release\ConnectionInfoF.cpp">
+ <Filter>Source Files\x64\Release</Filter>
+ </ClCompile>
<ClCompile Include="Win32\Debug\ConnectionInfo.cpp">
<Filter>Source Files\Win32\Debug</Filter>
</ClCompile>
@@ -128,12 +149,6 @@
<ClCompile Include="x64\Release\EndpointInfo.cpp">
<Filter>Source Files\x64\Release</Filter>
</ClCompile>
- <ClCompile Include="..\..\SChannelCertificate.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="..\..\SChannelPluginI.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\Util.h">
@@ -184,6 +199,24 @@
<ClInclude Include="..\..\..\..\include\IceSSL\Plugin.h">
<Filter>Header Files</Filter>
</ClInclude>
+ <ClInclude Include="..\..\SChannelEngine.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\CertificateI.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\generated\cpp98\Win32\Debug\IceSSL\ConnectionInfoF.h">
+ <Filter>Header Files\Win32\Debug</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\generated\cpp98\x64\Debug\IceSSL\ConnectionInfoF.h">
+ <Filter>Header Files\x64\Debug</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\generated\cpp98\Win32\Release\IceSSL\ConnectionInfoF.h">
+ <Filter>Header Files\Win32\Release</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\generated\cpp98\x64\Release\IceSSL\ConnectionInfoF.h">
+ <Filter>Header Files\x64\Release</Filter>
+ </ClInclude>
<ClInclude Include="..\..\..\..\include\generated\cpp98\Win32\Debug\IceSSL\ConnectionInfo.h">
<Filter>Header Files\Win32\Debug</Filter>
</ClInclude>
@@ -208,11 +241,5 @@
<ClInclude Include="..\..\..\..\include\generated\cpp98\x64\Release\IceSSL\EndpointInfo.h">
<Filter>Header Files\x64\Release</Filter>
</ClInclude>
- <ClInclude Include="..\..\SChannelEngine.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="..\..\Certificate.h">
- <Filter>Header Files</Filter>
- </ClInclude>
</ItemGroup>
</Project> \ No newline at end of file
diff --git a/cpp/src/Slice/CPlusPlusUtil.cpp b/cpp/src/Slice/CPlusPlusUtil.cpp
index b65006e6c20..0a06db2ef8f 100644
--- a/cpp/src/Slice/CPlusPlusUtil.cpp
+++ b/cpp/src/Slice/CPlusPlusUtil.cpp
@@ -648,6 +648,20 @@ Slice::typeToString(const TypePtr& type, const StringList& metaData, int typeCtx
"::std::shared_ptr<void>",
"::std::shared_ptr<::Ice::Value>"
};
+
+ if((typeCtx & TypeContextLocal) != 0)
+ {
+ for(StringList::const_iterator i = metaData.begin(); i != metaData.end(); ++i)
+ {
+ const string cppType = "cpp:type:";
+ const string meta = *i;
+
+ if(meta.find(cppType) == 0)
+ {
+ return meta.substr(cppType.size());
+ }
+ }
+ }
BuiltinPtr builtin = BuiltinPtr::dynamicCast(type);
if(builtin)
diff --git a/cpp/src/Slice/JavaUtil.cpp b/cpp/src/Slice/JavaUtil.cpp
index cb99ca5da46..947cdbe0602 100644
--- a/cpp/src/Slice/JavaUtil.cpp
+++ b/cpp/src/Slice/JavaUtil.cpp
@@ -1115,11 +1115,12 @@ Slice::JavaCompatGenerator::getOptionalFormat(const TypePtr& type)
string
Slice::JavaCompatGenerator::typeToString(const TypePtr& type,
- TypeMode mode,
- const string& package,
- const StringList& metaData,
- bool formal,
- bool optional) const
+ TypeMode mode,
+ const string& package,
+ const StringList& metaData,
+ bool formal,
+ bool optional,
+ bool local) const
{
static const char* builtinTable[] =
{
@@ -1166,6 +1167,20 @@ Slice::JavaCompatGenerator::typeToString(const TypePtr& type,
"???",
"???"
};
+
+ if(local)
+ {
+ for(StringList::const_iterator i = metaData.begin(); i != metaData.end(); ++i)
+ {
+ const string javaType = "java:type:";
+ const string meta = *i;
+
+ if(meta.find(javaType) == 0)
+ {
+ return meta.substr(javaType.size());
+ }
+ }
+ }
if(!type)
{
@@ -1317,10 +1332,10 @@ Slice::JavaCompatGenerator::typeToString(const TypePtr& type,
string
Slice::JavaCompatGenerator::typeToObjectString(const TypePtr& type,
- TypeMode mode,
- const string& package,
- const StringList& metaData,
- bool formal) const
+ TypeMode mode,
+ const string& package,
+ const StringList& metaData,
+ bool formal) const
{
static const char* builtinTable[] =
{
@@ -3599,6 +3614,20 @@ Slice::JavaGenerator::typeToString(const TypePtr& type,
"???",
"???"
};
+
+ if(local)
+ {
+ for(StringList::const_iterator i = metaData.begin(); i != metaData.end(); ++i)
+ {
+ const string javaType = "java:type:";
+ const string meta = *i;
+
+ if(meta.find(javaType) == 0)
+ {
+ return meta.substr(javaType.size());
+ }
+ }
+ }
if(!type)
{
diff --git a/cpp/src/Slice/JavaUtil.h b/cpp/src/Slice/JavaUtil.h
index dfabec06025..ce16795bdb2 100644
--- a/cpp/src/Slice/JavaUtil.h
+++ b/cpp/src/Slice/JavaUtil.h
@@ -145,7 +145,7 @@ protected:
TypeModeReturn
};
std::string typeToString(const TypePtr&, TypeMode, const std::string& = std::string(),
- const StringList& = StringList(), bool = true, bool = false) const;
+ const StringList& = StringList(), bool = true, bool = false, bool = false) const;
//
// Get the Java object name for a type. For primitive types, this returns the
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp
index 930e188c6f2..9bed882cb1a 100644
--- a/cpp/src/slice2cpp/Gen.cpp
+++ b/cpp/src/slice2cpp/Gen.cpp
@@ -3146,7 +3146,10 @@ void
Slice::Gen::ObjectVisitor::emitDataMember(const DataMemberPtr& p)
{
string name = fixKwd(p->name());
- H << nl << typeToString(p->type(), p->optional(), p->getMetaData(), _useWstring) << ' ' << name << ';';
+ ContainerPtr container = p->container();
+ ClassDefPtr cl = ClassDefPtr::dynamicCast(container);
+ int typeContext = cl->isLocal() ? TypeContextLocal | _useWstring : _useWstring;
+ H << nl << typeToString(p->type(), p->optional(), p->getMetaData(), typeContext) << ' ' << name << ';';
}
void
@@ -3342,10 +3345,12 @@ Slice::Gen::ObjectVisitor::emitOneShotConstructor(const ClassDefPtr& p)
bool callBaseConstuctors = !(p->isAbstract() && virtualInheritance);
DataMemberList dataMembers = p->dataMembers();
+ int typeContext = p->isLocal() ? (_useWstring | TypeContextLocal) : _useWstring;
+
for(DataMemberList::const_iterator q = allDataMembers.begin(); q != allDataMembers.end(); ++q)
{
- string typeName = inputTypeToString((*q)->type(), (*q)->optional(), (*q)->getMetaData(), _useWstring);
+ string typeName = inputTypeToString((*q)->type(), (*q)->optional(), (*q)->getMetaData(), typeContext);
bool dataMember = std::find(dataMembers.begin(), dataMembers.end(), (*q)) != dataMembers.end();
allParamDecls.push_back(typeName + ((dataMember || callBaseConstuctors) ?
(" iceP_" + (*q)->name()) : (" /*iceP_" + (*q)->name() + "*/")));
@@ -6310,8 +6315,15 @@ void
Slice::Gen::Cpp11ObjectVisitor::emitDataMember(const DataMemberPtr& p)
{
string name = fixKwd(p->name());
- H << nl << typeToString(p->type(), p->optional(), p->getMetaData(),
- _useWstring | TypeContextCpp11) << ' ' << name;
+ int typeContext = _useWstring | TypeContextCpp11;
+ ContainerPtr container = p->container();
+ ClassDefPtr cl = ClassDefPtr::dynamicCast(container);
+ if(cl->isLocal())
+ {
+ typeContext |= TypeContextLocal;
+ }
+
+ H << nl << typeToString(p->type(), p->optional(), p->getMetaData(), typeContext) << ' ' << name;
string defaultValue = p->defaultValue();
if(!defaultValue.empty())
@@ -6447,7 +6459,7 @@ Slice::Gen::Cpp11LocalObjectVisitor::visitClassDefStart(const ClassDefPtr& p)
for(DataMemberList::const_iterator q = allDataMembers.begin(); q != allDataMembers.end(); ++q)
{
- string typeName = inputTypeToString((*q)->type(), (*q)->optional(), (*q)->getMetaData(), _useWstring);
+ string typeName = inputTypeToString((*q)->type(), (*q)->optional(), (*q)->getMetaData(), _useWstring | TypeContextLocal);
allTypes.push_back(typeName);
allParamDecls.push_back(typeName + " iceP_" + (*q)->name());
}
@@ -6458,7 +6470,7 @@ Slice::Gen::Cpp11LocalObjectVisitor::visitClassDefStart(const ClassDefPtr& p)
{
H << sp << nl << name << "() :";
H.inc();
- writeDataMemberInitializers(H, dataMembers, _useWstring | TypeContextCpp11);
+ writeDataMemberInitializers(H, dataMembers, _useWstring | TypeContextCpp11 | TypeContextLocal);
H.dec();
H << sb;
H << eb;
@@ -7443,11 +7455,16 @@ Slice::Gen::Cpp11ObjectVisitor::emitOneShotConstructor(const ClassDefPtr& p)
{
vector<string> allParamDecls;
DataMemberList dataMembers = p->dataMembers();
+
+ int typeContext = _useWstring | TypeContextCpp11;
+ if(p->isLocal())
+ {
+ typeContext |= TypeContextLocal;
+ }
for(DataMemberList::const_iterator q = allDataMembers.begin(); q != allDataMembers.end(); ++q)
{
- string typeName = inputTypeToString((*q)->type(), (*q)->optional(), (*q)->getMetaData(),
- _useWstring | TypeContextCpp11);
+ string typeName = inputTypeToString((*q)->type(), (*q)->optional(), (*q)->getMetaData(), typeContext);
allParamDecls.push_back(typeName + " iceP_" + (*q)->name());
}
diff --git a/cpp/src/slice2cs/CsUtil.cpp b/cpp/src/slice2cs/CsUtil.cpp
index 9f442018932..b2cd8c4efe8 100644
--- a/cpp/src/slice2cs/CsUtil.cpp
+++ b/cpp/src/slice2cs/CsUtil.cpp
@@ -261,7 +261,7 @@ Slice::CsGenerator::getStaticId(const TypePtr& type)
}
string
-Slice::CsGenerator::typeToString(const TypePtr& type, bool optional, bool local)
+Slice::CsGenerator::typeToString(const TypePtr& type, bool optional, bool local, const StringList& metaData)
{
if(!type)
{
@@ -305,6 +305,19 @@ Slice::CsGenerator::typeToString(const TypePtr& type, bool optional, bool local)
"Ice.Value"
};
+ if(local)
+ {
+ for(StringList::const_iterator i = metaData.begin(); i != metaData.end(); ++i)
+ {
+ const string clrType = "cs:type:";
+ const string meta = *i;
+ if(meta.find(clrType) == 0)
+ {
+ return meta.substr(clrType.size());
+ }
+ }
+ }
+
BuiltinPtr builtin = BuiltinPtr::dynamicCast(type);
if(builtin)
{
@@ -2539,6 +2552,20 @@ Slice::CsGenerator::MetaDataVisitor::validate(const ContainedPtr& cont)
}
}
}
+ else if(DataMemberPtr::dynamicCast(cont))
+ {
+ DataMemberPtr dataMember = DataMemberPtr::dynamicCast(cont);
+ StructPtr st = StructPtr::dynamicCast(dataMember->container());
+ ExceptionPtr ex = ExceptionPtr::dynamicCast(dataMember->container());
+ ClassDefPtr cl = ClassDefPtr::dynamicCast(dataMember->container());
+ bool isLocal = (st && st->isLocal()) || (ex && ex->isLocal()) || (cl && cl->isLocal());
+ static const string csTypePrefix = csPrefix + "type:";
+ if(isLocal && s.find(csTypePrefix) == 0)
+ {
+ newLocalMetaData.push_back(s);
+ continue;
+ }
+ }
static const string csAttributePrefix = csPrefix + "attribute:";
static const string csTie = csPrefix + "tie";
diff --git a/cpp/src/slice2cs/CsUtil.h b/cpp/src/slice2cs/CsUtil.h
index 93d09a979f2..d5ad2bea645 100644
--- a/cpp/src/slice2cs/CsUtil.h
+++ b/cpp/src/slice2cs/CsUtil.h
@@ -41,7 +41,7 @@ protected:
static std::string fixId(const ContainedPtr&, int = 0, bool = false);
static std::string getOptionalFormat(const TypePtr&);
static std::string getStaticId(const TypePtr&);
- static std::string typeToString(const TypePtr&, bool = false, bool = false);
+ static std::string typeToString(const TypePtr&, bool = false, bool = false, const StringList& = StringList());
static bool isClassType(const TypePtr&);
static bool isValueType(const TypePtr&);
diff --git a/cpp/src/slice2cs/Gen.cpp b/cpp/src/slice2cs/Gen.cpp
index c76e5385c86..a7b5016be1b 100644
--- a/cpp/src/slice2cs/Gen.cpp
+++ b/cpp/src/slice2cs/Gen.cpp
@@ -2296,7 +2296,7 @@ Slice::Gen::TypesVisitor::visitClassDefEnd(const ClassDefPtr& p)
for(DataMemberList::const_iterator d = allDataMembers.begin(); d != allDataMembers.end(); ++d)
{
string memberName = fixId((*d)->name(), DotNet::ICloneable);
- string memberType = typeToString((*d)->type(), (*d)->optional());
+ string memberType = typeToString((*d)->type(), (*d)->optional(), p->isLocal(), (*d)->getMetaData());
paramDecl.push_back(memberType + " " + memberName);
}
_out << paramDecl << epar;
@@ -3199,7 +3199,7 @@ Slice::Gen::TypesVisitor::visitDataMember(const DataMemberPtr& p)
emitDeprecate(p, cont, _out, "member");
- string type = typeToString(p->type(), isOptional, isLocal);
+ string type = typeToString(p->type(), isOptional, isLocal, p->getMetaData());
string propertyName = fixId(p->name(), baseTypes, isClass);
string dataMemberName;
if(isProperty)
diff --git a/cpp/src/slice2java/Gen.cpp b/cpp/src/slice2java/Gen.cpp
index 16d63924f8d..c8d42d95418 100644
--- a/cpp/src/slice2java/Gen.cpp
+++ b/cpp/src/slice2java/Gen.cpp
@@ -2563,7 +2563,7 @@ Slice::Gen::TypesVisitor::visitClassDefStart(const ClassDefPtr& p)
if(!(*d)->optional())
{
string memberName = fixKwd((*d)->name());
- string memberType = typeToString((*d)->type(), TypeModeMember, package, (*d)->getMetaData());
+ string memberType = typeToString((*d)->type(), TypeModeMember, package, (*d)->getMetaData(), true, false, p->isLocal());
paramDecl.push_back(memberType + " " + memberName);
}
}
@@ -2615,7 +2615,7 @@ Slice::Gen::TypesVisitor::visitClassDefStart(const ClassDefPtr& p)
for(DataMemberList::const_iterator d = allDataMembers.begin(); d != allDataMembers.end(); ++d)
{
string memberName = fixKwd((*d)->name());
- string memberType = typeToString((*d)->type(), TypeModeMember, package, (*d)->getMetaData());
+ string memberType = typeToString((*d)->type(), TypeModeMember, package, (*d)->getMetaData(), true, false, p->isLocal());
paramDecl.push_back(memberType + " " + memberName);
}
out << paramDecl << epar;
diff --git a/cpp/src/slice2java/GenCompat.cpp b/cpp/src/slice2java/GenCompat.cpp
index a6c8c7d1b4d..02a3256c840 100644
--- a/cpp/src/slice2java/GenCompat.cpp
+++ b/cpp/src/slice2java/GenCompat.cpp
@@ -2840,7 +2840,8 @@ Slice::GenCompat::TypesVisitor::visitClassDefStart(const ClassDefPtr& p)
if(!(*d)->optional())
{
string memberName = fixKwd((*d)->name());
- string memberType = typeToString((*d)->type(), TypeModeMember, package, (*d)->getMetaData());
+ string memberType = typeToString((*d)->type(), TypeModeMember, package, (*d)->getMetaData(),
+ true, false, p->isLocal());
paramDecl.push_back(memberType + " " + memberName);
}
}
@@ -2892,7 +2893,8 @@ Slice::GenCompat::TypesVisitor::visitClassDefStart(const ClassDefPtr& p)
for(DataMemberList::const_iterator d = allDataMembers.begin(); d != allDataMembers.end(); ++d)
{
string memberName = fixKwd((*d)->name());
- string memberType = typeToString((*d)->type(), TypeModeMember, package, (*d)->getMetaData());
+ string memberType = typeToString((*d)->type(), TypeModeMember, package, (*d)->getMetaData(), true,
+ false, p->isLocal());
paramDecl.push_back(memberType + " " + memberName);
}
out << paramDecl << epar;
@@ -3789,11 +3791,30 @@ void
Slice::GenCompat::TypesVisitor::visitDataMember(const DataMemberPtr& p)
{
string name = fixKwd(p->name());
- ContainerPtr container = p->container();
- ContainedPtr contained = ContainedPtr::dynamicCast(container);
+ const ContainerPtr container = p->container();
+ const ClassDefPtr cls = ClassDefPtr::dynamicCast(container);
+ const StructPtr st = StructPtr::dynamicCast(container);
+ const ExceptionPtr ex = ExceptionPtr::dynamicCast(container);
+ const ContainedPtr contained = ContainedPtr::dynamicCast(container);
StringList metaData = p->getMetaData();
TypePtr type = p->type();
- string s = typeToString(type, TypeModeMember, getPackage(contained), metaData);
+
+ bool local;
+ if(cls)
+ {
+ local = cls->isLocal();
+ }
+ else if(st)
+ {
+ local = st->isLocal();
+ }
+ else
+ {
+ assert(ex);
+ local = ex->isLocal();
+ }
+
+ string s = typeToString(type, TypeModeMember, getPackage(contained), metaData, true, false, local);
Output& out = output();
const bool optional = p->optional();
const bool getSet = p->hasMetaData(_getSetMetaData) || contained->hasMetaData(_getSetMetaData);