Skip to content

[WIP] fix(ssh): parse allowed signers the way OpenSSH does - #54

Draft
timweri wants to merge 1 commit into
mainfrom
fix/allowed-signer-parse
Draft

timweri wants to merge 1 commit into
mainfrom
fix/allowed-signer-parse

Conversation

@timweri

@timweri timweri commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

Flagged by Opus 5.5. AllowedSigner::from_string accepted lines ssh-keygen rejects, such as space-separated options and unquoted values, and rejected lines it accepts, such as text after the key without #. It now follows parse_principals_key_and_options() and sshsigopt_parse() in sshsig.c, checked against ssh-keygen -Y verify 10.2.

alice cert-authority namespaces=git ssh-ed25519 AAAA...    # was accepted, OpenSSH rejects
alice cert-authority,namespaces="git" ssh-ed25519 AAAA...  # correct

Like OpenSSH, option names and the Z/UTC suffix are case-insensitive, and valid-after/valid-before must be after the epoch.

Display still writes the old format but #55 will that.

BREAKING CHANGE: lines with space-separated options or unquoted values no longer parse, including lines written by the old Display. AllowedSignerParsingError::UnexpectedEnd and InvalidTimestamp are removed.

@timweri
timweri added this pull request to stack #56 November 10, 2026 01:17
@timweri
timweri force-pushed the fix/allowed-signer-parse branch 3 times, most recently from 620b4a9 to 8fb127f Compare November 10, 2026 03:38
Replace AllowedSignerSplitter with a parser that follows OpenSSH's
parse_principals_key_and_options() and sshsigopt_parse() in sshsig.c.

Options are one comma-separated field with double-quoted values, as
OpenSSH requires. Space-separated options and unquoted values, which
OpenSSH rejects, are now rejected too. Like OpenSSH 10.2, option names
and the timestamp suffix (Z or UTC) are case-insensitive, valid-after
and valid-before must be after the epoch, and any text after the key
is a comment.

BREAKING CHANGE: lines with space-separated options or unquoted values
no longer parse, including lines written by the old Display.
AllowedSignerParsingError::UnexpectedEnd and InvalidTimestamp are
removed.
@timweri
timweri force-pushed the fix/allowed-signer-parse branch from 8fb127f to 93b9123 Compare November 11, 2026 18:15

This branch has not been deployed

No deployments
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