]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
auth/cephx: make some parameters const
authorPatrick Donnelly <pdonnell@ibm.com>
Thu, 29 May 2025 14:01:37 +0000 (10:01 -0400)
committerPatrick Donnelly <pdonnell@ibm.com>
Mon, 22 Sep 2025 16:34:40 +0000 (12:34 -0400)
Signed-off-by: Patrick Donnelly <pdonnell@ibm.com>
(cherry picked from commit 755d5245566be43ce020daf8fb80ba3ec774dff5)

src/auth/cephx/CephxKeyServer.h
src/auth/cephx/CephxProtocol.cc
src/auth/cephx/CephxProtocol.h

index e41ea2a74f726e4edbdc1cc5ce94285ed370ff79..6ed9485b55a757a8373a66511178659c46bb510f 100644 (file)
@@ -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);
   }
index cd7949342de8ce00571cf96d601c07be4c6de952..1846217b977c6ab5a49c36b99b25e30590b28b3f 100644 (file)
@@ -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;
index b37eeca1c56a1349a82ccb15d3bd8cb62f747484..c739d30ed527b223c2132f7ac0e54ef181caf922 100644 (file)
@@ -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 <typename T>
-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)
 {