]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
auth: drop get_protocol() and get_key() from AuthSessionHandler.
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Tue, 22 Jan 2019 18:43:26 +0000 (19:43 +0100)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Thu, 21 Feb 2019 20:52:47 +0000 (21:52 +0100)
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
src/auth/AuthSessionHandler.h
src/msg/async/ProtocolV1.cc
src/msg/async/ProtocolV2.cc

index e0e10c0d78dd7c57f58dfa1fa5bed731c8acf0c9..fa1518692d2776b22bcdcaf973008b0f1b549ae2 100644 (file)
@@ -57,10 +57,6 @@ public:
   virtual int decrypt_bufferlist(bufferlist &in, bufferlist &out) {
     return 0;
   }
-
-  int get_protocol() {return protocol;}
-  CryptoKey get_key() {return key;}
-
 };
 
 extern AuthSessionHandler *get_auth_session_handler(
index 03ceae78d2342ffcf05e6e82eeb8881e90770191..773eac11acd808eac0a14a46f1b5755110495ef9 100644 (file)
@@ -1681,7 +1681,8 @@ CtPtr ProtocolV1::client_ready() {
     ldout(cct, 10) << __func__ << " setting up session_security with auth "
                   << authorizer << dendl;
     session_security.reset(get_auth_session_handler(
-        cct, authorizer->protocol, authorizer->session_key,
+        cct, authorizer->protocol,
+       authorizer->session_key,
        string() /* connection_secret */,
         connection->get_features()));
   } else {
index 55e14cc585b7b328509473990b098abeeff1a4fe..62db34e5a2ad57be6a52e63cd38c0c60452c4e57 100644 (file)
@@ -76,7 +76,7 @@ void ProtocolV2::run_continuation(CtPtr continuation) {
 }
 
 void ProtocolV2::calc_signature(const char *in, uint32_t length, char *out) {
-  auto secret = session_security->get_key().get_secret();
+  auto secret = auth_meta.session_key.get_secret();
   ceph::crypto::HMACSHA256 hmac((const unsigned char *)secret.c_str(),
                                 secret.length());
   hmac.Update((const unsigned char *)in, length);
@@ -1186,15 +1186,14 @@ void ProtocolV2::calculate_payload_size(uint32_t length, uint32_t *total_len,
     if (is_signed) {
       total_l += SIGNATURE_BLOCK_SIZE;
     }
-    uint32_t block_size = session_security->get_key().get_max_outbuf_size(0);
+    uint32_t block_size = auth_meta.session_key.get_max_outbuf_size(0);
     uint32_t pad_len = block_size - (total_l % block_size);
     if (is_signed) {
       sig_pad_l = pad_len;
     } else if (!is_signed) {
       enc_pad_l = pad_len;
     }
-    total_l =
-        session_security->get_key().get_max_outbuf_size(total_l + pad_len);
+    total_l = auth_meta.session_key.get_max_outbuf_size(total_l + pad_len);
   }
 
   if (sig_pad_len) {