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