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) {