Fix key_control_iv in OEMCrypto tests
[ Merge of http://go/wvgerrit/145989 ] The key_control_iv field is used with an encrypted KCB. With v17, the KCB is in the clear and this field should have a length of 0. This updates the tests to set the field correctly. Bug: 224375138 Test: GtsMediaTestCases on sunfish Change-Id: I2973bc064705557c878bb1fe943e5fde92977dcc
This commit is contained in:
@@ -749,9 +749,15 @@ void LicenseRoundTrip::FillCoreResponseSubstrings() {
|
||||
core_response_.key_array[i].key_data =
|
||||
FindSubstring(response_data_.keys[i].key_data,
|
||||
response_data_.keys[i].key_data_length);
|
||||
core_response_.key_array[i].key_control_iv =
|
||||
FindSubstring(response_data_.keys[i].control_iv,
|
||||
sizeof(response_data_.keys[i].control_iv));
|
||||
if (core_request().api_major_version < kClearControlBlockAPIMajor ||
|
||||
(core_request().api_major_version == kClearControlBlockAPIMajor &&
|
||||
core_request().api_minor_version < kClearControlBlockAPIMinor)) {
|
||||
core_response_.key_array[i].key_control_iv =
|
||||
FindSubstring(response_data_.keys[i].control_iv,
|
||||
sizeof(response_data_.keys[i].control_iv));
|
||||
} else {
|
||||
core_response_.key_array[i].key_control_iv = FindSubstring(nullptr, 0);
|
||||
}
|
||||
core_response_.key_array[i].key_control =
|
||||
FindSubstring(&response_data_.keys[i].control,
|
||||
sizeof(response_data_.keys[i].control));
|
||||
|
||||
Reference in New Issue
Block a user