Skip to content

Add e_/w_qcstatem_psd2_orgid_format: organizationIdentifier format check for PSD2 certificates - #1079

Merged
christopher-henderson merged 14 commits into
masterfrom
e_qcstatem_psd2_orgid-pr
Sep 6, 2026
Merged

christopher-henderson merged 14 commits into
masterfrom
e_qcstatem_psd2_orgid-pr

Conversation

@christopher-henderson

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

Copy link
Copy Markdown
Member

Adds e_qcstatem_psd2_orgid_format and w_qcstatem_psd2_orgid_format that check a PSD2 certificate's subject:organizationIdentifier matches the PSD<country>-<NCAid>-<PSPid> structure (ETSI TS 119 495, GEN-5.2.1-3 — Error before V1.5.1's shall→should downgrade, Warn from V1.5.1 onward).

- 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.
…lint

The repo's custom lint-format checker (integration/lints) requires every
zlint lint file's first function declaration to be func init(). Reorder
the shared helpers after init() rather than before it.
psd2OrgIdCheckApplies now checks the Subject-DN conditions (which
disqualify the common non-PSD2 case) before parsing the qcStatements
extension, skipping the ASN.1 unmarshal for certificates that don't carry
a "PSD"-prefixed organizationIdentifier.

Also moves the "why Execute doesn't defer on GetErrorInfo()" rationale to
live once above psd2OrgIdCheckApplies (the function it actually explains)
instead of being duplicated verbatim in both lints' Execute methods.
Base automatically changed from e_qcstatem_psd2_valid to master September 6, 2026 16:37
# Conflicts:
#	v3/lints/etsi/lint_qcstatem_psd2_valid.go
#	v3/util/qc_stmt.go
#	v3/util/qc_stmt_test.go
#	v3/util/time.go
# Conflicts:
#	v3/util/time.go
@christopher-henderson
christopher-henderson merged commit e7c03ae into master Sep 6, 2026
8 checks passed
@christopher-henderson
christopher-henderson deleted the e_qcstatem_psd2_orgid-pr branch September 6, 2026 17:17
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