diff --git a/fizz/crypto/aead/AEGISCipher.cpp b/fizz/crypto/aead/AEGISCipher.cpp index 8e796e07627..8b89e653458 100644 --- a/fizz/crypto/aead/AEGISCipher.cpp +++ b/fizz/crypto/aead/AEGISCipher.cpp @@ -325,6 +325,7 @@ folly::Optional> AEGISCipher::tryDecrypt( // Set up the tag buffer now const auto& lastBuf = ciphertext->prev(); folly::MutableByteRange tagOut; + std::array tag; if (lastBuf->length() >= tagLength_) { // We can directly carve out this buffer from the last IOBuf // Adjust buffer sizes @@ -332,7 +333,6 @@ folly::Optional> AEGISCipher::tryDecrypt( tagOut = {lastBuf->writableTail(), tagLength_}; } else { - std::array tag; // buffer to copy the tag into when we decrypt tagOut = {tag.data(), tagLength_}; trimBytes(*ciphertext, tagOut);