From 881b7236f498a906ad8b22a6fb729084f9580876 Mon Sep 17 00:00:00 2001 From: Cong Lin Date: Wed, 11 Sep 2024 14:04:16 -0700 Subject: [PATCH] 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 --- libwvdrmengine/oemcrypto/test/oemcrypto_cast_test.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/libwvdrmengine/oemcrypto/test/oemcrypto_cast_test.h b/libwvdrmengine/oemcrypto/test/oemcrypto_cast_test.h index 0efc8ee3..9aa464bd 100644 --- a/libwvdrmengine/oemcrypto/test/oemcrypto_cast_test.h +++ b/libwvdrmengine/oemcrypto/test/oemcrypto_cast_test.h @@ -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& message, - std::vector& digested_message) { + std::vector& 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 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 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) {