@@ -20,7 +20,6 @@ import com.android.keyattestation.verifier.AuthorizationList
2020import com.android.keyattestation.verifier.KeyDescription
2121import com.android.keyattestation.verifier.KeyMintTag
2222import com.android.keyattestation.verifier.Origin
23- import com.android.keyattestation.verifier.ProvisioningInfoMap
2423import com.android.keyattestation.verifier.RootOfTrust
2524import com.android.keyattestation.verifier.SecurityLevel
2625import com.android.keyattestation.verifier.VerifiedBootState
@@ -53,6 +52,7 @@ object Certs {
5352 val rootKey = certFactory.rootKey
5453 val factoryIntermediate = certFactory.factoryIntermediate
5554 val remoteIntermediate = certFactory.remoteIntermediate
55+ val strongBoxIntermediate = certFactory.strongBoxIntermediate
5656 val factoryAttestation = certFactory.factoryAttestation
5757}
5858
@@ -100,8 +100,8 @@ object CertLists {
100100 val validStrongboxFactoryProvisioned by lazy {
101101 listOf (
102102 certFactory.generateLeafCert(extension = certFactory.STRONG_BOX_KEY_DESCRIPTION_EXT ),
103- certFactory.generateAttestationCert(issuer = certFactory .strongBoxIntermediate.subject),
104- certFactory .strongBoxIntermediate,
103+ certFactory.generateAttestationCert(issuer = Certs .strongBoxIntermediate.subject),
104+ Certs .strongBoxIntermediate,
105105 Certs .root,
106106 )
107107 }
@@ -340,43 +340,6 @@ object CertLists {
340340 )
341341 }
342342
343- val malformedProvisioningInfo by lazy {
344- listOf (
345- certFactory.generateLeafCert(),
346- certFactory.generateAttestationCert(
347- issuer = certFactory.rkpIntermediate.subject,
348- signingKey = certFactory.rkpKey.private,
349- extraExtension =
350- Extension (
351- ProvisioningInfoMap .OID ,
352- /* critical= */ false ,
353- ASN1Integer (BigInteger .valueOf(1234567 )).encoded,
354- ),
355- ),
356- certFactory.rkpIntermediate,
357- Certs .remoteIntermediate,
358- certFactory.root,
359- )
360- }
361-
362- /* Different revoked serial numbers for testing. */
363- @JvmField val REVOKED_SERIAL_NUMBER = 42 .toBigInteger()
364- @JvmField val REVOKED_SERIAL_NUMBER_BIG = 8000000000000 .toBigInteger()
365- @JvmField
366- val REVOKED_SERIAL_NUMBER_LONG_STRING = " c35747a084470c3135aeefe2b8d40cd6" .toBigInteger(16 )
367- @JvmField val REVOKED_SERIAL_NUMBER_ODD_LENGTH = 1228286566665971148 .toBigInteger()
368-
369- /* A chain where the attesstation certificate has {@link REVOKED_SERIAL_NUMBER}. */
370- @JvmStatic
371- val revoked by lazy {
372- listOf (
373- certFactory.generateLeafCert(),
374- certFactory.generateAttestationCert(serialNumber = REVOKED_SERIAL_NUMBER ),
375- Certs .factoryIntermediate,
376- certFactory.root,
377- )
378- }
379-
380343 private fun generateValidLeafCertWithAppendedTag (appendedTag : Int , appendedValue : ASN1Encodable ) =
381344 certFactory.generateLeafCert(
382345 extension =
@@ -508,6 +471,24 @@ object Chains {
508471 )
509472 }
510473
474+ /* Different revoked serial numbers for testing. */
475+ @JvmField val REVOKED_SERIAL_NUMBER = 42 .toBigInteger()
476+ @JvmField val REVOKED_SERIAL_NUMBER_BIG = 8000000000000 .toBigInteger()
477+ @JvmField
478+ val REVOKED_SERIAL_NUMBER_LONG_STRING = " c35747a084470c3135aeefe2b8d40cd6" .toBigInteger(16 )
479+ @JvmField val REVOKED_SERIAL_NUMBER_ODD_LENGTH = 1228286566665971148 .toBigInteger()
480+
481+ /* A chain where the attesstation certificate has {@link REVOKED_SERIAL_NUMBER}. */
482+ @JvmStatic
483+ val revoked by lazy {
484+ KeyAttestationCertPath (
485+ certFactory.generateLeafCert(),
486+ certFactory.generateAttestationCert(serialNumber = REVOKED_SERIAL_NUMBER ),
487+ Certs .factoryIntermediate,
488+ certFactory.root,
489+ )
490+ }
491+
511492 /* A factory chain with an additional intermediate certificate. */
512493 val forgedKeybox by lazy {
513494 val compromisedAttestationKey = certFactory.generateEcKeyPair()
0 commit comments