MCPcopy Create free account
hub / github.com/ceph/ceph / authenticated_decrypt_update

Method authenticated_decrypt_update

src/msg/async/crypto_onwire.cc:230–245  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

228}
229
230void AES128GCM_OnWireRxHandler::authenticated_decrypt_update(
231 ceph::bufferlist& bl)
232{
233 // discard cached crcs as we will be writing through c_str()
234 bl.invalidate_crc();
235 for (auto& buf : bl.buffers()) {
236 auto p = reinterpret_cast<unsigned char*>(const_cast<char*>(buf.c_str()));
237 int update_len = 0;
238
239 if (1 != EVP_DecryptUpdate(ectx.get(), p, &update_len, p, buf.length())) {
240 throw std::runtime_error("EVP_DecryptUpdate failed");
241 }
242 ceph_assert_always(update_len >= 0);
243 ceph_assert(static_cast<unsigned>(update_len) == buf.length());
244 }
245}
246
247void AES128GCM_OnWireRxHandler::authenticated_decrypt_update_final(
248 ceph::bufferlist& bl)

Callers 3

disassemble_preambleMethod · 0.80

Calls 4

invalidate_crcMethod · 0.45
c_strMethod · 0.45
getMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected