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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/authorization_record.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ int authorization_record_print_hex_string(
return -1;
}
int i;
const char* buf = (const char*)record;
const uint8_t* buf = (const uint8_t*)record;
for (i = 0; i < sizeof(*record); ++i) {
printf("%02x", buf[i]);
}
Expand Down
5 changes: 5 additions & 0 deletions examples/authorization_record.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ struct authorization_record {
#define AUTHORIZATION_RECORD_MAGIC ("AUTHZREC")
#define AUTHORIZATION_RECORD_SIZE (sizeof(struct authorization_record))

// Note that changing the size of this structure may cause compatability issues;
// the authorization infrastructure expects the above structure format.
_Static_assert(AUTHORIZATION_RECORD_SIZE == 464,
"unexpected authorization_record size");

int authorization_record_print_hex_string(
const struct authorization_record* record);

Expand Down
Loading