From be04f16a50139a565926e3a1f8c02f8b34f8b4dc Mon Sep 17 00:00:00 2001 From: Enginex0 Date: Tue, 19 May 2026 14:35:19 +0100 Subject: [PATCH] fix(shim): restore nspace attest key lookup Reverts eea6001. The nspace attestation key lookup was part of the score-4 baseline and closes a real NPE on KEY_ID-domain references where the alias field is null. Reverted in error during the score-4-to-14 rollback; restoring to match the working baseline. --- .../keystore/shim/KeyMintSecurityLevelInterceptor.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/matrix/TEESimulator/interception/keystore/shim/KeyMintSecurityLevelInterceptor.kt b/app/src/main/java/org/matrix/TEESimulator/interception/keystore/shim/KeyMintSecurityLevelInterceptor.kt index 6a9ea1c..ee3f06e 100644 --- a/app/src/main/java/org/matrix/TEESimulator/interception/keystore/shim/KeyMintSecurityLevelInterceptor.kt +++ b/app/src/main/java/org/matrix/TEESimulator/interception/keystore/shim/KeyMintSecurityLevelInterceptor.kt @@ -495,7 +495,8 @@ class KeyMintSecurityLevelInterceptor( ConfigurationManager.shouldGenerate(callingUid) || (ConfigurationManager.shouldPatch(callingUid) && isAttestKeyRequest) || (attestationKey != null && - isAttestationKey(KeyIdentifier(callingUid, attestationKey.alias))) + (attestationKey.alias?.let { isAttestationKey(KeyIdentifier(callingUid, it)) } + ?: attestationKeys.any { kid -> kid.uid == callingUid && generatedKeys[kid]?.nspace == attestationKey.nspace })) val isAuto = ConfigurationManager.isAutoMode(callingUid)