Skip to content

fix: skip subjects with odd-length backslash runs in sync guard (#28)#29

Closed
spbsoluble wants to merge 1 commit into
release-1.3from
fix/issue-28-subject-guard-backslash
Closed

fix: skip subjects with odd-length backslash runs in sync guard (#28)#29
spbsoluble wants to merge 1 commit into
release-1.3from
fix/issue-28-subject-guard-backslash

Conversation

@spbsoluble

@spbsoluble spbsoluble commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Superseded by PR #31 (re-filed clean, identical diff against release-1.3). See #31.

@spbsoluble
spbsoluble force-pushed the fix/issue-28-subject-guard-backslash branch from 0c7540c to 205422e Compare July 23, 2026 17:52
The 1.3.3 guard ran new X509Name(true, netCert.Subject), which does not
throw on a CN containing an odd-length run of literal backslash bytes.
Such subjects were admitted, persisted with backslashes escape-doubled,
and then aborted Command's Full Scan with 'badly formatted directory
string' when the gateway un-escaped one level and re-parsed the dangling
escape on its /v2/certificate/search response.

Replace the fragile mirror-the-gateway-parse approach with a structural,
version-independent check: reject any subject whose literal backslash run
has odd length (HasOddBackslashRun), keeping a defensive local X509Name
parse as a second net. Even-length runs round-trip cleanly, matching the
lab reproduction's abort/no-abort split (shape1 vs shape2/shape3).

Add pure unit regression tests (no GCP required) via InternalsVisibleTo.

This branch is based on release-1.3 and also drops the committed
merge-conflict markers that release-1.3 carried in CHANGELOG.md and
GCPCAS/Client/GCPCASClient.cs (same resolution as #27).
@spbsoluble
spbsoluble force-pushed the fix/issue-28-subject-guard-backslash branch from 205422e to 8fb55fd Compare July 23, 2026 17:56
@spbsoluble

Copy link
Copy Markdown
Contributor Author

Closing and superseding with a fresh PR from branch fix/issue-30-subject-guard-backslash (re-filed to remove stale references; identical clean diff).

@spbsoluble spbsoluble closed this Jul 23, 2026
@spbsoluble
spbsoluble deleted the fix/issue-28-subject-guard-backslash branch July 23, 2026 17:56
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