Fix key size when decrypting KCB with entitlement keys.
Merge from Widevine repo of http://go/wvgerrit/42942 This CL changes test code only. Bug: 73132054 test: unit tests Change-Id: Ic9ca1879a942b0cad8ea15a98ed263a5fd170b4c
This commit is contained in:
@@ -750,7 +750,10 @@ OEMCryptoResult SessionContext::InstallKey(
|
|||||||
return OEMCrypto_ERROR_INVALID_CONTEXT;
|
return OEMCrypto_ERROR_INVALID_CONTEXT;
|
||||||
}
|
}
|
||||||
if (!DecryptMessage(content_key, key_control_iv, key_control,
|
if (!DecryptMessage(content_key, key_control_iv, key_control,
|
||||||
&key_control_str, 128 /* key size */)) {
|
&key_control_str,
|
||||||
|
(session_keys_->type() == OEMCrypto_EntitlementLicense
|
||||||
|
? 256
|
||||||
|
: 128) /* key size */)) {
|
||||||
LOGE("[Installkey(): ERROR: Could not decrypt content key]");
|
LOGE("[Installkey(): ERROR: Could not decrypt content key]");
|
||||||
return OEMCrypto_ERROR_UNKNOWN_FAILURE;
|
return OEMCrypto_ERROR_UNKNOWN_FAILURE;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -516,6 +516,7 @@ void Session::FillSimpleMessage(uint32_t duration, uint32_t control,
|
|||||||
void Session::FillSimpleEntitlementMessage(
|
void Session::FillSimpleEntitlementMessage(
|
||||||
uint32_t duration, uint32_t control, uint32_t nonce,
|
uint32_t duration, uint32_t control, uint32_t nonce,
|
||||||
const std::string& pst) {
|
const std::string& pst) {
|
||||||
|
has_entitlement_license_ = true;
|
||||||
EXPECT_EQ(
|
EXPECT_EQ(
|
||||||
1, GetRandBytes(license_.mac_key_iv, sizeof(license_.mac_key_iv)));
|
1, GetRandBytes(license_.mac_key_iv, sizeof(license_.mac_key_iv)));
|
||||||
EXPECT_EQ(1, GetRandBytes(license_.mac_keys, sizeof(license_.mac_keys)));
|
EXPECT_EQ(1, GetRandBytes(license_.mac_keys, sizeof(license_.mac_keys)));
|
||||||
|
|||||||
Reference in New Issue
Block a user