fix(attestation): encode PADDING as SET OF INTEGER per AOSP schema

PADDING (tag 6) is ENUM_REP in Tag.aidl, meaning SET OF INTEGER in the
attestation extension ASN.1, same as PURPOSE and DIGEST. Commit 1fa6f5a
added it as individual [6] INTEGER entries, causing parsers to fail with
CertificateParsingException on any RSA key attestation.
This commit is contained in:
Enginex0
2026-03-17 04:36:49 +01:00
parent 5d270ce1ad
commit b83769ff80
@@ -194,9 +194,13 @@ object AttestationBuilder {
) )
} }
params.padding.forEach { if (params.padding.isNotEmpty()) {
list.add( list.add(
DERTaggedObject(true, AttestationConstants.TAG_PADDING, ASN1Integer(it.toLong())) DERTaggedObject(
true,
AttestationConstants.TAG_PADDING,
DERSet(params.padding.map { ASN1Integer(it.toLong()) }.toTypedArray()),
)
) )
} }