Handle unlimited usage table capacity.
[ Merge of http://go/wvgerrit/102945 ] The OEMCrypto method for usage table capacity can return zero to indicate that the usage table size is not explicitly limited. The CDM must handle this case with regard to the CDM's usage table management and information querying. The usage table initialization tests are extended to include cases where the table does not have a defined limit. AddEntry() was missing call to update the usage table header after creating a new usage entry. This call is now included and required additional changes to the usage table unit tests. Bug: 160560364 Test: Android unit tests Change-Id: Ica5d181092d2938d24deba5005a211ca883cb0f0
This commit is contained in:
@@ -2008,6 +2008,11 @@ bool CryptoSession::GetMaximumUsageTableEntries(SecurityLevel security_level,
|
||||
metrics_->oemcrypto_maximum_usage_table_header_size_.Record(
|
||||
*number_of_entries);
|
||||
|
||||
if (*number_of_entries == 0) {
|
||||
// Special value, indicating that the table size is not directly
|
||||
// limited.
|
||||
return true;
|
||||
}
|
||||
return *number_of_entries >= kMinimumUsageTableEntriesSupported;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user