MCPcopy Create free account
hub / github.com/apple/foundationdb / verifyHeaderMultiAuthToken

Method verifyHeaderMultiAuthToken

flow/BlobCipher.cpp:616–640  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

614}
615
616void DecryptBlobCipherAes256Ctr::verifyHeaderMultiAuthToken(const uint8_t* ciphertext,
617 const int ciphertextLen,
618 const BlobCipherEncryptHeader& header,
619 uint8_t* buff,
620 Arena& arena) {
621 if (!headerAuthTokenValidationDone) {
622 verifyHeaderAuthToken(header, arena);
623 }
624 StringRef computedCipherTextAuthToken =
625 computeAuthToken(ciphertext,
626 ciphertextLen,
627 reinterpret_cast<const uint8_t*>(&header.cipherTextDetails.salt),
628 sizeof(EncryptCipherRandomSalt),
629 arena);
630 if (memcmp(&header.multiAuthTokens.cipherTextAuthToken[0], computedCipherTextAuthToken.begin(), AUTH_TOKEN_SIZE) !=
631 0) {
632 TraceEvent("VerifyEncryptBlobHeader_AuthTokenMismatch")
633 .detail("HeaderVersion", header.flags.headerVersion)
634 .detail("HeaderMode", header.flags.encryptMode)
635 .detail("MultiAuthCipherTextAuthToken",
636 StringRef(arena, &header.multiAuthTokens.cipherTextAuthToken[0], AUTH_TOKEN_SIZE).toString())
637 .detail("ComputedCipherTextAuthToken", computedCipherTextAuthToken.toString());
638 throw encrypt_header_authtoken_mismatch();
639 }
640}
641
642void DecryptBlobCipherAes256Ctr::verifyAuthTokens(const uint8_t* ciphertext,
643 const int ciphertextLen,

Callers

nothing calls this directly

Calls 6

computeAuthTokenFunction · 0.85
TraceEventClass · 0.85
detailMethod · 0.80
StringRefClass · 0.50
beginMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected