diff options
author | Gordon Sim <gsim@apache.org> | 2010-03-05 16:51:22 +0000 |
---|---|---|
committer | Gordon Sim <gsim@apache.org> | 2010-03-05 16:51:22 +0000 |
commit | f5e41be93bec9b5556a65292516db07ff845f7d4 (patch) | |
tree | d26b9519d281dbb36fd6717205462399292896dd /cpp/src/qpid/sys/SslPlugin.cpp | |
parent | 74d838068a2a24423c0c5af1e33b612e132291fb (diff) | |
download | qpid-python-f5e41be93bec9b5556a65292516db07ff845f7d4.tar.gz |
QPID-2412: Support for EXTERNAL mechanism on client-authenticated SSL connections.
On SSL connection where the clients certificate is authenticated (requires the --ssl-require-client-authentication option at present), the clients identity will be taken from that certificate (it will be the CN with any DCs present appended as the domain, e.g. CN=bob,DC=acme,DC=com would result in an identity of bob@acme.com). This will enable the EXTERNAL mechanism when cyrus sasl is in use.
The client can still negotiate their desired mechanism. There is a new option on the ssl module (--ssl-sasl-no-dict) that allows the options on ssl connections to be restricted to those that are not vulnerable to dictionary attacks (EXTERNAL being the primary example).
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@919487 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/sys/SslPlugin.cpp')
-rw-r--r-- | cpp/src/qpid/sys/SslPlugin.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/cpp/src/qpid/sys/SslPlugin.cpp b/cpp/src/qpid/sys/SslPlugin.cpp index c143f1f1d0..297787f497 100644 --- a/cpp/src/qpid/sys/SslPlugin.cpp +++ b/cpp/src/qpid/sys/SslPlugin.cpp @@ -41,14 +41,18 @@ struct SslServerOptions : ssl::SslOptions { uint16_t port; bool clientAuth; + bool nodict; SslServerOptions() : port(5671), - clientAuth(false) + clientAuth(false), + nodict(false) { addOptions() ("ssl-port", optValue(port, "PORT"), "Port on which to listen for SSL connections") ("ssl-require-client-authentication", optValue(clientAuth), - "Forces clients to authenticate in order to establish an SSL connection"); + "Forces clients to authenticate in order to establish an SSL connection") + ("ssl-sasl-no-dict", optValue(nodict), + "Disables SASL mechanisms that are vulnerable to passive dictionary-based password attacks"); } }; @@ -57,6 +61,7 @@ class SslProtocolFactory : public ProtocolFactory { qpid::sys::ssl::SslSocket listener; const uint16_t listeningPort; std::auto_ptr<qpid::sys::ssl::SslAcceptor> acceptor; + bool nodict; public: SslProtocolFactory(const SslServerOptions&, int backlog, bool nodelay); @@ -97,7 +102,8 @@ static struct SslPlugin : public Plugin { const broker::Broker::Options& opts = broker->getOptions(); ProtocolFactory::shared_ptr protocol(new SslProtocolFactory(options, - opts.connectionBacklog, opts.tcpNoDelay)); + opts.connectionBacklog, + opts.tcpNoDelay)); QPID_LOG(notice, "Listening for SSL connections on TCP port " << protocol->getPort()); broker->registerProtocolFactory("ssl", protocol); } catch (const std::exception& e) { @@ -109,12 +115,13 @@ static struct SslPlugin : public Plugin { } sslPlugin; SslProtocolFactory::SslProtocolFactory(const SslServerOptions& options, int backlog, bool nodelay) : - tcpNoDelay(nodelay), listeningPort(listener.listen(options.port, backlog, options.certName, options.clientAuth)) + tcpNoDelay(nodelay), listeningPort(listener.listen(options.port, backlog, options.certName, options.clientAuth)), + nodict(options.nodict) {} void SslProtocolFactory::established(Poller::shared_ptr poller, const qpid::sys::ssl::SslSocket& s, ConnectionCodec::Factory* f, bool isClient) { - qpid::sys::ssl::SslHandler* async = new qpid::sys::ssl::SslHandler(s.getPeerAddress(), f); + qpid::sys::ssl::SslHandler* async = new qpid::sys::ssl::SslHandler(s.getPeerAddress(), f, nodict); if (tcpNoDelay) { s.setTcpNoDelay(tcpNoDelay); |