@@ -20,6 +20,7 @@ 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
2324import com.android.keyattestation.verifier.RootOfTrust
2425import com.android.keyattestation.verifier.SecurityLevel
2526import com.android.keyattestation.verifier.VerifiedBootState
@@ -52,7 +53,6 @@ object Certs {
5253 val rootKey = certFactory.rootKey
5354 val factoryIntermediate = certFactory.factoryIntermediate
5455 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 = Certs .strongBoxIntermediate.subject),
104- Certs .strongBoxIntermediate,
103+ certFactory.generateAttestationCert(issuer = certFactory .strongBoxIntermediate.subject),
104+ certFactory .strongBoxIntermediate,
105105 Certs .root,
106106 )
107107 }
@@ -340,6 +340,43 @@ 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+
343380 private fun generateValidLeafCertWithAppendedTag (appendedTag : Int , appendedValue : ASN1Encodable ) =
344381 certFactory.generateLeafCert(
345382 extension =
@@ -471,24 +508,6 @@ object Chains {
471508 )
472509 }
473510
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-
492511 /* A factory chain with an additional intermediate certificate. */
493512 val forgedKeybox by lazy {
494513 val compromisedAttestationKey = certFactory.generateEcKeyPair()
0 commit comments