From: Patrick Donnelly Date: Thu, 29 May 2025 14:01:37 +0000 (-0400) Subject: auth/cephx: make some parameters const X-Git-Tag: testing/wip-pdonnell-testing-20260210.212535~94 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e17d42e5e8c9650696c13cb107d68db82c855fa3;p=ceph-ci.git auth/cephx: make some parameters const Signed-off-by: Patrick Donnelly --- 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) {