fix(interception): emit KEY_SIZE for EC keys

Revert 29b2a85. AOSP 15 KeyMint reference TA at
system/keymint/common/src/tag/info.rs:61-89 lists both Tag::EcCurve
and Tag::KeySize in KEYMINT_ENFORCED_CHARACTERISTICS, and
check_ec_params at common/src/tag.rs:632 says "Key size is not
needed, but if present should match the curve" -- the TA passes
through whatever the caller supplies and keystore2 supplies both
for EC keys per KeyMintBenchmark.cpp:234,259. Omitting KEY_SIZE
made the simulator's characteristics list shorter than real
hardware, a detection fingerprint.
This commit is contained in:
Enginex0
2026-05-19 05:15:51 +01:00
parent 57035b2c94
commit 17b359e94d
@@ -1068,9 +1068,7 @@ private fun KeyMintAttestation.toAuthorizations(
this.blockMode.forEach { authList.add(createAuth(Tag.BLOCK_MODE, KeyParameterValue.blockMode(it))) }
this.digest.forEach { authList.add(createAuth(Tag.DIGEST, KeyParameterValue.digest(it))) }
this.padding.forEach { authList.add(createAuth(Tag.PADDING, KeyParameterValue.paddingMode(it))) }
if (this.algorithm != Algorithm.EC || this.ecCurve == null) {
authList.add(createAuth(Tag.KEY_SIZE, KeyParameterValue.integer(this.keySize)))
}
if (this.rsaPublicExponent != null) {
authList.add(createAuth(Tag.RSA_PUBLIC_EXPONENT, KeyParameterValue.longInteger(this.rsaPublicExponent.toLong())))
}