Unit Tests for Security Patch Level
Merge of widevine change http://go/wvgerrit/16249 This CL adds unit tests and reference code for the security patch level, which is a new feature in OEMCrypto v11. This CL also adjusts the dynamic and static adapters to still run with devices that have a v10 OEMCrypto. The level 3 haystack code will be updated in a future CL. bug: 26188985 Change-Id: I518ef46b4098cf3718fe0c0390bfb6825db4fb6b
This commit is contained in:
@@ -683,6 +683,14 @@ bool SessionContext::InstallKey(const KeyId& key_id,
|
||||
LOGE("Anti-rollback hardware is required but hardware not present.");
|
||||
return false;
|
||||
}
|
||||
uint8_t minimum_patch_level
|
||||
= (key_control_block.control_bits() & kControlSecurityPatchLevelMask) >>
|
||||
kControlSecurityPatchLevelShift;
|
||||
if (minimum_patch_level > OEMCrypto_Security_Patch_Level()) {
|
||||
LOGE("[InstallKey(): security patch level: %d. Minimum:%d]",
|
||||
OEMCrypto_Security_Patch_Level(), minimum_patch_level);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!CheckNonceOrEntry(key_control_block, pst)) {
|
||||
LOGE("Failed Nonce/PST check.");
|
||||
|
||||
Reference in New Issue
Block a user