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 f8bfa0d
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 23696d2f61
commit bd40f4b950
@@ -194,9 +194,13 @@ object AttestationBuilder {
)
}
params.padding.forEach {
if (params.padding.isNotEmpty()) {
list.add(
DERTaggedObject(true, AttestationConstants.TAG_PADDING, ASN1Integer(it.toLong()))
DERTaggedObject(
true,
AttestationConstants.TAG_PADDING,
DERSet(params.padding.map { ASN1Integer(it.toLong()) }.toTypedArray()),
)
)
}