Skip to content

Commit

Permalink
Override OEM unlock check with downstream security state flag wheneve…
Browse files Browse the repository at this point in the history
…r it is present
  • Loading branch information
quh4gko8 committed Oct 1, 2024
1 parent 2bcbdc1 commit 0c26690
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1523,6 +1523,13 @@ static AttestationResult generateSerialized(final Context context, final byte[]
osEnforcedFlags |= OS_ENFORCED_FLAGS_SYSTEM_USER;
}
if (extraSecurityState != Bundle.EMPTY) {
String oemUnlockAllowedKey = "android.ext.OEM_UNLOCK_ALLOWED";
if (extraSecurityState.containsKey(oemUnlockAllowedKey)) {
osEnforcedFlags &= ~OS_ENFORCED_FLAGS_OEM_UNLOCK_ALLOWED;
if (extraSecurityState.getBoolean(oemUnlockAllowedKey, false)) {
osEnforcedFlags |= OS_ENFORCED_FLAGS_OEM_UNLOCK_ALLOWED;
}
}
}
serializer.putInt(osEnforcedFlags);

Expand Down

0 comments on commit 0c26690

Please sign in to comment.