refactor: simplify forceGenerate dispatch gate
Any attest-key request or BYO request goes software unconditionally. Drops the alias-Elvis lookup and the nspace fallback added by thed7dc5e0->5f72acb->0b2c34frevert/restore churn, both of which silently missed when callers (Shizuku, post-restart sessions) did not share an in-memory KeyIdentifier(uid, alias) with the attest key originally registered in attestationKeys. The (shouldPatch && isAttestKeyRequest) clause is subsumed by the broader isAttestKeyRequest clause. D2 from /home/rootdev/.claude/plans/breezy-seeking-wozniak.md.
This commit is contained in:
+2
-4
@@ -495,10 +495,8 @@ class KeyMintSecurityLevelInterceptor(
|
|||||||
val forceGenerate =
|
val forceGenerate =
|
||||||
oversized ||
|
oversized ||
|
||||||
ConfigurationManager.shouldGenerate(callingUid) ||
|
ConfigurationManager.shouldGenerate(callingUid) ||
|
||||||
(ConfigurationManager.shouldPatch(callingUid) && isAttestKeyRequest) ||
|
isAttestKeyRequest ||
|
||||||
(attestationKey != null &&
|
attestationKey != null
|
||||||
(attestationKey.alias?.let { isAttestationKey(KeyIdentifier(callingUid, it)) }
|
|
||||||
?: attestationKeys.any { kid -> kid.uid == callingUid && generatedKeys[kid]?.nspace == attestationKey.nspace }))
|
|
||||||
|
|
||||||
SystemLogger.trace { "[TRACE-$txId] dispatch: forceGen=$forceGenerate hasChallenge=${challenge != null} isSymmetric=$isSymmetric isAttestKey=$isAttestKeyRequest" }
|
SystemLogger.trace { "[TRACE-$txId] dispatch: forceGen=$forceGenerate hasChallenge=${challenge != null} isSymmetric=$isSymmetric isAttestKey=$isAttestKeyRequest" }
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user