zeroc-ice 3.8.1 → 3.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/dist/IceRuby/Communicator.cpp +26 -9
- data/dist/IceRuby/Config.h +0 -12
- data/dist/IceRuby/Connection.cpp +18 -9
- data/dist/IceRuby/DefaultSliceLoader.h +1 -1
- data/dist/IceRuby/Endpoint.cpp +21 -8
- data/dist/IceRuby/Operation.cpp +29 -11
- data/dist/IceRuby/Properties.cpp +3 -4
- data/dist/IceRuby/Proxy.cpp +11 -19
- data/dist/IceRuby/RubySliceLoader.cpp +1 -1
- data/dist/IceRuby/RubySliceLoader.h +6 -0
- data/dist/IceRuby/Types.cpp +162 -138
- data/dist/IceRuby/Types.h +68 -28
- data/dist/IceRuby/Util.cpp +14 -78
- data/dist/IceRuby/Util.h +7 -17
- data/dist/ice/cpp/include/Ice/Communicator.h +31 -8
- data/dist/ice/cpp/include/Ice/Config.h +2 -2
- data/dist/ice/cpp/include/Ice/Connection.h +24 -8
- data/dist/ice/cpp/include/Ice/CtrlCHandler.h +1 -1
- data/dist/ice/cpp/include/Ice/Demangle.h +1 -1
- data/dist/ice/cpp/include/Ice/Endpoint.h +4 -4
- data/dist/ice/cpp/include/Ice/Initialize.h +4 -4
- data/dist/ice/cpp/include/Ice/InputStream.h +5 -5
- data/dist/ice/cpp/include/Ice/Instrumentation.h +13 -7
- data/dist/ice/cpp/include/Ice/LocalExceptions.h +26 -5
- data/dist/ice/cpp/include/Ice/Logger.h +7 -0
- data/dist/ice/cpp/include/Ice/LoggerUtil.h +1 -1
- data/dist/ice/cpp/include/Ice/Object.h +10 -8
- data/dist/ice/cpp/include/Ice/ObjectAdapter.h +1 -1
- data/dist/ice/cpp/include/Ice/OutgoingAsync.h +5 -2
- data/dist/ice/cpp/include/Ice/OutgoingResponse.h +2 -1
- data/dist/ice/cpp/include/Ice/OutputStream.h +14 -11
- data/dist/ice/cpp/include/Ice/PluginFactory.h +1 -1
- data/dist/ice/cpp/include/Ice/Properties.h +3 -3
- data/dist/ice/cpp/include/Ice/Proxy.h +192 -50
- data/dist/ice/cpp/include/Ice/SSL/ClientAuthenticationOptions.h +3 -3
- data/dist/ice/cpp/include/Ice/SSL/EndpointInfo.h +1 -1
- data/dist/ice/cpp/include/Ice/SSL/ServerAuthenticationOptions.h +5 -5
- data/dist/ice/cpp/include/Ice/ServantLocator.h +1 -1
- data/dist/ice/cpp/include/Ice/Service.h +2 -5
- data/dist/ice/cpp/include/Ice/SliceLoader.h +1 -1
- data/dist/ice/cpp/include/Ice/SlicedData.h +5 -3
- data/dist/ice/cpp/include/Ice/StreamHelpers.h +1 -1
- data/dist/ice/cpp/include/Ice/StreamableTraits.h +2 -2
- data/dist/ice/cpp/include/Ice/StringConverter.h +2 -3
- data/dist/ice/cpp/include/Ice/StringUtil.h +2 -7
- data/dist/ice/cpp/include/Ice/UUID.h +1 -0
- data/dist/ice/cpp/include/Ice/Value.h +2 -2
- data/dist/ice/cpp/include/generated/Ice/BuiltinSequences.h +2 -2
- data/dist/ice/cpp/include/generated/Ice/Context.h +2 -2
- data/dist/ice/cpp/include/generated/Ice/EndpointTypes.h +2 -2
- data/dist/ice/cpp/include/generated/Ice/Identity.h +2 -2
- data/dist/ice/cpp/include/generated/Ice/Locator.h +57 -23
- data/dist/ice/cpp/include/generated/Ice/LocatorRegistry.h +38 -11
- data/dist/ice/cpp/include/generated/Ice/Metrics.h +99 -44
- data/dist/ice/cpp/include/generated/Ice/OperationMode.h +2 -2
- data/dist/ice/cpp/include/generated/Ice/Process.h +34 -8
- data/dist/ice/cpp/include/generated/Ice/PropertiesAdmin.h +42 -11
- data/dist/ice/cpp/include/generated/Ice/PropertyDict.h +2 -2
- data/dist/ice/cpp/include/generated/Ice/RemoteLogger.h +93 -40
- data/dist/ice/cpp/include/generated/Ice/ReplyStatus.h +8 -4
- data/dist/ice/cpp/include/generated/Ice/Router.h +55 -19
- data/dist/ice/cpp/include/generated/Ice/SliceChecksumDict.h +2 -2
- data/dist/ice/cpp/include/generated/Ice/Version.h +2 -2
- data/dist/ice/cpp/include/generated/IceDiscovery/Lookup.h +66 -14
- data/dist/ice/cpp/include/generated/IceLocatorDiscovery/Lookup.h +34 -8
- data/dist/ice/cpp/src/Ice/AddDefaultPluginFactories_all.cpp +1 -1
- data/dist/ice/cpp/src/Ice/Base64.cpp +47 -137
- data/dist/ice/cpp/src/Ice/Base64.h +2 -2
- data/dist/ice/cpp/src/Ice/BatchRequestQueue.cpp +28 -13
- data/dist/ice/cpp/src/Ice/BatchRequestQueue.h +5 -1
- data/dist/ice/cpp/src/Ice/Buffer.cpp +1 -1
- data/dist/ice/cpp/src/Ice/CollocatedRequestHandler.cpp +6 -4
- data/dist/ice/cpp/src/Ice/CollocatedRequestHandler.h +1 -1
- data/dist/ice/cpp/src/Ice/Communicator.cpp +4 -3
- data/dist/ice/cpp/src/Ice/CommunicatorFlushBatchAsync.cpp +8 -0
- data/dist/ice/cpp/src/Ice/ConnectRequestHandler.cpp +5 -15
- data/dist/ice/cpp/src/Ice/ConnectRequestHandler.h +1 -1
- data/dist/ice/cpp/src/Ice/ConnectionFactory.cpp +6 -8
- data/dist/ice/cpp/src/Ice/ConnectionFactory.h +0 -3
- data/dist/ice/cpp/src/Ice/ConnectionI.cpp +121 -108
- data/dist/ice/cpp/src/Ice/ConnectionI.h +12 -9
- data/dist/ice/cpp/src/Ice/ConsoleUtil.cpp +1 -1
- data/dist/ice/cpp/src/Ice/DefaultsAndOverrides.cpp +10 -14
- data/dist/ice/cpp/src/Ice/EndpointI.h +1 -1
- data/dist/ice/cpp/src/Ice/FileUtil.cpp +15 -79
- data/dist/ice/cpp/src/Ice/FileUtil.h +0 -3
- data/dist/ice/cpp/src/Ice/FixedRequestHandler.cpp +1 -1
- data/dist/ice/cpp/src/Ice/FixedRequestHandler.h +1 -1
- data/dist/ice/cpp/src/Ice/HttpParser.h +0 -2
- data/dist/ice/cpp/src/Ice/IPEndpointI.cpp +4 -0
- data/dist/ice/cpp/src/Ice/IdleTimeoutTransceiverDecorator.cpp +6 -3
- data/dist/ice/cpp/src/Ice/IncomingRequest.cpp +2 -4
- data/dist/ice/cpp/src/Ice/InputStream.cpp +50 -33
- data/dist/ice/cpp/src/Ice/Instance.cpp +73 -50
- data/dist/ice/cpp/src/Ice/Instance.h +1 -6
- data/dist/ice/cpp/src/Ice/LocalExceptions.cpp +7 -1
- data/dist/ice/cpp/src/Ice/LocatorInfo.cpp +2 -2
- data/dist/ice/cpp/src/Ice/LoggerAdminI.cpp +13 -18
- data/dist/ice/cpp/src/Ice/LoggerI.cpp +1 -1
- data/dist/ice/cpp/src/Ice/LoggerI.h +2 -2
- data/dist/ice/cpp/src/Ice/MetricsAdminI.h +6 -1
- data/dist/ice/cpp/src/Ice/MetricsObserverI.h +22 -18
- data/dist/ice/cpp/src/Ice/NativePropertiesAdmin.cpp +5 -2
- data/dist/ice/cpp/src/Ice/Network.cpp +168 -103
- data/dist/ice/cpp/src/Ice/Network.h +12 -7
- data/dist/ice/cpp/src/Ice/NetworkProxy.cpp +17 -6
- data/dist/ice/cpp/src/Ice/NetworkProxy.h +2 -1
- data/dist/ice/cpp/src/Ice/Object.cpp +1 -1
- data/dist/ice/cpp/src/Ice/ObjectAdapterI.cpp +56 -19
- data/dist/ice/cpp/src/Ice/OpaqueEndpointI.cpp +10 -10
- data/dist/ice/cpp/src/Ice/Options.cpp +7 -2
- data/dist/ice/cpp/src/Ice/OutgoingAsync.cpp +2 -2
- data/dist/ice/cpp/src/Ice/OutgoingResponse.cpp +127 -127
- data/dist/ice/cpp/src/Ice/OutgoingResponseInternal.h +21 -0
- data/dist/ice/cpp/src/Ice/OutputStream.cpp +50 -65
- data/dist/ice/cpp/src/Ice/PluginManagerI.cpp +7 -1
- data/dist/ice/cpp/src/Ice/Properties.cpp +26 -16
- data/dist/ice/cpp/src/Ice/PropertyNames.cpp +2 -1
- data/dist/ice/cpp/src/Ice/PropertyUtil.cpp +1 -1
- data/dist/ice/cpp/src/Ice/ProtocolInstance.cpp +0 -11
- data/dist/ice/cpp/src/Ice/ProtocolInstance.h +1 -2
- data/dist/ice/cpp/src/Ice/Proxy.cpp +9 -1
- data/dist/ice/cpp/src/Ice/ProxyAsync.cpp +110 -13
- data/dist/ice/cpp/src/Ice/ProxyFunctions.cpp +4 -4
- data/dist/ice/cpp/src/Ice/Random.cpp +68 -7
- data/dist/ice/cpp/src/Ice/Random.h +6 -2
- data/dist/ice/cpp/src/Ice/Reference.cpp +37 -26
- data/dist/ice/cpp/src/Ice/Reference.h +3 -0
- data/dist/ice/cpp/src/Ice/ReferenceFactory.cpp +26 -13
- data/dist/ice/cpp/src/Ice/RequestHandler.h +3 -1
- data/dist/ice/cpp/src/Ice/RequestHandlerCache.cpp +1 -1
- data/dist/ice/cpp/src/Ice/RequestHandlerCache.h +1 -1
- data/dist/ice/cpp/src/Ice/ResourceConfig.h +3 -3
- data/dist/ice/cpp/src/Ice/RetryQueue.cpp +8 -12
- data/dist/ice/cpp/src/Ice/SHA1.cpp +11 -11
- data/dist/ice/cpp/src/Ice/SSL/DistinguishedName.cpp +0 -6
- data/dist/ice/cpp/src/Ice/SSL/DistinguishedName.h +0 -6
- data/dist/ice/cpp/src/Ice/SSL/OpenSSLEngine.cpp +27 -12
- data/dist/ice/cpp/src/Ice/SSL/OpenSSLEngine.h +1 -2
- data/dist/ice/cpp/src/Ice/SSL/OpenSSLTransceiverI.cpp +77 -27
- data/dist/ice/cpp/src/Ice/SSL/OpenSSLTransceiverI.h +2 -1
- data/dist/ice/cpp/src/Ice/SSL/RFC2253.cpp +2 -2
- data/dist/ice/cpp/src/Ice/SSL/SSLEndpointI.cpp +1 -1
- data/dist/ice/cpp/src/Ice/SSL/SSLEngine.h +1 -4
- data/dist/ice/cpp/src/Ice/SSL/SSLUtil.cpp +39 -34
- data/dist/ice/cpp/src/Ice/SSL/SchannelEngine.cpp +165 -80
- data/dist/ice/cpp/src/Ice/SSL/SchannelEngine.h +1 -5
- data/dist/ice/cpp/src/Ice/SSL/SchannelTransceiverI.cpp +73 -33
- data/dist/ice/cpp/src/Ice/SSL/SchannelTransceiverI.h +0 -1
- data/dist/ice/cpp/src/Ice/SSL/SecureTransportEngine.cpp +110 -17
- data/dist/ice/cpp/src/Ice/SSL/SecureTransportEngine.h +7 -2
- data/dist/ice/cpp/src/Ice/SSL/SecureTransportTransceiverI.cpp +9 -3
- data/dist/ice/cpp/src/Ice/SSL/SecureTransportUtil.cpp +73 -51
- data/dist/ice/cpp/src/Ice/SSL/SecureTransportUtil.h +0 -8
- data/dist/ice/cpp/src/Ice/Selector.cpp +13 -11
- data/dist/ice/cpp/src/Ice/ServantManager.cpp +3 -3
- data/dist/ice/cpp/src/Ice/Service.cpp +33 -115
- data/dist/ice/cpp/src/Ice/StreamSocket.cpp +33 -40
- data/dist/ice/cpp/src/Ice/StreamSocket.h +4 -4
- data/dist/ice/cpp/src/Ice/StringConverter.cpp +1 -1
- data/dist/ice/cpp/src/Ice/StringUtil.cpp +12 -21
- data/dist/ice/cpp/src/Ice/SysLoggerI.cpp +136 -100
- data/dist/ice/cpp/src/Ice/SysLoggerI.h +7 -3
- data/dist/ice/cpp/src/Ice/SystemdJournalI.cpp +1 -1
- data/dist/ice/cpp/src/Ice/TcpAcceptor.cpp +7 -7
- data/dist/ice/cpp/src/Ice/TcpAcceptor.h +2 -1
- data/dist/ice/cpp/src/Ice/TcpBufSize.h +40 -0
- data/dist/ice/cpp/src/Ice/TcpConnector.cpp +5 -2
- data/dist/ice/cpp/src/Ice/TcpConnector.h +2 -0
- data/dist/ice/cpp/src/Ice/TcpEndpointI.cpp +2 -2
- data/dist/ice/cpp/src/Ice/TcpTransceiver.cpp +6 -2
- data/dist/ice/cpp/src/Ice/ThreadPool.cpp +2 -8
- data/dist/ice/cpp/src/Ice/ThreadPool.h +0 -2
- data/dist/ice/cpp/src/Ice/Timer.cpp +7 -3
- data/dist/ice/cpp/src/Ice/UUID.cpp +1 -2
- data/dist/ice/cpp/src/Ice/UdpEndpointI.cpp +6 -3
- data/dist/ice/cpp/src/Ice/UdpTransceiver.cpp +136 -123
- data/dist/ice/cpp/src/Ice/UdpTransceiver.h +3 -4
- data/dist/ice/cpp/src/Ice/WSAcceptor.cpp +8 -3
- data/dist/ice/cpp/src/Ice/WSAcceptor.h +5 -1
- data/dist/ice/cpp/src/Ice/WSEndpoint.cpp +45 -2
- data/dist/ice/cpp/src/Ice/WSTransceiver.cpp +214 -34
- data/dist/ice/cpp/src/Ice/WSTransceiver.h +13 -2
- data/dist/ice/cpp/src/Ice/generated/BuiltinSequences.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/Context.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/EndpointTypes.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/Identity.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/Locator.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/LocatorRegistry.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/Metrics.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/OperationMode.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/Process.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/PropertiesAdmin.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/PropertyDict.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/RemoteLogger.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/ReplyStatus.cpp +4 -2
- data/dist/ice/cpp/src/Ice/generated/Router.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/SliceChecksumDict.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/Version.cpp +2 -2
- data/dist/ice/cpp/src/IceDiscovery/LookupI.cpp +47 -9
- data/dist/ice/cpp/src/IceDiscovery/LookupI.h +8 -3
- data/dist/ice/cpp/src/IceDiscovery/generated/Lookup.cpp +2 -2
- data/dist/ice/cpp/src/IceLocatorDiscovery/PluginI.cpp +43 -14
- data/dist/ice/cpp/src/IceLocatorDiscovery/generated/Lookup.cpp +2 -2
- data/dist/ice/cpp/src/Slice/DocCommentParser.cpp +32 -26
- data/dist/ice/cpp/src/Slice/DocCommentParser.h +6 -4
- data/dist/ice/cpp/src/Slice/FileTracker.cpp +3 -11
- data/dist/ice/cpp/src/Slice/FileTracker.h +0 -2
- data/dist/ice/cpp/src/Slice/Grammar.cpp +211 -210
- data/dist/ice/cpp/src/Slice/MetadataValidation.cpp +34 -14
- data/dist/ice/cpp/src/Slice/MetadataValidation.h +3 -2
- data/dist/ice/cpp/src/Slice/Parser.cpp +145 -97
- data/dist/ice/cpp/src/Slice/Parser.h +22 -8
- data/dist/ice/cpp/src/Slice/Preprocessor.cpp +77 -29
- data/dist/ice/cpp/src/Slice/Preprocessor.h +0 -3
- data/dist/ice/cpp/src/Slice/Scanner.cpp +3 -3
- data/dist/ice/cpp/src/Slice/SliceUtil.cpp +203 -172
- data/dist/ice/cpp/src/Slice/StringLiteralUtil.cpp +0 -2
- data/dist/ice/cpp/src/Slice/Util.h +21 -12
- data/dist/ice/cpp/src/slice2rb/Ruby.cpp +7 -3
- data/dist/ice/cpp/src/slice2rb/RubyUtil.cpp +26 -20
- data/dist/ice/cpp/src/slice2rb/RubyUtil.h +10 -13
- data/dist/ice/slice/Glacier2/Router.ice +3 -3
- data/dist/ice/slice/Ice/Identity.ice +3 -0
- data/dist/ice/slice/Ice/Locator.ice +6 -5
- data/dist/ice/slice/Ice/LocatorRegistry.ice +3 -0
- data/dist/ice/slice/Ice/Metrics.ice +7 -6
- data/dist/ice/slice/Ice/OperationMode.ice +8 -0
- data/dist/ice/slice/Ice/Process.ice +3 -0
- data/dist/ice/slice/Ice/RemoteLogger.ice +5 -5
- data/dist/ice/slice/Ice/ReplyStatus.ice +13 -0
- data/dist/ice/slice/IceGrid/Admin.ice +9 -9
- data/dist/ice/slice/IceGrid/Descriptor.ice +5 -5
- data/dist/ice/slice/IceStorm/Metrics.ice +1 -1
- data/dist/lib/Glacier2/Metrics.rb +1 -1
- data/dist/lib/Glacier2/PermissionsVerifier.rb +3 -3
- data/dist/lib/Glacier2/Router.rb +9 -9
- data/dist/lib/Glacier2/SSLInfo.rb +1 -1
- data/dist/lib/Glacier2/Session.rb +15 -15
- data/dist/lib/Ice/BuiltinSequences.rb +1 -1
- data/dist/lib/Ice/CompressBatch.rb +1 -2
- data/dist/lib/Ice/Context.rb +1 -1
- data/dist/lib/Ice/EndpointSelectionType.rb +1 -2
- data/dist/lib/Ice/EndpointTypes.rb +1 -1
- data/dist/lib/Ice/Identity.rb +1 -1
- data/dist/lib/Ice/IdentitySpaceship.rb +1 -0
- data/dist/lib/Ice/LocalExceptions.rb +3 -0
- data/dist/lib/Ice/Locator.rb +5 -5
- data/dist/lib/Ice/LocatorRegistry.rb +4 -4
- data/dist/lib/Ice/Metrics.rb +7 -7
- data/dist/lib/Ice/OperationMode.rb +2 -3
- data/dist/lib/Ice/Process.rb +3 -3
- data/dist/lib/Ice/PropertiesAdmin.rb +4 -4
- data/dist/lib/Ice/PropertyDict.rb +1 -1
- data/dist/lib/Ice/ProxyFunctions.rb +8 -4
- data/dist/lib/Ice/RemoteLogger.rb +7 -8
- data/dist/lib/Ice/ReplyStatus.rb +4 -4
- data/dist/lib/Ice/Router.rb +5 -5
- data/dist/lib/Ice/SliceChecksumDict.rb +1 -1
- data/dist/lib/Ice/SliceUtil.rb +2 -2
- data/dist/lib/Ice/Struct.rb +1 -0
- data/dist/lib/Ice/ToStringMode.rb +1 -2
- data/dist/lib/Ice/Value.rb +2 -2
- data/dist/lib/Ice/Version.rb +1 -1
- data/dist/lib/IceBox/ServiceManager.rb +8 -8
- data/dist/lib/IceGrid/Admin.rb +85 -86
- data/dist/lib/IceGrid/Descriptor.rb +1 -1
- data/dist/lib/IceGrid/Exception.rb +1 -1
- data/dist/lib/IceGrid/FileParser.rb +2 -2
- data/dist/lib/IceGrid/Registry.rb +14 -15
- data/dist/lib/IceGrid/Session.rb +7 -7
- data/dist/lib/IceGrid/UserAccountMapper.rb +2 -2
- data/dist/lib/IceStorm/IceStorm.rb +16 -16
- data/dist/lib/IceStorm/Metrics.rb +1 -1
- data/extconf.rb +1 -1
- data/ice.gemspec +3 -3
- metadata +5 -5
- data/dist/ice/cpp/src/Ice/DLLMain.cpp +0 -40
- data/dist/ice/cpp/src/Ice/UndefSysMacros.h +0 -37
|
@@ -9,10 +9,17 @@
|
|
|
9
9
|
#include "Ice/Logger.h"
|
|
10
10
|
#include "Ice/Properties.h"
|
|
11
11
|
#include "Ice/SSL/SSLException.h"
|
|
12
|
+
#include "Ice/UUID.h"
|
|
12
13
|
#include "SSLEngine.h"
|
|
13
14
|
#include "SSLUtil.h"
|
|
14
15
|
#include "SecureTransportUtil.h"
|
|
15
16
|
|
|
17
|
+
#include <cerrno>
|
|
18
|
+
#include <climits>
|
|
19
|
+
#include <cstring>
|
|
20
|
+
#include <unistd.h>
|
|
21
|
+
#include <vector>
|
|
22
|
+
|
|
16
23
|
// Disable deprecation warnings from SecureTransport APIs
|
|
17
24
|
#include "../DisableWarnings.h"
|
|
18
25
|
|
|
@@ -27,8 +34,8 @@ namespace
|
|
|
27
34
|
//
|
|
28
35
|
// Retrieve the name of a cipher, SSLCipherSuite includes duplicated values for TLS/SSL
|
|
29
36
|
// protocol ciphers, for example SSL_RSA_WITH_RC4_128_MD5/TLS_RSA_WITH_RC4_128_MD5
|
|
30
|
-
// are represented by the same SSLCipherSuite value
|
|
31
|
-
//
|
|
37
|
+
// are represented by the same SSLCipherSuite value: the names returned by this method
|
|
38
|
+
// don't include a protocol prefix.
|
|
32
39
|
//
|
|
33
40
|
string cipherName(SSLCipherSuite cipher)
|
|
34
41
|
{
|
|
@@ -330,7 +337,7 @@ namespace
|
|
|
330
337
|
case TLS_PSK_WITH_AES_256_CBC_SHA384:
|
|
331
338
|
return "PSK_WITH_AES_256_CBC_SHA384";
|
|
332
339
|
case TLS_PSK_WITH_NULL_SHA256:
|
|
333
|
-
return "
|
|
340
|
+
return "PSK_WITH_NULL_SHA256";
|
|
334
341
|
case TLS_PSK_WITH_NULL_SHA384:
|
|
335
342
|
return "PSK_WITH_NULL_SHA384";
|
|
336
343
|
|
|
@@ -547,6 +554,43 @@ namespace
|
|
|
547
554
|
}
|
|
548
555
|
}
|
|
549
556
|
}
|
|
557
|
+
|
|
558
|
+
#if defined(ICE_USE_SECURE_TRANSPORT_MACOS)
|
|
559
|
+
// Creates a private temporary directory to hold a short-lived keychain, and returns its path.
|
|
560
|
+
// Uses confstr(_CS_DARWIN_USER_TEMP_DIR) rather than $TMPDIR so the location can't be
|
|
561
|
+
// redirected through the process environment.
|
|
562
|
+
string createTemporaryKeychainDirectory()
|
|
563
|
+
{
|
|
564
|
+
char base[PATH_MAX];
|
|
565
|
+
size_t len = confstr(_CS_DARWIN_USER_TEMP_DIR, base, sizeof(base));
|
|
566
|
+
if (len == 0 || len > sizeof(base))
|
|
567
|
+
{
|
|
568
|
+
int error = errno;
|
|
569
|
+
|
|
570
|
+
ostringstream os;
|
|
571
|
+
os << "SSL transport: confstr(_CS_DARWIN_USER_TEMP_DIR) failed";
|
|
572
|
+
if (error != 0)
|
|
573
|
+
{
|
|
574
|
+
os << ": " << strerror(error);
|
|
575
|
+
}
|
|
576
|
+
throw InitializationException(__FILE__, __LINE__, os.str());
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
string tmpl = string{base} + "ice-keychain-XXXXXX";
|
|
580
|
+
vector<char> buffer(tmpl.begin(), tmpl.end());
|
|
581
|
+
buffer.push_back('\0');
|
|
582
|
+
|
|
583
|
+
char* dir = mkdtemp(buffer.data());
|
|
584
|
+
if (dir == nullptr)
|
|
585
|
+
{
|
|
586
|
+
int error = errno;
|
|
587
|
+
ostringstream os;
|
|
588
|
+
os << "SSL transport: mkdtemp failed: " << strerror(error);
|
|
589
|
+
throw InitializationException(__FILE__, __LINE__, os.str());
|
|
590
|
+
}
|
|
591
|
+
return dir;
|
|
592
|
+
}
|
|
593
|
+
#endif
|
|
550
594
|
}
|
|
551
595
|
|
|
552
596
|
SecureTransport::SSLEngine::SSLEngine(const IceInternal::InstancePtr& instance)
|
|
@@ -556,7 +600,25 @@ SecureTransport::SSLEngine::SSLEngine(const IceInternal::InstancePtr& instance)
|
|
|
556
600
|
{
|
|
557
601
|
}
|
|
558
602
|
|
|
559
|
-
SecureTransport::SSLEngine::~SSLEngine()
|
|
603
|
+
SecureTransport::SSLEngine::~SSLEngine()
|
|
604
|
+
{
|
|
605
|
+
#if defined(ICE_USE_SECURE_TRANSPORT_MACOS)
|
|
606
|
+
if (!_temporaryKeychainDir.empty())
|
|
607
|
+
{
|
|
608
|
+
// Remove the temporary keychain and its enclosing directory created by initialize().
|
|
609
|
+
// The cleanup lives in the destructor (not destroy()) so it also runs when initialize()
|
|
610
|
+
// throws after the directory has been created.
|
|
611
|
+
_chain.reset();
|
|
612
|
+
const string keychainPath = _temporaryKeychainDir + "/ice.keychain";
|
|
613
|
+
UniqueRef<SecKeychainRef> keychain;
|
|
614
|
+
if (SecKeychainOpen(keychainPath.c_str(), &keychain.get()) == noErr && keychain.get())
|
|
615
|
+
{
|
|
616
|
+
SecKeychainDelete(keychain.get());
|
|
617
|
+
}
|
|
618
|
+
rmdir(_temporaryKeychainDir.c_str());
|
|
619
|
+
}
|
|
620
|
+
#endif
|
|
621
|
+
}
|
|
560
622
|
|
|
561
623
|
//
|
|
562
624
|
// Setup the engine.
|
|
@@ -636,6 +698,18 @@ SecureTransport::SSLEngine::initialize()
|
|
|
636
698
|
keyFile = *resolved;
|
|
637
699
|
}
|
|
638
700
|
|
|
701
|
+
#if defined(ICE_USE_SECURE_TRANSPORT_MACOS)
|
|
702
|
+
if (keychain.empty())
|
|
703
|
+
{
|
|
704
|
+
// Import the certificate into a temporary keychain rather than the user's login keychain.
|
|
705
|
+
// A private key in the login keychain cannot complete a forward-secret (ECDHE) handshake
|
|
706
|
+
// on the server side. The keychain and its enclosing directory are removed by the destructor.
|
|
707
|
+
_temporaryKeychainDir = createTemporaryKeychainDirectory();
|
|
708
|
+
keychain = _temporaryKeychainDir + "/ice.keychain";
|
|
709
|
+
keychainPassword = Ice::generateUUID();
|
|
710
|
+
}
|
|
711
|
+
#endif
|
|
712
|
+
|
|
639
713
|
try
|
|
640
714
|
{
|
|
641
715
|
_chain.reset(loadCertificateChain(certFile, keyFile, keychain, keychainPassword, password));
|
|
@@ -651,14 +725,6 @@ SecureTransport::SSLEngine::initialize()
|
|
|
651
725
|
}
|
|
652
726
|
}
|
|
653
727
|
|
|
654
|
-
//
|
|
655
|
-
// Destroy the engine.
|
|
656
|
-
//
|
|
657
|
-
void
|
|
658
|
-
SecureTransport::SSLEngine::destroy()
|
|
659
|
-
{
|
|
660
|
-
}
|
|
661
|
-
|
|
662
728
|
ClientAuthenticationOptions
|
|
663
729
|
SecureTransport::SSLEngine::createClientAuthenticationOptions(const string& host) const
|
|
664
730
|
{
|
|
@@ -721,15 +787,15 @@ SecureTransport::SSLEngine::createServerAuthenticationOptions() const
|
|
|
721
787
|
SSLContextRef
|
|
722
788
|
SecureTransport::SSLEngine::newContext(bool incoming) const
|
|
723
789
|
{
|
|
724
|
-
SSLContextRef ssl
|
|
725
|
-
SSLCreateContext(kCFAllocatorDefault, incoming ? kSSLServerSide : kSSLClientSide, kSSLStreamType);
|
|
726
|
-
if (!ssl)
|
|
790
|
+
UniqueRef<SSLContextRef> ssl(
|
|
791
|
+
SSLCreateContext(kCFAllocatorDefault, incoming ? kSSLServerSide : kSSLClientSide, kSSLStreamType));
|
|
792
|
+
if (!ssl.get())
|
|
727
793
|
{
|
|
728
794
|
throw SecurityException(__FILE__, __LINE__, "SSL transport: unable to create SSL context");
|
|
729
795
|
}
|
|
730
796
|
|
|
731
797
|
OSStatus err = SSLSetSessionOption(
|
|
732
|
-
ssl,
|
|
798
|
+
ssl.get(),
|
|
733
799
|
incoming ? kSSLSessionOptionBreakOnClientAuth : kSSLSessionOptionBreakOnServerAuth,
|
|
734
800
|
true);
|
|
735
801
|
|
|
@@ -741,7 +807,34 @@ SecureTransport::SSLEngine::newContext(bool incoming) const
|
|
|
741
807
|
"SSL transport: error while setting SSL option:\n" + sslErrorToString(err));
|
|
742
808
|
}
|
|
743
809
|
|
|
744
|
-
|
|
810
|
+
// Require TLS 1.2 or later. SecureTransport otherwise negotiates down to TLS 1.0 on macOS.
|
|
811
|
+
err = SSLSetProtocolVersionMin(ssl.get(), kTLSProtocol12);
|
|
812
|
+
if (err != noErr)
|
|
813
|
+
{
|
|
814
|
+
throw SecurityException(
|
|
815
|
+
__FILE__,
|
|
816
|
+
__LINE__,
|
|
817
|
+
"SSL transport: error while setting the minimum protocol version:\n" + sslErrorToString(err));
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
// Enable only forward-secret cipher suites: the Mozilla "Intermediate" recommendation for TLS 1.2
|
|
821
|
+
// intersected with what SecureTransport can negotiate — ECDHE key exchange with AES-GCM.
|
|
822
|
+
// SecureTransport's own default set also includes static-RSA suites (no forward secrecy) and 3DES.
|
|
823
|
+
const SSLCipherSuite ciphers[] = {
|
|
824
|
+
TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
|
|
825
|
+
TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
|
|
826
|
+
TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
|
|
827
|
+
TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384};
|
|
828
|
+
err = SSLSetEnabledCiphers(ssl.get(), ciphers, sizeof(ciphers) / sizeof(SSLCipherSuite));
|
|
829
|
+
if (err != noErr)
|
|
830
|
+
{
|
|
831
|
+
throw SecurityException(
|
|
832
|
+
__FILE__,
|
|
833
|
+
__LINE__,
|
|
834
|
+
"SSL transport: error while setting ciphers:\n" + sslErrorToString(err));
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
return ssl.release();
|
|
745
838
|
}
|
|
746
839
|
|
|
747
840
|
bool
|
|
@@ -20,10 +20,9 @@ namespace Ice::SSL::SecureTransport
|
|
|
20
20
|
{
|
|
21
21
|
public:
|
|
22
22
|
SSLEngine(const IceInternal::InstancePtr&);
|
|
23
|
-
~SSLEngine();
|
|
23
|
+
~SSLEngine() override;
|
|
24
24
|
|
|
25
25
|
void initialize() final;
|
|
26
|
-
void destroy() final;
|
|
27
26
|
|
|
28
27
|
[[nodiscard]] Ice::SSL::ClientAuthenticationOptions
|
|
29
28
|
createClientAuthenticationOptions(const std::string& host) const final;
|
|
@@ -37,6 +36,12 @@ namespace Ice::SSL::SecureTransport
|
|
|
37
36
|
private:
|
|
38
37
|
IceInternal::UniqueRef<CFArrayRef> _certificateAuthorities;
|
|
39
38
|
IceInternal::UniqueRef<CFArrayRef> _chain;
|
|
39
|
+
|
|
40
|
+
# if defined(ICE_USE_SECURE_TRANSPORT_MACOS)
|
|
41
|
+
// Path of the temporary directory holding the imported certificate's keychain, removed by the destructor.
|
|
42
|
+
// Empty when IceSSL.Keychain is set or no certificate is configured.
|
|
43
|
+
std::string _temporaryKeychainDir;
|
|
44
|
+
# endif
|
|
40
45
|
};
|
|
41
46
|
}
|
|
42
47
|
#endif
|
|
@@ -229,7 +229,7 @@ Ice::SSL::SecureTransport::TransceiverI::initialize(IceInternal::Buffer& readBuf
|
|
|
229
229
|
continue; // Call SSLHandshake to resume the handshake.
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
|
-
// Let it fall through, this will
|
|
232
|
+
// Let it fall through, this will throw a ProtocolException with the SSLCopyPeerTrust error.
|
|
233
233
|
}
|
|
234
234
|
else if (err == errSSLClosedGraceful || err == errSSLClosedAbort)
|
|
235
235
|
{
|
|
@@ -245,6 +245,12 @@ Ice::SSL::SecureTransport::TransceiverI::initialize(IceInternal::Buffer& readBuf
|
|
|
245
245
|
|
|
246
246
|
assert(_ssl);
|
|
247
247
|
|
|
248
|
+
if (!_peerCertificate)
|
|
249
|
+
{
|
|
250
|
+
_engine->verifyPeer(dynamic_pointer_cast<ConnectionInfo>(getInfo(_incoming, _adapterName, "")));
|
|
251
|
+
}
|
|
252
|
+
// else verifyPeer is called from the certificate validation callback.
|
|
253
|
+
|
|
248
254
|
if (_instance->engine()->securityTraceLevel() >= 1)
|
|
249
255
|
{
|
|
250
256
|
Trace out(_instance->logger(), _engine->securityTraceCategory());
|
|
@@ -345,7 +351,7 @@ Ice::SSL::SecureTransport::TransceiverI::write(IceInternal::Buffer& buf)
|
|
|
345
351
|
}
|
|
346
352
|
|
|
347
353
|
//
|
|
348
|
-
// SSL protocol errors
|
|
354
|
+
// SSL protocol errors defined in SecureTransport.h are in the range
|
|
349
355
|
// -9800 to -9849
|
|
350
356
|
//
|
|
351
357
|
if (err <= -9800 && err >= -9849)
|
|
@@ -418,7 +424,7 @@ Ice::SSL::SecureTransport::TransceiverI::read(IceInternal::Buffer& buf)
|
|
|
418
424
|
}
|
|
419
425
|
|
|
420
426
|
//
|
|
421
|
-
// SSL protocol errors
|
|
427
|
+
// SSL protocol errors defined in SecureTransport.h are in the range
|
|
422
428
|
// -9800 to -9849
|
|
423
429
|
//
|
|
424
430
|
if (err <= -9800 && err >= -9849)
|
|
@@ -206,25 +206,6 @@ Ice::SSL::SecureTransport::sslErrorToString(OSStatus status)
|
|
|
206
206
|
}
|
|
207
207
|
|
|
208
208
|
#if defined(ICE_USE_SECURE_TRANSPORT_MACOS)
|
|
209
|
-
CFDictionaryRef
|
|
210
|
-
Ice::SSL::SecureTransport::getCertificateProperty(SecCertificateRef cert, CFTypeRef key)
|
|
211
|
-
{
|
|
212
|
-
UniqueRef<CFDictionaryRef> property;
|
|
213
|
-
UniqueRef<CFArrayRef> keys(CFArrayCreate(nullptr, &key, 1, &kCFTypeArrayCallBacks));
|
|
214
|
-
UniqueRef<CFErrorRef> err;
|
|
215
|
-
UniqueRef<CFDictionaryRef> values(SecCertificateCopyValues(cert, keys.get(), &err.get()));
|
|
216
|
-
if (err)
|
|
217
|
-
{
|
|
218
|
-
ostringstream os;
|
|
219
|
-
os << "SSL transport: error getting property for certificate:\n" << sslErrorToString(err);
|
|
220
|
-
throw CertificateReadException(__FILE__, __LINE__, os.str());
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
assert(values);
|
|
224
|
-
property.retain(static_cast<CFDictionaryRef>(CFDictionaryGetValue(values.get(), key)));
|
|
225
|
-
return property.release();
|
|
226
|
-
}
|
|
227
|
-
|
|
228
209
|
namespace
|
|
229
210
|
{
|
|
230
211
|
//
|
|
@@ -264,12 +245,10 @@ namespace
|
|
|
264
245
|
memset(¶ms, 0, sizeof(params));
|
|
265
246
|
params.version = SEC_KEY_IMPORT_EXPORT_PARAMS_VERSION;
|
|
266
247
|
params.flags |= kSecKeyNoAccessControl;
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
params.passphrase = passphraseHolder.get();
|
|
272
|
-
}
|
|
248
|
+
// Always pass a passphrase, even an empty one: SecItemImport rejects a PKCS12 file with
|
|
249
|
+
// errSecPassphraseRequired when params.passphrase is null, without looking at the file contents.
|
|
250
|
+
UniqueRef<CFStringRef> passphraseHolder(toCFString(passphrase));
|
|
251
|
+
params.passphrase = passphraseHolder.get();
|
|
273
252
|
|
|
274
253
|
UniqueRef<CFArrayRef> items;
|
|
275
254
|
SecExternalItemType importType = type;
|
|
@@ -277,6 +256,26 @@ namespace
|
|
|
277
256
|
UniqueRef<CFStringRef> path(toCFString(file));
|
|
278
257
|
OSStatus err = SecItemImport(data.get(), path.get(), &format, &importType, 0, ¶ms, keychain, &items.get());
|
|
279
258
|
|
|
259
|
+
if (err == errSecPkcs12VerifyFailure && passphrase.empty())
|
|
260
|
+
{
|
|
261
|
+
// There are two encodings of the empty PKCS12 password, and they derive different keys. RFC 7292
|
|
262
|
+
// appendix B.1 formats every password as a NULL-terminated UTF-16BE string, which makes the empty
|
|
263
|
+
// password two 0x00 bytes; appendix B.2 step 3 instead notes that an empty password gives an empty
|
|
264
|
+
// block. openssl and keytool write the first, .NET writes either one depending on whether the
|
|
265
|
+
// password is "" or null.
|
|
266
|
+
//
|
|
267
|
+
// SecItemImport reads a CFString passphrase as the second encoding and a CFData passphrase as the
|
|
268
|
+
// raw password bytes, so retry with the two bytes appendix B.1 asks for. This mirrors .NET's own
|
|
269
|
+
// PKCS12 reader, which retries the other encoding when MAC verification fails.
|
|
270
|
+
const uint8_t emptyPassword[2] = {0, 0};
|
|
271
|
+
UniqueRef<CFDataRef> dataPassphrase(
|
|
272
|
+
CFDataCreate(kCFAllocatorDefault, emptyPassword, sizeof(emptyPassword)));
|
|
273
|
+
params.passphrase = dataPassphrase.get();
|
|
274
|
+
importType = type;
|
|
275
|
+
format = type == kSecItemTypeUnknown ? kSecFormatPKCS12 : kSecFormatUnknown;
|
|
276
|
+
err = SecItemImport(data.get(), path.get(), &format, &importType, 0, ¶ms, keychain, &items.get());
|
|
277
|
+
}
|
|
278
|
+
|
|
280
279
|
if (err != noErr)
|
|
281
280
|
{
|
|
282
281
|
ostringstream os;
|
|
@@ -421,6 +420,20 @@ namespace
|
|
|
421
420
|
}
|
|
422
421
|
}
|
|
423
422
|
|
|
423
|
+
// A certificate must expose a Subject Key Identifier to be imported into the keychain: the SKI is used
|
|
424
|
+
// both to locate an already-imported certificate (the query below) and as the key label that pairs the
|
|
425
|
+
// private key with the certificate (further down). Reject a certificate without one with a clear error
|
|
426
|
+
// instead of passing a null value to CFDictionarySetValue, which aborts the process. Certificates without
|
|
427
|
+
// a Subject Key Identifier are uncommon in practice, so rejecting them is acceptable.
|
|
428
|
+
if (!hash)
|
|
429
|
+
{
|
|
430
|
+
throw CertificateReadException(
|
|
431
|
+
__FILE__,
|
|
432
|
+
__LINE__,
|
|
433
|
+
"SSL transport: the certificate for key file '" + file +
|
|
434
|
+
"' has no Subject Key Identifier extension and cannot be imported into the macOS keychain");
|
|
435
|
+
}
|
|
436
|
+
|
|
424
437
|
const void* values[] = {keychain};
|
|
425
438
|
UniqueRef<CFArrayRef> searchList(CFArrayCreate(kCFAllocatorDefault, values, 1, &kCFTypeArrayCallBacks));
|
|
426
439
|
|
|
@@ -510,8 +523,8 @@ namespace
|
|
|
510
523
|
// kSecKeyLabel attribute should match the subject key identifier.
|
|
511
524
|
//
|
|
512
525
|
vector<SecKeychainAttribute> attributes;
|
|
513
|
-
if (hash)
|
|
514
526
|
{
|
|
527
|
+
// hash is guaranteed non-null here: loadPrivateKey rejects certificates without a Subject Key Identifier.
|
|
515
528
|
SecKeychainAttribute attr;
|
|
516
529
|
attr.tag = kSecKeyLabel;
|
|
517
530
|
attr.data = const_cast<UInt8*>(CFDataGetBytePtr(hash.get()));
|
|
@@ -536,7 +549,7 @@ namespace
|
|
|
536
549
|
}
|
|
537
550
|
|
|
538
551
|
SecKeychainAttributeList attrs;
|
|
539
|
-
attrs.attr =
|
|
552
|
+
attrs.attr = attributes.data();
|
|
540
553
|
attrs.count = static_cast<UInt32>(attributes.size());
|
|
541
554
|
SecKeychainItemModifyAttributesAndData(reinterpret_cast<SecKeychainItemRef>(key.get()), &attrs, 0, nullptr);
|
|
542
555
|
|
|
@@ -594,10 +607,21 @@ namespace
|
|
|
594
607
|
break;
|
|
595
608
|
}
|
|
596
609
|
|
|
597
|
-
vector<byte> data
|
|
610
|
+
vector<std::byte> data;
|
|
611
|
+
try
|
|
612
|
+
{
|
|
613
|
+
data = IceInternal::Base64::decode(string(&buffer[startpos], size));
|
|
614
|
+
}
|
|
615
|
+
catch (const std::invalid_argument&)
|
|
616
|
+
{
|
|
617
|
+
throw InitializationException(
|
|
618
|
+
__FILE__,
|
|
619
|
+
__LINE__,
|
|
620
|
+
"SSL transport: certificate " + file + " is not a valid PEM-encoded certificate");
|
|
621
|
+
}
|
|
598
622
|
UniqueRef<CFDataRef> certdata(CFDataCreate(
|
|
599
623
|
kCFAllocatorDefault,
|
|
600
|
-
reinterpret_cast<uint8_t*>(
|
|
624
|
+
reinterpret_cast<uint8_t*>(data.data()),
|
|
601
625
|
static_cast<CFIndex>(data.size())));
|
|
602
626
|
UniqueRef<SecCertificateRef> cert(SecCertificateCreateWithData(0, certdata.get()));
|
|
603
627
|
if (!cert)
|
|
@@ -681,7 +705,7 @@ Ice::SSL::SecureTransport::loadCertificateChain(
|
|
|
681
705
|
if (!chain)
|
|
682
706
|
{
|
|
683
707
|
ostringstream os;
|
|
684
|
-
os << "SSL transport:
|
|
708
|
+
os << "SSL transport: could not find identity in file " << file;
|
|
685
709
|
throw InitializationException(__FILE__, __LINE__, os.str());
|
|
686
710
|
}
|
|
687
711
|
#else
|
|
@@ -698,7 +722,7 @@ Ice::SSL::SecureTransport::loadCertificateChain(
|
|
|
698
722
|
if (SecCertificateGetTypeID() != CFGetTypeID(cert))
|
|
699
723
|
{
|
|
700
724
|
ostringstream os;
|
|
701
|
-
os << "SSL transport:
|
|
725
|
+
os << "SSL transport: could not find certificate in '" << file << "'";
|
|
702
726
|
throw CertificateReadException(__FILE__, __LINE__, os.str());
|
|
703
727
|
}
|
|
704
728
|
|
|
@@ -715,21 +739,6 @@ Ice::SSL::SecureTransport::loadCertificateChain(
|
|
|
715
739
|
return chain.release();
|
|
716
740
|
}
|
|
717
741
|
|
|
718
|
-
SecCertificateRef
|
|
719
|
-
Ice::SSL::SecureTransport::loadCertificate(const string& file)
|
|
720
|
-
{
|
|
721
|
-
UniqueRef<SecCertificateRef> cert;
|
|
722
|
-
#if defined(ICE_USE_SECURE_TRANSPORT_IOS)
|
|
723
|
-
UniqueRef<CFArrayRef> certs(loadCerts(file));
|
|
724
|
-
assert(CFArrayGetCount(certs.get()) > 0);
|
|
725
|
-
cert.retain((SecCertificateRef)CFArrayGetValueAtIndex(certs.get(), 0));
|
|
726
|
-
#else
|
|
727
|
-
UniqueRef<CFArrayRef> items(loadKeychainItems(file, kSecItemTypeCertificate, nullptr, ""));
|
|
728
|
-
cert.retain((SecCertificateRef)CFArrayGetValueAtIndex(items.get(), 0));
|
|
729
|
-
#endif
|
|
730
|
-
return cert.release();
|
|
731
|
-
}
|
|
732
|
-
|
|
733
742
|
CFArrayRef
|
|
734
743
|
Ice::SSL::SecureTransport::loadCACertificates(const string& file)
|
|
735
744
|
{
|
|
@@ -857,7 +866,8 @@ Ice::SSL::SecureTransport::findCertificateChain(
|
|
|
857
866
|
{
|
|
858
867
|
throw InitializationException(__FILE__, __LINE__, "SSL transport: invalid value '" + value + "'");
|
|
859
868
|
}
|
|
860
|
-
UniqueRef<CFDataRef> v(
|
|
869
|
+
UniqueRef<CFDataRef> v(
|
|
870
|
+
CFDataCreate(kCFAllocatorDefault, buffer.data(), static_cast<CFIndex>(buffer.size())));
|
|
861
871
|
CFDictionarySetValue(
|
|
862
872
|
query.get(),
|
|
863
873
|
field == "SUBJECTKEYID" ? kSecAttrSubjectKeyID : kSecAttrSerialNumber,
|
|
@@ -932,16 +942,28 @@ Ice::SSL::SecureTransport::findCertificateChain(
|
|
|
932
942
|
if (err != noErr)
|
|
933
943
|
{
|
|
934
944
|
ostringstream os;
|
|
935
|
-
os << "SSL transport:
|
|
945
|
+
os << "SSL transport: could not create identity for certificate found in the keychain:\n"
|
|
936
946
|
<< sslErrorToString(err);
|
|
937
947
|
throw InitializationException(__FILE__, __LINE__, os.str());
|
|
938
948
|
}
|
|
939
949
|
|
|
940
|
-
// Now lookup the identity with the label
|
|
950
|
+
// Now lookup the identity with the label. We match the identity by the certificate's label, so the
|
|
951
|
+
// certificate must have one; reject it with a clear error rather than passing a null value to
|
|
952
|
+
// CFDictionarySetValue (which aborts the process).
|
|
953
|
+
const void* label = CFDictionaryGetValue(attributes.get(), kSecAttrLabel);
|
|
954
|
+
if (label == nullptr)
|
|
955
|
+
{
|
|
956
|
+
throw InitializationException(
|
|
957
|
+
__FILE__,
|
|
958
|
+
__LINE__,
|
|
959
|
+
"SSL transport: could not create identity for certificate found in the keychain: the certificate has no "
|
|
960
|
+
"label attribute");
|
|
961
|
+
}
|
|
962
|
+
|
|
941
963
|
query.reset(CFDictionaryCreateMutable(0, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
|
|
942
964
|
CFDictionarySetValue(query.get(), kSecMatchLimit, kSecMatchLimitOne);
|
|
943
965
|
CFDictionarySetValue(query.get(), kSecClass, kSecClassIdentity);
|
|
944
|
-
CFDictionarySetValue(query.get(), kSecAttrLabel,
|
|
966
|
+
CFDictionarySetValue(query.get(), kSecAttrLabel, label);
|
|
945
967
|
CFDictionarySetValue(query.get(), kSecReturnRef, kCFBooleanTrue);
|
|
946
968
|
err = SecItemCopyMatching(query.get(), (CFTypeRef*)&identity.get());
|
|
947
969
|
if (err == noErr)
|
|
@@ -958,7 +980,7 @@ Ice::SSL::SecureTransport::findCertificateChain(
|
|
|
958
980
|
if (err != noErr)
|
|
959
981
|
{
|
|
960
982
|
ostringstream os;
|
|
961
|
-
os << "SSL transport:
|
|
983
|
+
os << "SSL transport: could not create identity for certificate found in the keychain:\n"
|
|
962
984
|
<< sslErrorToString(err);
|
|
963
985
|
throw InitializationException(__FILE__, __LINE__, os.str());
|
|
964
986
|
}
|
|
@@ -13,13 +13,6 @@ namespace Ice::SSL::SecureTransport
|
|
|
13
13
|
std::string sslErrorToString(CFErrorRef);
|
|
14
14
|
std::string sslErrorToString(OSStatus);
|
|
15
15
|
|
|
16
|
-
# if defined(ICE_USE_SECURE_TRANSPORT_MACOS)
|
|
17
|
-
//
|
|
18
|
-
// Retrieve a certificate property
|
|
19
|
-
//
|
|
20
|
-
CFDictionaryRef getCertificateProperty(SecCertificateRef, CFTypeRef);
|
|
21
|
-
# endif
|
|
22
|
-
|
|
23
16
|
//
|
|
24
17
|
// Read certificate from a file.
|
|
25
18
|
//
|
|
@@ -30,7 +23,6 @@ namespace Ice::SSL::SecureTransport
|
|
|
30
23
|
const std::string&,
|
|
31
24
|
const std::string&);
|
|
32
25
|
|
|
33
|
-
SecCertificateRef loadCertificate(const std::string&);
|
|
34
26
|
ICE_API CFArrayRef loadCACertificates(const std::string&);
|
|
35
27
|
ICE_API CFArrayRef findCertificateChain(const std::string&, const std::string&, const std::string&);
|
|
36
28
|
|
|
@@ -127,10 +127,10 @@ Selector::getNextHandler(SocketOperation& status, DWORD& count, int& error, int
|
|
|
127
127
|
}
|
|
128
128
|
else
|
|
129
129
|
{
|
|
130
|
-
// This indicates
|
|
130
|
+
// This indicates an internal error with the IOCP completion port, we log the error and abort.
|
|
131
131
|
Ice::SocketException ex(__FILE__, __LINE__, err);
|
|
132
132
|
Ice::Error out(_instance->initializationData().logger);
|
|
133
|
-
out << "
|
|
133
|
+
out << "could not dequeue packet from completion port:\n" << ex;
|
|
134
134
|
std::abort();
|
|
135
135
|
}
|
|
136
136
|
}
|
|
@@ -478,7 +478,7 @@ Selector::startSelect()
|
|
|
478
478
|
|
|
479
479
|
//
|
|
480
480
|
// If there are ready handlers, don't block in select, just do a non-blocking
|
|
481
|
-
// select to retrieve new ready handlers from the
|
|
481
|
+
// select to retrieve new ready handlers from the selector.
|
|
482
482
|
//
|
|
483
483
|
_selectNow = !_readyHandlers.empty();
|
|
484
484
|
}
|
|
@@ -556,7 +556,7 @@ Selector::select(int timeout)
|
|
|
556
556
|
}
|
|
557
557
|
else if (timeout > 0)
|
|
558
558
|
{
|
|
559
|
-
// kqueue
|
|
559
|
+
// kqueue uses seconds, epoll uses milliseconds
|
|
560
560
|
# ifdef ICE_USE_EPOLL
|
|
561
561
|
timeout = timeout * 1000;
|
|
562
562
|
# endif
|
|
@@ -570,17 +570,17 @@ Selector::select(int timeout)
|
|
|
570
570
|
while (true)
|
|
571
571
|
{
|
|
572
572
|
# if defined(ICE_USE_EPOLL)
|
|
573
|
-
_count = epoll_wait(_queueFd,
|
|
573
|
+
_count = epoll_wait(_queueFd, _events.data(), _events.size(), timeout);
|
|
574
574
|
# else // ICE_USE_KQUEUE
|
|
575
575
|
assert(!_events.empty());
|
|
576
576
|
if (timeout >= 0)
|
|
577
577
|
{
|
|
578
578
|
timespec ts{.tv_sec = timeout, .tv_nsec = 0};
|
|
579
|
-
_count = kevent(_queueFd, nullptr, 0,
|
|
579
|
+
_count = kevent(_queueFd, nullptr, 0, _events.data(), static_cast<int>(_events.size()), &ts);
|
|
580
580
|
}
|
|
581
581
|
else
|
|
582
582
|
{
|
|
583
|
-
_count = kevent(_queueFd, nullptr, 0,
|
|
583
|
+
_count = kevent(_queueFd, nullptr, 0, _events.data(), static_cast<int>(_events.size()), nullptr);
|
|
584
584
|
}
|
|
585
585
|
# endif
|
|
586
586
|
|
|
@@ -591,7 +591,7 @@ Selector::select(int timeout)
|
|
|
591
591
|
continue;
|
|
592
592
|
}
|
|
593
593
|
|
|
594
|
-
// This indicates
|
|
594
|
+
// This indicates an internal error with the selector, we log the error and abort.
|
|
595
595
|
Ice::SocketException ex(__FILE__, __LINE__, IceInternal::getSocketErrno());
|
|
596
596
|
Ice::Error out(_instance->initializationData().logger);
|
|
597
597
|
out << "selector failed:\n" << ex;
|
|
@@ -640,9 +640,9 @@ Selector::updateSelector()
|
|
|
640
640
|
{
|
|
641
641
|
int rs = kevent(
|
|
642
642
|
_queueFd,
|
|
643
|
-
|
|
643
|
+
_changes.data(),
|
|
644
644
|
static_cast<int>(_changes.size()),
|
|
645
|
-
|
|
645
|
+
_changes.data(),
|
|
646
646
|
static_cast<int>(_changes.size()),
|
|
647
647
|
&zeroTimeout);
|
|
648
648
|
if (rs < 0)
|
|
@@ -1120,6 +1120,9 @@ Selector::finish(EventHandler* handler, bool closeNow)
|
|
|
1120
1120
|
void
|
|
1121
1121
|
Selector::ready(EventHandler* handler, SocketOperation status, bool value)
|
|
1122
1122
|
{
|
|
1123
|
+
// Hold _mutex across the read-modify-write of handler->_ready. The run-loop thread reads _ready under _mutex
|
|
1124
|
+
// (in startSelect/finishSelect, via EventHandlerWrapper), so updating it unlocked here would be a data race.
|
|
1125
|
+
lock_guard lock(_mutex);
|
|
1123
1126
|
if (((handler->_ready & status) != 0) == value)
|
|
1124
1127
|
{
|
|
1125
1128
|
return; // Nothing to do if ready state already correctly set.
|
|
@@ -1134,7 +1137,6 @@ Selector::ready(EventHandler* handler, SocketOperation status, bool value)
|
|
|
1134
1137
|
handler->_ready = static_cast<SocketOperation>(handler->_ready & ~status);
|
|
1135
1138
|
}
|
|
1136
1139
|
|
|
1137
|
-
lock_guard lock(_mutex);
|
|
1138
1140
|
std::map<EventHandler*, EventHandlerWrapperPtr>::iterator p = _wrappers.find(handler);
|
|
1139
1141
|
assert(p != _wrappers.end());
|
|
1140
1142
|
p->second->checkReady();
|
|
@@ -184,7 +184,7 @@ IceInternal::ServantManager::findServant(const Identity& ident, const string_vie
|
|
|
184
184
|
lock_guard lock(_mutex);
|
|
185
185
|
|
|
186
186
|
//
|
|
187
|
-
// This assert is not valid if the adapter
|
|
187
|
+
// This assert is not valid if the adapter dispatches incoming
|
|
188
188
|
// requests from bidir connections. This method might be called if
|
|
189
189
|
// requests are received over the bidir connection after the
|
|
190
190
|
// adapter was deactivated.
|
|
@@ -277,7 +277,7 @@ IceInternal::ServantManager::hasServant(const Identity& ident) const
|
|
|
277
277
|
lock_guard lock(_mutex);
|
|
278
278
|
|
|
279
279
|
//
|
|
280
|
-
// This assert is not valid if the adapter
|
|
280
|
+
// This assert is not valid if the adapter dispatches incoming
|
|
281
281
|
// requests from bidir connections. This method might be called if
|
|
282
282
|
// requests are received over the bidir connection after the
|
|
283
283
|
// adapter was deactivated.
|
|
@@ -360,7 +360,7 @@ IceInternal::ServantManager::findServantLocator(const string_view category) cons
|
|
|
360
360
|
lock_guard lock(_mutex);
|
|
361
361
|
|
|
362
362
|
//
|
|
363
|
-
// This assert is not valid if the adapter
|
|
363
|
+
// This assert is not valid if the adapter dispatches incoming
|
|
364
364
|
// requests from bidir connections. This method might be called if
|
|
365
365
|
// requests are received over the bidir connection after the
|
|
366
366
|
// adapter was deactivated.
|