-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
trust: Use the same parser code for parsing and checking #483
Merged
Conversation
This file contains 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
ueno
force-pushed
the
wip/dueno/trust-check-format
branch
from
April 6, 2023 05:43
4beacb9
to
4d9f9b5
Compare
With this (bogus) input:
Old: $ _build/trust/trust check-format bogus.p11-kit
Failed at line 11: label in the END block does not match the label in the BEGIN block
bogus.p11-kit: FAIL New: $ _build/trust/trust check-format bogus.p11-kit
p11-kit: bogus.p11-kit:2: class: invalid value
p11-kit: bogus.p11-kit:3: label: invalid value
p11-kit: bogus.p11-kit:4: object-id: invalid value
p11-kit: bogus.p11-kit:5: value: invalid value
p11-kit: bogus.p11-kit:11: BEGIN ...: invalid pem block
bogus.p11-kit: FAIL |
ueno
force-pushed
the
wip/dueno/trust-check-format
branch
2 times, most recently
from
April 6, 2023 06:18
81455d8
to
002a527
Compare
ZoltanFridrich
approved these changes
Apr 6, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would just fixup some includes but looks good overall.
The trust check-format command used a dedicated parsing code for the .p11-kit format, which behaves differently from the original parsing code: sometimes it is stricter (e.g., PEM block), while other times it is not (e.g., constant names and OIDs). This makes it use the same single parser to align with the original behavior. Signed-off-by: Daiki Ueno <[email protected]>
This adds the new field "line" to p11_lexer so any errors are printed with the line numbers where they happen. Also make the header to use appropriate types for sizes and token types. Signed-off-by: Daiki Ueno <[email protected]>
ueno
force-pushed
the
wip/dueno/trust-check-format
branch
from
April 6, 2023 13:06
002a527
to
6275559
Compare
Signed-off-by: Daiki Ueno <[email protected]>
ueno
force-pushed
the
wip/dueno/trust-check-format
branch
from
April 6, 2023 13:12
6275559
to
01c944e
Compare
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.
The trust check-format command used a dedicated parsing code for the .p11-kit format, which behaves differently from the original parsing code: sometimes it is stricter (e.g., PEM block), while other times it is not (e.g., constant names and OIDs). This makes it use the same single parser to align with the original behavior.