Skip to content

Commit

Permalink
EaR: Remove unused CODE_PROBE handling encrypiton header flag version (
Browse files Browse the repository at this point in the history
…apple#10020)

Description

Patch removes an unused CODE_PROBE checking the encryption header
being read flag version is valid, given the flag-version is determined
by peeking into std::variant index and we only have version-1 supported,
for now converted the check to an ASSERT

Testing

EncryptionUnitTests.toml
EncryptionOps.toml
BlobGranuleCorrectness/Clean.toml
  • Loading branch information
sfc-gh-ahusain authored Apr 20, 2023
1 parent 377dd0d commit a099d37
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions fdbclient/BlobCipher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1466,19 +1466,8 @@ void DecryptBlobCipherAes256Ctr::validateEncryptHeader(const uint8_t* ciphertext
const BlobCipherEncryptHeaderRef& headerRef,
EncryptAuthTokenMode* authTokenMode,
EncryptAuthTokenAlgo* authTokenAlgo) {
if (headerRef.flagsVersion() != 1) {
TraceEvent(SevWarn, "BlobCipherVerifyEncryptBlobHeader")
.detail("HeaderVersion", headerRef.flagsVersion())
.detail("MaxSupportedVersion", CLIENT_KNOBS->ENCRYPT_HEADER_FLAGS_VERSION);

CODE_PROBE(true, "ConfigurableEncryption: Encryption header version unsupported");

throw encrypt_header_metadata_mismatch();
}

if (headerRef.flagsVersion() != 1) {
throw not_implemented();
}
// FlagsVersion is computed based on std::variant available index
ASSERT_EQ(headerRef.flagsVersion(), 1);

BlobCipherEncryptHeaderFlagsV1 flags = std::get<BlobCipherEncryptHeaderFlagsV1>(headerRef.flags);
validateEncryptHeaderFlagsV1(headerRef.flagsVersion(), flags);
Expand Down

0 comments on commit a099d37

Please sign in to comment.