From 4f78af7d6934094e9ed757576f8309c6a6585b35 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 17 Jan 2019 16:55:28 -0600 Subject: [PATCH] auth: constify bufferlist arg to AuthAuthorizer::add_challenge() Signed-off-by: Sage Weil --- src/auth/Auth.h | 2 +- src/auth/cephx/CephxProtocol.cc | 3 ++- src/auth/cephx/CephxProtocol.h | 5 +++-- src/auth/krb/KrbProtocol.hpp | 2 +- src/auth/none/AuthNoneProtocol.h | 4 +++- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/auth/Auth.h b/src/auth/Auth.h index 307afdd9cfb..dc91854ded5 100644 --- a/src/auth/Auth.h +++ b/src/auth/Auth.h @@ -141,7 +141,7 @@ struct AuthAuthorizer { virtual ~AuthAuthorizer() {} virtual bool verify_reply(bufferlist::const_iterator& reply, CryptoKey *connection_secret) = 0; - virtual bool add_challenge(CephContext *cct, bufferlist& challenge) = 0; + virtual bool add_challenge(CephContext *cct, const bufferlist& challenge) = 0; }; struct AuthAuthorizerChallenge { diff --git a/src/auth/cephx/CephxProtocol.cc b/src/auth/cephx/CephxProtocol.cc index eca2a1e9b83..45df032a822 100644 --- a/src/auth/cephx/CephxProtocol.cc +++ b/src/auth/cephx/CephxProtocol.cc @@ -540,7 +540,8 @@ bool CephXAuthorizer::verify_reply(bufferlist::const_iterator& indata, return true; } -bool CephXAuthorizer::add_challenge(CephContext *cct, bufferlist& challenge) +bool CephXAuthorizer::add_challenge(CephContext *cct, + const bufferlist& challenge) { bl = base_bl; diff --git a/src/auth/cephx/CephxProtocol.h b/src/auth/cephx/CephxProtocol.h index 49793b59a88..c028244fbcf 100644 --- a/src/auth/cephx/CephxProtocol.h +++ b/src/auth/cephx/CephxProtocol.h @@ -260,7 +260,7 @@ public: bool build_authorizer(); bool verify_reply(bufferlist::const_iterator& reply, CryptoKey *connection_secret) override; - bool add_challenge(CephContext *cct, bufferlist& challenge) override; + bool add_challenge(CephContext *cct, const bufferlist& challenge) override; }; @@ -441,7 +441,8 @@ extern bool cephx_verify_authorizer( static constexpr uint64_t AUTH_ENC_MAGIC = 0xff009cad8826aa55ull; template -void decode_decrypt_enc_bl(CephContext *cct, T& t, CryptoKey key, bufferlist& bl_enc, +void decode_decrypt_enc_bl(CephContext *cct, T& t, CryptoKey key, + const bufferlist& bl_enc, std::string &error) { uint64_t magic; diff --git a/src/auth/krb/KrbProtocol.hpp b/src/auth/krb/KrbProtocol.hpp index 5b91d153869..780f66e9b03 100644 --- a/src/auth/krb/KrbProtocol.hpp +++ b/src/auth/krb/KrbProtocol.hpp @@ -90,7 +90,7 @@ class KrbAuthorizer : public AuthAuthorizer { return true; } bool add_challenge(CephContext* ceph_ctx, - bufferlist& buff_list) override { + const bufferlist& buff_list) override { return true; } }; diff --git a/src/auth/none/AuthNoneProtocol.h b/src/auth/none/AuthNoneProtocol.h index d5c2677a681..155a8d05304 100644 --- a/src/auth/none/AuthNoneProtocol.h +++ b/src/auth/none/AuthNoneProtocol.h @@ -30,7 +30,9 @@ struct AuthNoneAuthorizer : public AuthAuthorizer { } bool verify_reply(bufferlist::const_iterator& reply, CryptoKey *connection_secret) override { return true; } - bool add_challenge(CephContext *cct, bufferlist& ch) override { return true; } + bool add_challenge(CephContext *cct, const bufferlist& ch) override { + return true; + } }; #endif -- 2.47.3