From b132db61e45603878944e2cd11ea9334838d274d Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Thu, 26 Sep 2024 00:31:15 -0400 Subject: project: Use unsigned byte for data Signed-off-by: Ian Moffett --- client/main.c | 2 +- lib/include/net/stpsession.h | 6 +++--- ostp.d/net/otd_auth.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/client/main.c b/client/main.c index 1551065..e6fcb7a 100644 --- a/client/main.c +++ b/client/main.c @@ -39,7 +39,7 @@ #define OSTP_PORT 5352 static void -log_pubkey(unsigned char *pubkey) +log_pubkey(uint8_t pubkey[]) { for (size_t i = 0; i < 32; ++i) { printf("%02X ", pubkey[i] & 0xFF); diff --git a/lib/include/net/stpsession.h b/lib/include/net/stpsession.h index 6564cc4..1b22e1b 100644 --- a/lib/include/net/stpsession.h +++ b/lib/include/net/stpsession.h @@ -66,10 +66,10 @@ * R: Reserved, keep zero. */ struct session_request { - char hash[64]; + uint8_t hash[64]; uint8_t options; - char pubkey[32]; - char pad[8]; + uint8_t pubkey[32]; + uint8_t pad[8]; } PACKED; #endif /* STP_SESSION_H_ */ diff --git a/ostp.d/net/otd_auth.c b/ostp.d/net/otd_auth.c index 9784356..e16d7b2 100644 --- a/ostp.d/net/otd_auth.c +++ b/ostp.d/net/otd_auth.c @@ -35,7 +35,7 @@ #define KEY_BYTE_WIDTH 32 static void -log_pubkey(char pubkey[KEY_BYTE_WIDTH]) +log_pubkey(uint8_t pubkey[KEY_BYTE_WIDTH]) { for (size_t i = 0; i < KEY_BYTE_WIDTH; ++i) { printf("%02X ", pubkey[i] & 0xFF); -- cgit v1.2.3