summaryrefslogtreecommitdiffstats
path: root/src/auth
diff options
context:
space:
mode:
authorIlya Dryomov <idryomov@gmail.com>2021-04-15 15:18:58 +0200
committerIlya Dryomov <idryomov@gmail.com>2021-04-15 15:20:59 +0200
commit6f12cd3688b753633c8ff29fb3bd64758f960b2b (patch)
treea68df020bcd87edf81a1778ea08a37b062a98ef6 /src/auth
parentauth/cephx: cap ticket validity by expiration of "next" key (diff)
downloadceph-6f12cd3688b753633c8ff29fb3bd64758f960b2b.tar.xz
ceph-6f12cd3688b753633c8ff29fb3bd64758f960b2b.zip
auth/cephx: make KeyServer::build_session_auth_info() less confusing
The second KeyServer::build_session_auth_info() overload is used only by the monitor, for mon <-> mon authentication. The monitor passes in service_secret (mon secret) and secret_id (-1). The TTL is irrelevant because there is no rotation. However the signature doesn't make it obvious. Clarify that service_secret and secret_id are input parameters and info is the only output parameter. Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'src/auth')
-rw-r--r--src/auth/cephx/CephxKeyServer.cc6
-rw-r--r--src/auth/cephx/CephxKeyServer.h6
2 files changed, 6 insertions, 6 deletions
diff --git a/src/auth/cephx/CephxKeyServer.cc b/src/auth/cephx/CephxKeyServer.cc
index 706f6eca01a..adfe74d2bab 100644
--- a/src/auth/cephx/CephxKeyServer.cc
+++ b/src/auth/cephx/CephxKeyServer.cc
@@ -450,9 +450,9 @@ int KeyServer::build_session_auth_info(uint32_t service_id,
int KeyServer::build_session_auth_info(uint32_t service_id,
const AuthTicket& parent_ticket,
- CephXSessionAuthInfo& info,
- CryptoKey& service_secret,
- uint64_t secret_id)
+ const CryptoKey& service_secret,
+ uint64_t secret_id,
+ CephXSessionAuthInfo& info)
{
info.service_secret = service_secret;
info.secret_id = secret_id;
diff --git a/src/auth/cephx/CephxKeyServer.h b/src/auth/cephx/CephxKeyServer.h
index 8b54a06ec6c..3576c42c235 100644
--- a/src/auth/cephx/CephxKeyServer.h
+++ b/src/auth/cephx/CephxKeyServer.h
@@ -220,9 +220,9 @@ public:
CephXSessionAuthInfo& info);
int build_session_auth_info(uint32_t service_id,
const AuthTicket& parent_ticket,
- CephXSessionAuthInfo& info,
- CryptoKey& service_secret,
- uint64_t secret_id);
+ const CryptoKey& service_secret,
+ uint64_t secret_id,
+ CephXSessionAuthInfo& info);
/* get current secret for specific service type */
bool get_service_secret(uint32_t service_id, CryptoKey& secret,