Skip to content
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

Fix formatting of authorization record. #52

Merged
merged 1 commit into from
Apr 8, 2024
Merged

Conversation

cjevans-google
Copy link
Collaborator

Some systems consider char to be signed by default, which causes the system implementation of printf("%02x", (char)0xd6); to print ffffffd6, instead of just d6. As the nonce almost always has "negative" bytes, this badly corrupts the record formatting.

Also add a _Static_assert for the exact size of the authorization record, for good measure.

@cjevans-google cjevans-google requested a review from rkr35 April 8, 2024 06:49
Some systems consider `char` to be signed by default, which causes the
system implementation of `printf("%02x", (char)0xd6);` to print
`ffffffd6`, instead of just `d6`.  As the nonce almost always has
"negative" bytes, this badly corrupts the record formatting.

Also add a _Static_assert for the exact size of the authorization
record, for good measure.
Copy link
Collaborator

@rkr35 rkr35 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rkr35 rkr35 merged commit d958268 into main Apr 8, 2024
4 checks passed
@rkr35 rkr35 deleted the authz-formatting-fix branch April 8, 2024 17:53
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.

2 participants