From 324255d6316e13bc38cc39680bbdc31ec816a6b6 Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Fri, 19 Oct 2012 17:15:22 +0000 Subject: QPID-4368: Make security strength factor a property of the security layer git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1400173 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/SaslFactory.cpp | 2 +- cpp/src/qpid/broker/SaslAuthenticator.cpp | 2 +- cpp/src/qpid/sys/SecurityLayer.h | 4 ++++ cpp/src/qpid/sys/cyrus/CyrusSecurityLayer.cpp | 4 ++-- cpp/src/qpid/sys/cyrus/CyrusSecurityLayer.h | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-) (limited to 'cpp/src') diff --git a/cpp/src/qpid/SaslFactory.cpp b/cpp/src/qpid/SaslFactory.cpp index a8d1f94c1e..9fb5d64c38 100644 --- a/cpp/src/qpid/SaslFactory.cpp +++ b/cpp/src/qpid/SaslFactory.cpp @@ -377,7 +377,7 @@ std::auto_ptr CyrusSasl::getSecurityLayer(uint16_t maxFrameSize) std::auto_ptr securityLayer; if (ssf) { QPID_LOG(info, "Installing security layer, SSF: "<< ssf); - securityLayer = std::auto_ptr(new CyrusSecurityLayer(conn, maxFrameSize)); + securityLayer = std::auto_ptr(new CyrusSecurityLayer(conn, maxFrameSize, ssf)); } return securityLayer; } diff --git a/cpp/src/qpid/broker/SaslAuthenticator.cpp b/cpp/src/qpid/broker/SaslAuthenticator.cpp index bc7c96f08c..a02882d05c 100644 --- a/cpp/src/qpid/broker/SaslAuthenticator.cpp +++ b/cpp/src/qpid/broker/SaslAuthenticator.cpp @@ -505,7 +505,7 @@ std::auto_ptr CyrusAuthenticator::getSecurityLayer(uint16_t maxFr uint ssf = *(reinterpret_cast(value)); std::auto_ptr securityLayer; if (ssf) { - securityLayer = std::auto_ptr(new CyrusSecurityLayer(sasl_conn, maxFrameSize)); + securityLayer = std::auto_ptr(new CyrusSecurityLayer(sasl_conn, maxFrameSize, ssf)); } qmf::org::apache::qpid::broker::Connection::shared_ptr cnxMgmt = connection.getMgmtObject(); if ( cnxMgmt ) diff --git a/cpp/src/qpid/sys/SecurityLayer.h b/cpp/src/qpid/sys/SecurityLayer.h index 52bc40e352..317ada16de 100644 --- a/cpp/src/qpid/sys/SecurityLayer.h +++ b/cpp/src/qpid/sys/SecurityLayer.h @@ -33,8 +33,12 @@ namespace sys { class SecurityLayer : public Codec { public: + SecurityLayer(int ssf_) : ssf(ssf_) {} + int getSsf() const { return ssf; } virtual void init(Codec*) = 0; virtual ~SecurityLayer() {} + private: + int ssf; }; }} // namespace qpid::sys diff --git a/cpp/src/qpid/sys/cyrus/CyrusSecurityLayer.cpp b/cpp/src/qpid/sys/cyrus/CyrusSecurityLayer.cpp index a4d291ebab..79d9d08a59 100644 --- a/cpp/src/qpid/sys/cyrus/CyrusSecurityLayer.cpp +++ b/cpp/src/qpid/sys/cyrus/CyrusSecurityLayer.cpp @@ -29,8 +29,8 @@ namespace qpid { namespace sys { namespace cyrus { -CyrusSecurityLayer::CyrusSecurityLayer(sasl_conn_t* c, uint16_t maxFrameSize) : - conn(c), decrypted(0), decryptedSize(0), encrypted(0), encryptedSize(0), codec(0), maxInputSize(0), +CyrusSecurityLayer::CyrusSecurityLayer(sasl_conn_t* c, uint16_t maxFrameSize, int ssf) : + SecurityLayer(ssf), conn(c), decrypted(0), decryptedSize(0), encrypted(0), encryptedSize(0), codec(0), maxInputSize(0), decodeBuffer(maxFrameSize), encodeBuffer(maxFrameSize), encoded(0) { const void* value(0); diff --git a/cpp/src/qpid/sys/cyrus/CyrusSecurityLayer.h b/cpp/src/qpid/sys/cyrus/CyrusSecurityLayer.h index 7f108248ee..ae86ba5569 100644 --- a/cpp/src/qpid/sys/cyrus/CyrusSecurityLayer.h +++ b/cpp/src/qpid/sys/cyrus/CyrusSecurityLayer.h @@ -37,7 +37,7 @@ namespace cyrus { class CyrusSecurityLayer : public qpid::sys::SecurityLayer { public: - CyrusSecurityLayer(sasl_conn_t*, uint16_t maxFrameSize); + CyrusSecurityLayer(sasl_conn_t*, uint16_t maxFrameSize, int ssf); size_t decode(const char* buffer, size_t size); size_t encode(char* buffer, size_t size); bool canEncode(); -- cgit v1.2.1