- ceph_assert(ciphertext.length() > 0);
- //ceph_assert(ciphertext.length() % AESGCM_BLOCK_LEN == 0);
-
- // NOTE: we might consider in-place transformations in the future. AFAIK
- // OpenSSL's might sustain that but lack of clear confirmation postpones.
- auto plainnode = ceph::buffer::ptr_node::create(buffer::create_aligned(
- ciphertext.length(), alignment));
- auto* plainbuf = reinterpret_cast<unsigned char*>(plainnode->c_str());
-
- for (const auto& cipherbuf : ciphertext.buffers()) {
- // XXX: Why int?
+ // discard cached crcs as we will be writing through c_str()
+ bl.invalidate_crc();
+ for (auto& buf : bl.buffers()) {
+ auto p = reinterpret_cast<unsigned char*>(const_cast<char*>(buf.c_str()));