fix(interception): restore noAuthRequired default and callerNonce attestation

NO_AUTH_REQUIRED should be added to authorizations when not explicitly
disabled (!= false), matching AOSP default behavior. The != null check
from PR157 drops the tag for keys where noAuthRequired was parsed as
null (e.g. persisted keys), creating an attestation/authorization
mismatch that detectors can spot.

Also restores CALLER_NONCE in softwareEnforced attestation list.
This commit is contained in:
Enginex0
2026-03-22 00:06:28 +01:00
parent 63789ba29d
commit b2bf0ce599
2 changed files with 7 additions and 4 deletions
@@ -516,6 +516,11 @@ object AttestationBuilder {
)
)
}
if (params.callerNonce == true) {
list.add(
DERTaggedObject(true, AttestationConstants.TAG_CALLER_NONCE, DERNull.INSTANCE)
)
}
if (params.unlockedDeviceRequired == true) {
list.add(
DERTaggedObject(
@@ -1069,10 +1069,8 @@ private fun KeyMintAttestation.toAuthorizations(
)
}
if (this.noAuthRequired != null) {
authList.add(
createAuth(Tag.NO_AUTH_REQUIRED, KeyParameterValue.boolValue(this.noAuthRequired))
)
if (this.noAuthRequired != false) {
authList.add(createAuth(Tag.NO_AUTH_REQUIRED, KeyParameterValue.boolValue(true)))
}
if (this.callerNonce == true) {