Repository navigation
Conversation
AllowedSigner's Display output was rejected by OpenSSH and by this crate's own parser. Options were space-separated and unquoted, and timestamps were written as raw UNIX epochs. Display now writes comma-separated options with quoted values, timestamps as YYYYMMDDHHMMSSZ clamped to the range OpenSSH accepts, escapes quotes in namespaces, and quotes principals containing whitespace or '#'. The parser now follows the ssh-keygen(1) ALLOWED SIGNERS format: options are a single comma-separated field, so space-separated options are rejected. It also accepts tabs between fields and a case-insensitive Z or UTC timestamp suffix, and rejects unknown options, empty options, cert-authority with a value, and stray quotes.
Port OpenSSH's allowed signers parser so that a line means the same thing here as it does to ssh-keygen, and make Display fail instead of writing a line that OpenSSH would read back differently. - Read \" in a quoted option value as a literal quote, so namespaces containing quotes round-trip. - Replace the splitter, whose quote check looked at the last token of the line instead of the next one. - Stop clamping timestamps. Display now fails for values OpenSSH can't read back, including pairs that clamping collapsed together. - Fail in Display for principals or namespaces that are empty or contain commas, quotes (principals), or line breaks. - Add test cases from OpenSSH's test_strdelim.c, test_convtime.c, and sshsig.sh.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Flagged by Opus 5.5. My implementation of the allowed signers options is wrong and not accepted by OpenSSH.
A few issues include:
Refer to the test cases / code comments for examples of the wrong format.
This implementation is checked against OpenSSH and the allowed signers specs.