From a980cf6ce289142a49b7e5184be69d6d752c5a7f 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 --- 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 8db879f275a..5fb7608af67 100644 --- a/src/auth/cephx/CephxKeyServer.h +++ b/src/auth/cephx/CephxKeyServer.h @@ -105,7 +105,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; } @@ -315,7 +315,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 683a9a71613..344916f8898 100644 --- a/src/auth/cephx/CephxProtocol.cc +++ b/src/auth/cephx/CephxProtocol.cc @@ -68,7 +68,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 500d93c90cb..8dbc42ba4a6 100644 --- a/src/auth/cephx/CephxProtocol.h +++ b/src/auth/cephx/CephxProtocol.h @@ -264,8 +264,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, @@ -602,7 +601,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.47.3