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(
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 {
}
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);
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) {