Skip to content

Add e_qcstatem_psd2_ncaname_valid: NCAName length check for PSD2 QCStatements - #1075

Merged
christopher-henderson merged 13 commits into
masterfrom
e_qcstatem_psd2_ncaname_valid-pr
Sep 6, 2026
Merged

christopher-henderson merged 13 commits into
masterfrom
e_qcstatem_psd2_ncaname_valid-pr

Conversation

@christopher-henderson

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

Copy link
Copy Markdown
Member

Adds e_qcstatem_psd2_ncaname_valid that checks a PSD2 QCStatement's NCAName is non-empty and at most 256 characters (ETSI TS 119 495, GEN-5.2.3-1/GEN-5.2.3-1A).

- 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.
Repoint Citation and the embedded clause text at V1.8.1 (2026-04), and
add GEN-5.2.3-1A (the NCAName "NA" carve-out) to the formal Citation
field -- it was only mentioned in the comment before.
…AName message

e_qcstatem_psd2_valid's base util.ParseQcStatem now enforces Annex A's
SIZE(1..256) bound structurally (as of e_qcstatem_psd2_valid@c006e0bf,
merged into this PR's CI view via the base branch). Since Execute()
checked s.GetErrorInfo() before its own nameLen checks, an empty or
oversized NCAName now hit that generic structural message first,
making this lint's own "NCAName must not be empty" / "must be at most
256 characters" Details unreachable -- breaking
TestEtsiQcStatemPsd2NcaNameValid once tested against the merged state.

Reorder so this lint's own NCAName-specific checks (against
psd2.Decoded, which stays populated even when GetErrorInfo() is
non-empty for a SIZE violation) run first, falling back to the generic
structural message only for problems they can't explain (wrong ASN.1
type, issues in other fields).
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 c117e05 into master Sep 6, 2026
8 checks passed
@christopher-henderson
christopher-henderson deleted the e_qcstatem_psd2_ncaname_valid-pr branch September 6, 2026 17:04
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