1
0
mirror of https://github.com/facebookincubator/mvfst.git synced 2025-08-05 11:21:09 +03:00

Implement an explicit inplace encrypt in Aead.

Summary: This is useful when you want to ensure that the IOBuf you pass in is encrypted inplace, as opposed to potentially creating a new one.

Reviewed By: yangchi

Differential Revision: D21135253

fbshipit-source-id: 89b6e718fc8da1324685c390c721a564bb77d01d
This commit is contained in:
Matt Joras
2020-04-21 21:41:55 -07:00
committed by Facebook GitHub Bot
parent c62d0877d1
commit 524bf84c44
9 changed files with 34 additions and 26 deletions

View File

@@ -1402,7 +1402,7 @@ TEST_F(QuicTransportFunctionsTest, WriteProbingOldData) {
writeDataToQuicStream(*stream, buf->clone(), true);
folly::IOBuf pktBodyCaptured;
EXPECT_CALL(*capturingAead, _encrypt(_, _, _))
EXPECT_CALL(*capturingAead, _inplaceEncrypt(_, _, _))
.WillRepeatedly(Invoke([&](auto& buf, auto, auto) {
if (buf) {
pktBodyCaptured.prependChain(buf->clone());
@@ -1418,7 +1418,7 @@ TEST_F(QuicTransportFunctionsTest, WriteProbingOldData) {
// Now we have no new data, let's probe again, and verify the same old data is
// sent.
folly::IOBuf secondBodyCaptured;
EXPECT_CALL(*capturingAead, _encrypt(_, _, _))
EXPECT_CALL(*capturingAead, _inplaceEncrypt(_, _, _))
.WillRepeatedly(Invoke([&](auto& buf, auto, auto) {
if (buf) {
secondBodyCaptured.prependChain(buf->clone());