| 614 | } |
| 615 | |
| 616 | void 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 | |
| 642 | void DecryptBlobCipherAes256Ctr::verifyAuthTokens(const uint8_t* ciphertext, |
| 643 | const int ciphertextLen, |
nothing calls this directly
no test coverage detected