Skip to content

Incorrect ASN.1 tagging (INTEGER vs ENUMERATED) in Android Key Attestation test vector #2373

@Unknown-Robot

Description

@Unknown-Robot

I am currently implementing WebAuthn verification logic and using the W3C test vectors for validation. I encountered an ASN.1 schema mismatch in the test case "Android Key Attestation with ES256 Credential".

The KeyDescription sequence in the x5c certificate extension seems to use an incorrect ASN.1 tag for the SecurityLevel fields.

According to the Android Key Attestation specification, the attestationSecurityLevel and keymintSecurityLevel fields are defined as ENUMERATED :

KeyDescription ::= SEQUENCE {
    attestationVersion           INTEGER,
    attestationSecurityLevel     SecurityLevel,
    keyMintVersion               INTEGER,
    keyMintSecurityLevel         SecurityLevel,
    attestationChallenge         OCTET_STRING,
    uniqueId                     OCTET_STRING,
    softwareEnforced             AuthorizationList,
    hardwareEnforced             AuthorizationList,
}

SecurityLevel ::= ENUMERATED {
    Software                     (0),
    TrustedEnvironment           (1),
    StrongBox                    (2),
}

However, in the provided test vector, these fields are encoded as INTEGER (Tag 0x02) instead of ENUMERATED (Tag 0x0A).

After analyzing the extnValue of the KeyDescription extension from the test vector reveals the following structure:

  • attestationVersion: INTEGER (Correct)
  • attestationSecurityLevel: INTEGER (Tag 0x02) -> INCORRECT
  • keymintVersion: INTEGER (Correct)
  • keymintSecurityLevel: INTEGER (Tag 0x02) -> INCORRECT

The test vector should be updated or re-generated to use the correct ASN.1 DER encoding (Tag 0x0A) for SecurityLevel fields, aligning it with the official Android specifications and modern device behavior.

References

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions