From d719c8c88c65776a6878f0c363e5c5442a59751c Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Thu, 29 May 2025 10:01:37 -0400 Subject: [PATCH] auth/cephx: make some parameters const Signed-off-by: Patrick Donnelly (cherry picked from commit 755d5245566be43ce020daf8fb80ba3ec774dff5) --- src/auth/cephx/CephxKeyServer.h | 4 ++-- src/auth/cephx/CephxProtocol.cc | 2 +- src/auth/cephx/CephxProtocol.h | 5 ++--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/auth/cephx/CephxKeyServer.h b/src/auth/cephx/CephxKeyServer.h index e41ea2a74f7..6ed9485b55a 100644 --- a/src/auth/cephx/CephxKeyServer.h +++ b/src/auth/cephx/CephxKeyServer.h @@ -93,7 +93,7 @@ struct KeyServerData { rotating_secrets.clear(); } - void add_auth(const EntityName& name, EntityAuth& auth) { + void add_auth(const EntityName& name, const EntityAuth& auth) { secrets[name] = auth; } @@ -301,7 +301,7 @@ public: data.version = ver; } - void add_auth(const EntityName& name, EntityAuth& auth) { + void add_auth(const EntityName& name, const EntityAuth& auth) { std::scoped_lock l{lock}; data.add_auth(name, auth); } diff --git a/src/auth/cephx/CephxProtocol.cc b/src/auth/cephx/CephxProtocol.cc index cd7949342de..1846217b977 100644 --- a/src/auth/cephx/CephxProtocol.cc +++ b/src/auth/cephx/CephxProtocol.cc @@ -67,7 +67,7 @@ void cephx_calc_client_server_challenge(CephContext *cct, CryptoKey& secret, uin * Authentication */ -bool cephx_build_service_ticket_blob(CephContext *cct, CephXSessionAuthInfo& info, +bool cephx_build_service_ticket_blob(CephContext *cct, const CephXSessionAuthInfo& info, CephXTicketBlob& blob) { CephXServiceTicketInfo ticket_info; diff --git a/src/auth/cephx/CephxProtocol.h b/src/auth/cephx/CephxProtocol.h index b37eeca1c56..c739d30ed52 100644 --- a/src/auth/cephx/CephxProtocol.h +++ b/src/auth/cephx/CephxProtocol.h @@ -251,8 +251,7 @@ struct CephXSessionAuthInfo { }; -extern bool cephx_build_service_ticket_blob(CephContext *cct, - CephXSessionAuthInfo& ticket_info, CephXTicketBlob& blob); +extern bool cephx_build_service_ticket_blob(CephContext *cct, const CephXSessionAuthInfo& ticket_info, CephXTicketBlob& blob); extern void cephx_build_service_ticket_request(CephContext *cct, uint32_t keys, @@ -577,7 +576,7 @@ 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, +void decode_decrypt_enc_bl(CephContext *cct, T& t, const CryptoKey& key, const ceph::buffer::list& bl_enc, std::string &error) { -- 2.39.5