Fix a naming issue to reduce confusion in cast test

Merge of https://widevine-internal-review.git.corp.google.com/c/cdm/+/206706

Change "digest" to "prefix".

Test: run_fake_l1_tests
Change-Id: I4205367c9a77979992130f4e2aeca90e761e2616
This commit is contained in:
Cong Lin
2024-09-11 14:04:16 -07:00
committed by conglin
parent 80fedfcd2f
commit 881b7236f4

View File

@@ -29,7 +29,7 @@ class OEMCryptoLoadsCertificateAlternates : public OEMCryptoLoadsCertificate {
// The message to be signed by OEMCrypto_GenerateRSASignature() starts with a
// constant digest info prefix followed by a SHA-1 hash of the message.
void PrepareCastDigestedMessage(const std::vector<uint8_t>& message,
std::vector<uint8_t>& digested_message) {
std::vector<uint8_t>& digest) {
// The application will compute the SHA-1 Hash of the message, so this
// test must do that also.
uint8_t hash[SHA_DIGEST_LENGTH];
@@ -39,11 +39,10 @@ class OEMCryptoLoadsCertificateAlternates : public OEMCryptoLoadsCertificate {
}
// The application will prepend the digest info to the hash.
// SHA-1 digest info prefix = 0x30 0x21 0x30 ...
vector<uint8_t> digest = wvutil::a2b_hex("3021300906052b0e03021a05000414");
digested_message.insert(digested_message.end(), digest.begin(),
digest.end());
digested_message.insert(digested_message.end(), hash,
hash + SHA_DIGEST_LENGTH);
static const std::vector<uint8_t> prefix =
wvutil::a2b_hex("3021300906052b0e03021a05000414");
digest.insert(digest.end(), prefix.begin(), prefix.end());
digest.insert(digest.end(), hash, hash + SHA_DIGEST_LENGTH);
}
void TestSignature(RSA_Padding_Scheme scheme, size_t size) {