qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject svn commit: r1512346 - in /qpid/trunk/qpid/cpp/src/qpid/messaging/amqp: ConnectionContext.cpp ConnectionContext.h Sasl.cpp SslTransport.cpp SslTransport.h TcpTransport.cpp TcpTransport.h Transport.h
Date Fri, 09 Aug 2013 15:36:33 GMT
Author: gsim
Date: Fri Aug  9 15:36:32 2013
New Revision: 1512346

URL: http://svn.apache.org/r1512346
Log:
QPID-5062: pass through security details from SSL transport to enable EXTERNAL authentication

Modified:
    qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp
    qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.h
    qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/Sasl.cpp
    qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/SslTransport.cpp
    qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/SslTransport.h
    qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/TcpTransport.cpp
    qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/TcpTransport.h
    qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/Transport.h

Modified: qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp?rev=1512346&r1=1512345&r2=1512346&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp Fri Aug  9 15:36:32
2013
@@ -763,4 +763,9 @@ void ConnectionContext::setProperties()
     **/
 }
 
+const qpid::sys::SecuritySettings* ConnectionContext::getTransportSecuritySettings()
+{
+    return transport ?  transport->getSecuritySettings() : 0;
+}
+
 }}} // namespace qpid::messaging::amqp

Modified: qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.h?rev=1512346&r1=1512345&r2=1512346&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.h Fri Aug  9 15:36:32 2013
@@ -44,6 +44,9 @@ namespace qpid {
 namespace framing {
 class ProtocolVersion;
 }
+namespace sys {
+struct SecuritySettings;
+}
 namespace messaging {
 class Duration;
 class Message;
@@ -101,6 +104,7 @@ class ConnectionContext : public qpid::s
     framing::ProtocolVersion getVersion() const;
     //additionally, Transport needs:
     void opened();//signal successful connection
+    const qpid::sys::SecuritySettings* getTransportSecuritySettings();
 
   private:
     typedef std::map<std::string, boost::shared_ptr<SessionContext> > SessionMap;

Modified: qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/Sasl.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/Sasl.cpp?rev=1512346&r1=1512345&r2=1512346&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/Sasl.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/Sasl.cpp Fri Aug  9 15:36:32 2013
@@ -93,7 +93,7 @@ void Sasl::mechanisms(const std::string&
         mechanisms = offered;
     }
 
-    if (sasl->start(mechanisms, response)) {
+    if (sasl->start(mechanisms, response, context.getTransportSecuritySettings())) {
         init(sasl->getMechanism(), &response, hostname.size() ? &hostname : 0);
     } else {
         init(sasl->getMechanism(), 0, hostname.size() ? &hostname : 0);

Modified: qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/SslTransport.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/SslTransport.cpp?rev=1512346&r1=1512345&r2=1512346&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/SslTransport.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/SslTransport.cpp Fri Aug  9 15:36:32 2013
@@ -157,4 +157,11 @@ void SslTransport::activateOutput()
     if (aio) aio->notifyPendingWrite();
 }
 
+const qpid::sys::SecuritySettings* SslTransport::getSecuritySettings()
+{
+    securitySettings.ssf = socket.getKeyLen();
+    securitySettings.authid = "dummy";//set to non-empty string to enable external authentication
+    return &securitySettings;
+}
+
 }}} // namespace qpid::messaging::amqp

Modified: qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/SslTransport.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/SslTransport.h?rev=1512346&r1=1512345&r2=1512346&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/SslTransport.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/SslTransport.h Fri Aug  9 15:36:32 2013
@@ -23,6 +23,7 @@
  */
 #include "qpid/messaging/amqp/Transport.h"
 #include "qpid/sys/Mutex.h"
+#include "qpid/sys/SecuritySettings.h"
 #include "qpid/sys/ssl/SslSocket.h"
 #include <boost/shared_ptr.hpp>
 
@@ -50,6 +51,7 @@ class SslTransport : public Transport
     void abort();
     void connectionEstablished() {};
     void close();
+    const qpid::sys::SecuritySettings* getSecuritySettings();
 
   private:
     qpid::sys::ssl::SslSocket socket;
@@ -59,6 +61,7 @@ class SslTransport : public Transport
     boost::shared_ptr<qpid::sys::Poller> poller;
     bool closed;
     std::string id;
+    qpid::sys::SecuritySettings securitySettings;
 
     void connected(const qpid::sys::Socket&);
     void failed(const std::string& msg);

Modified: qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/TcpTransport.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/TcpTransport.cpp?rev=1512346&r1=1512345&r2=1512346&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/TcpTransport.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/TcpTransport.cpp Fri Aug  9 15:36:32 2013
@@ -159,4 +159,8 @@ void TcpTransport::activateOutput()
     if (aio) aio->notifyPendingWrite();
 }
 
+const qpid::sys::SecuritySettings* TcpTransport::getSecuritySettings()
+{
+    return 0;
+}
 }}} // namespace qpid::messaging::amqp

Modified: qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/TcpTransport.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/TcpTransport.h?rev=1512346&r1=1512345&r2=1512346&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/TcpTransport.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/TcpTransport.h Fri Aug  9 15:36:32 2013
@@ -50,6 +50,7 @@ class TcpTransport : public Transport
     void abort();
     void connectionEstablished() {};
     void close();
+    const qpid::sys::SecuritySettings* getSecuritySettings();
 
   private:
     boost::scoped_ptr<qpid::sys::Socket> socket;

Modified: qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/Transport.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/Transport.h?rev=1512346&r1=1512345&r2=1512346&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/Transport.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/Transport.h Fri Aug  9 15:36:32 2013
@@ -27,6 +27,7 @@
 namespace qpid {
 namespace sys {
 class Poller;
+struct SecuritySettings;
 }
 namespace messaging {
 namespace amqp {
@@ -38,6 +39,7 @@ class Transport : public qpid::sys::Outp
     virtual ~Transport() {}
     virtual void connect(const std::string& host, const std::string& port) = 0;
     virtual void close() = 0;
+    virtual const qpid::sys::SecuritySettings* getSecuritySettings() = 0;
 
     typedef Transport* Factory(TransportContext&, boost::shared_ptr<qpid::sys::Poller>);
     static Transport* create(const std::string& name, TransportContext&, boost::shared_ptr<qpid::sys::Poller>);



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message