diff options
| author | Gordon Sim <gsim@apache.org> | 2012-10-19 17:15:22 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2012-10-19 17:15:22 +0000 |
| commit | 324255d6316e13bc38cc39680bbdc31ec816a6b6 (patch) | |
| tree | 3bd37c5ec738b4baea0be86e6f17351f4d285d09 /cpp | |
| parent | 4a1ff164ac41da054d5060aaac875a651b57ea20 (diff) | |
| download | qpid-python-324255d6316e13bc38cc39680bbdc31ec816a6b6.tar.gz | |
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
Diffstat (limited to 'cpp')
| -rw-r--r-- | cpp/src/qpid/SaslFactory.cpp | 2 | ||||
| -rw-r--r-- | cpp/src/qpid/broker/SaslAuthenticator.cpp | 2 | ||||
| -rw-r--r-- | cpp/src/qpid/sys/SecurityLayer.h | 4 | ||||
| -rw-r--r-- | cpp/src/qpid/sys/cyrus/CyrusSecurityLayer.cpp | 4 | ||||
| -rw-r--r-- | cpp/src/qpid/sys/cyrus/CyrusSecurityLayer.h | 2 |
5 files changed, 9 insertions, 5 deletions
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<SecurityLayer> CyrusSasl::getSecurityLayer(uint16_t maxFrameSize) std::auto_ptr<SecurityLayer> securityLayer; if (ssf) { QPID_LOG(info, "Installing security layer, SSF: "<< ssf); - securityLayer = std::auto_ptr<SecurityLayer>(new CyrusSecurityLayer(conn, maxFrameSize)); + securityLayer = std::auto_ptr<SecurityLayer>(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<SecurityLayer> CyrusAuthenticator::getSecurityLayer(uint16_t maxFr uint ssf = *(reinterpret_cast<const unsigned*>(value)); std::auto_ptr<SecurityLayer> securityLayer; if (ssf) { - securityLayer = std::auto_ptr<SecurityLayer>(new CyrusSecurityLayer(sasl_conn, maxFrameSize)); + securityLayer = std::auto_ptr<SecurityLayer>(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(); |
