Skip to content

Add e_qcstatem_psd2_valid: structural encoding check for PSD2 QCStatements - #1073

Open
christopher-henderson wants to merge 8 commits into
masterfrom
e_qcstatem_psd2_valid
Open

Add e_qcstatem_psd2_valid: structural encoding check for PSD2 QCStatements#1073
christopher-henderson wants to merge 8 commits into
masterfrom
e_qcstatem_psd2_valid

Conversation

@christopher-henderson

@christopher-henderson christopher-henderson commented Aug 8, 2026

Copy link
Copy Markdown
Member

Adds e_qcstatem_psd2_valid that checks a PSD2 QCStatement (ETSI TS 119 495 Annex A, embedded in a certificate's QcStatements extension) is structurally well-formed ASN.1.

- Assert the exact Details string for the Error case in
  TestEtsiQcStatemPsd2Valid so the test still catches a regression in
  the ASN.1 re-encoding check, not just a change in lint status.
- Add TestParseQcStatemPsd2UnmarshalFailure to cover the previously
  untested "asn1.Unmarshal fails outright" branch of the PSD2 case in
  ParseQcStatem, using truncated statementInfo bytes.
- Rename EtsiTS119495_V1_1_2_Date to EtsiTs119495_V1_1_2_Date to match
  the mixed-case naming convention used by sibling ETSI date constants.
… ETSI edition

Annex A of ETSI TS 119 495 declares NCAName, NCAId, and RoleOfPspName as
UTF8String (SIZE(1..256)), and clause 5.1's GEN-5.1-3 makes ASN.1
conformance with Annex A mandatory. util.ParseQcStatem only checked
ASN.1 re-encoding round-trip for the PSD2 statement, never field
length, so a QCStatement with an empty or oversized NCAName/NCAId/
RoleOfPspName incorrectly passed e_qcstatem_psd2_valid.

Also repoint the lint's Citation and embedded ASN.1/GEN-5.1-3 text at
V1.8.1 (2026-04), the current edition, instead of V1.1.2. The
requirement text is unchanged across every edition checked (V1.1.2
through V1.8.1), so EffectiveDate stays at V1.1.2's 2018-07-01 --
that's still when the requirement first became binding on
certificates.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant