Skip to content

Add e_qcstatem_psd2_ncaid_format: NCAId syntax check for PSD2 QCStatements - #1074

Merged
christopher-henderson merged 15 commits into
masterfrom
e_qcstatem_psd2_ncaid_format-pr
Sep 6, 2026
Merged

christopher-henderson merged 15 commits into
masterfrom
e_qcstatem_psd2_ncaid_format-pr

Conversation

@christopher-henderson

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

Copy link
Copy Markdown
Member

Adds e_qcstatem_psd2_ncaid_format that checks a PSD2 QCStatement's NCAId matches the required <country>-<identifier> syntax (ETSI TS 119 495, GEN-5.2.3-2/GEN-5.2.3-5).

Integration corpus (789,896 certs) found 2 real-world errors: same issuer/subject (Firmaprofesional, eurobits.es), NCAId "BE" missing its country prefix (should be "ES-BE"). Recorded as expected.

- 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.
- Add QcStmtEtsiPsd2NcaIdPspCbValidCert01.pem fixture and Pass case to
  cover the previously-untested IdEtsiPsd2RolePspCb carve-out branch.
- Assert out.Details (not just out.Status) for the three Error fixtures.
- Add QcStmtEtsiPsd2WrongEncodingCert01.pem as an Error case to cover the
  structural-deferral branch (GetErrorInfo() != "") in Execute.
Full integration corpus (789,896 certs): 2 certificates from the same
issuer/subject (Firmaprofesional, eurobits.es, PSD2 role PSP_AI) have
NCAId = "BE" -- missing the required <country>-<identifier> structure
(should be "ES-BE", per the same cert's subject:organizationIdentifier
of PSDES-BE-6887). A genuine pre-existing issuer error, not a false
positive.
Repoint Citation and the embedded clause text at V1.8.1 (2026-04), and
add GEN-5.2.3-5 (the NCAId "NA" carve-out) to the formal Citation field
-- it was only mentioned in the comment before. The block comment had
also been quoting V1.8.1's wording ("ISO 3166-1", "Competent Authority")
while labeled as V1.1.2, which actually reads "ISO 3166", "NCA country".
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/oid.go
#	v3/util/qc_stmt.go
#	v3/util/qc_stmt_test.go
@christopher-henderson
christopher-henderson merged commit 54be9a0 into master Sep 6, 2026
8 checks passed
@christopher-henderson
christopher-henderson deleted the e_qcstatem_psd2_ncaid_format-pr branch September 6, 2026 17:03
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