From b957267b6398d865e888b9c57d2a076a6bbe7bbd Mon Sep 17 00:00:00 2001 From: Pete Skeggs Date: Tue, 27 Jun 2023 14:45:02 -0700 Subject: [PATCH] lib: modem_jwt: Use unsigned int for sec_tag Modem sec tags are unsigned, so use that representation instead of plain int. Signed-off-by: Pete Skeggs --- include/modem/modem_jwt.h | 2 +- lib/modem_jwt/modem_jwt.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/modem/modem_jwt.h b/include/modem/modem_jwt.h index e7236b0d2da9..c88674838956 100644 --- a/include/modem/modem_jwt.h +++ b/include/modem/modem_jwt.h @@ -36,7 +36,7 @@ enum jwt_alg_type { /** @brief JWT parameters required for JWT generation and pointer to generated JWT */ struct jwt_data { /** Modem sec tag to use for JWT signing */ - int sec_tag; + unsigned int sec_tag; /** Key type in the specified sec tag */ enum jwt_key_type key; /** JWT signing algorithm */ diff --git a/lib/modem_jwt/modem_jwt.c b/lib/modem_jwt/modem_jwt.c index 3dccd84d813b..d9cff70e0d78 100644 --- a/lib/modem_jwt/modem_jwt.c +++ b/lib/modem_jwt/modem_jwt.c @@ -13,7 +13,7 @@ #include #define JWT_CMD_TEMPLATE "AT%%JWT=%d,%u,\"%s\",\"%s\"" -#define JWT_CMD_TEMPLATE_SEC_TAG "AT%%JWT=%d,%u,\"%s\",\"%s\",%d,%d" +#define JWT_CMD_TEMPLATE_SEC_TAG "AT%%JWT=%d,%u,\"%s\",\"%s\",%u,%d" #define MAX_INT_PRINT_SZ 11 #define JWT_CMD_PRINT_INT_SZ (MAX_INT_PRINT_SZ * 4) #define GET_BASE64_DECODED_LEN(n) (3 * n / 4)