Fix missing ASN.1 values in android-key test vector #2379
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
This PR fixes the Android Key Attestation test vector generation script.
Currently, the
softwareEnforcedandteeEnforcedvalues in theattestationextension (OID1.3.6.1.4.1.11129.2.1.17) of the generated certificate are empty sequences.However, the WebAuthn Level 3 specification (Verification Procedure for Android Key Attestation) mandates verifying that:
AuthorizationList.originfield is equal toKM_ORIGIN_GENERATED.AuthorizationList.purposefield is equal toKM_PURPOSE_SIGN.Changes
webauthn-test-vectors.pyto replace the generic empty list with ASN.1SEQUENCEconstructions:softwareEnforced: Explicit construction of emptySEQUENCEto representAuthorizationListteeEnforced: Explicit construction ofSEQUENCEto representAuthorizationListwith fields :purpose[Tag 1] : Encoded as aEXPLICIT SET OF INTEGERcontainingKM_PURPOSE_SIGN(integer2).origin[Tag 702] : Encoded as anEXPLICIT INTEGERvalueKM_ORIGIN_GENERATED(integer0).index.bswithtest-vectors/inject-generated-content.sh.References
WebAuthn Spec : Section 8.4. - Android Key Attestation Statement Format - Verification procedure
Android Documentation : Key attestation - Attestation extension - Schema
Android Source :
Notes to Maintainers
1. Stacked PR
This PR is based on the branch
issue-2373-android-key-test-vectors(from PR #2373) to avoid merge conflicts, as suggested by @emlun.2. Future Improvements
While reviewing the WebAuthn Level 3 spec (Section 8.4) regarding the "union of teeEnforced and softwareEnforced", I noticed we currently lack a test vector that exercises the "Software Only" or "Hybrid" path.
The current vector—once fixed by this PR—represents the "Ideal/Strict" path (TEE-backed). To fully validate the "Permissive Mode" logic in Relying Parties, it would be beneficial to add a separate test vector in the future where Purpose and Origin are located in
softwareEnforced.I would be happy to open a separate issue or follow-up PR to address this gap if the maintainers agree.