diff --git a/libwvdrmengine/oemcrypto/test/oemcrypto_test.cpp b/libwvdrmengine/oemcrypto/test/oemcrypto_test.cpp index 65c10939..d3d09d01 100644 --- a/libwvdrmengine/oemcrypto/test/oemcrypto_test.cpp +++ b/libwvdrmengine/oemcrypto/test/oemcrypto_test.cpp @@ -1135,7 +1135,7 @@ TEST_F(OEMCryptoSessionTests, SimultaneousDecrypt) { } for (int i = 0; i < 8; i++) { ASSERT_NO_FATAL_FAILURE(s[i].GenerateTestSessionKeys()); - ASSERT_NO_FATAL_FAILURE(s[i].FillSimpleMessage(kDuration, 0, + ASSERT_NO_FATAL_FAILURE(s[i].FillSimpleMessage(kLongDuration, 0, s[i].get_nonce())); ASSERT_NO_FATAL_FAILURE(s[i].EncryptAndSign()); } @@ -1158,14 +1158,14 @@ TEST_F(OEMCryptoSessionTests, SimultaneousDecryptWithLostMessage) { } for (int i = 0; i < 8; i++) { ASSERT_NO_FATAL_FAILURE(s[i].GenerateTestSessionKeys()); - ASSERT_NO_FATAL_FAILURE(s[i].FillSimpleMessage(kDuration, 0, + ASSERT_NO_FATAL_FAILURE(s[i].FillSimpleMessage(kLongDuration, 0, s[i].get_nonce())); ASSERT_NO_FATAL_FAILURE(s[i].EncryptAndSign()); } // First set of messages are lost. Generate second set. for (int i = 0; i < 8; i++) { ASSERT_NO_FATAL_FAILURE(s[i].GenerateTestSessionKeys()); - ASSERT_NO_FATAL_FAILURE(s[i].FillSimpleMessage(kDuration, 0, + ASSERT_NO_FATAL_FAILURE(s[i].FillSimpleMessage(kLongDuration, 0, s[i].get_nonce())); ASSERT_NO_FATAL_FAILURE(s[i].EncryptAndSign()); } @@ -1293,7 +1293,7 @@ class OEMCryptoSessionTestsDecryptTests } void TestDecryptCENC(const vector& key, - const vector& encryptionIv, + const vector& /* encryptionIv */, const vector& encryptedData, const vector& unencryptedData) { OEMCryptoResult sts; @@ -1615,8 +1615,8 @@ TEST_P(OEMCryptoSessionTestsDecryptTests, DecryptCENCPerformance) { s.license().keys[0].cipher_mode = GetParam().mode; ASSERT_NO_FATAL_FAILURE(s.EncryptAndSign()); ASSERT_NO_FATAL_FAILURE(s.LoadTestKeys()); - vector keyId = wvcdm::a2b_hex("000000000000000000000000"); - sts = OEMCrypto_SelectKey(s.session_id(), &keyId[0], keyId.size()); + sts = OEMCrypto_SelectKey(s.session_id(), s.license().keys[0].key_id, + s.license().keys[0].key_id_length); ASSERT_EQ(OEMCrypto_SUCCESS, sts); vector encryptionIv = wvcdm::a2b_hex("719dbcb253b2ec702bb8c1b1bc2f3bc6"); @@ -3191,6 +3191,10 @@ TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_20) { class GenericCryptoTest : public OEMCryptoSessionTests { protected: + // buffer_size_ must be a multiple of encryption block size, 16. We'll use a + // reasonable number of blocks for most of the tests. + GenericCryptoTest() : buffer_size_(160) {} + virtual void SetUp() { OEMCryptoSessionTests::SetUp(); ASSERT_NO_FATAL_FAILURE(session_.open()); @@ -3331,7 +3335,7 @@ class GenericCryptoTest : public OEMCryptoSessionTests { } // This must be a multiple of encryption block size. - size_t buffer_size_ = 160; + size_t buffer_size_; vector clear_buffer_; vector encrypted_buffer_; uint8_t iv_[wvcdm::KEY_IV_SIZE];