From cb44fe34770e7ecb699a542f79292baecccce131 Mon Sep 17 00:00:00 2001 From: David Garske Date: Mon, 25 Nov 2024 10:38:33 -0800 Subject: [PATCH] Update to VS2022. Fix a few warnings. --- tools/keytools/sign.c | 9 ++++---- tools/keytools/wolfBootKeygenTool.vcxproj | 10 ++++---- tools/keytools/wolfBootSignTool.vcxproj | 28 +++++++++++------------ 3 files changed, 24 insertions(+), 23 deletions(-) diff --git a/tools/keytools/sign.c b/tools/keytools/sign.c index 77a3d4f4a..c13ad6136 100644 --- a/tools/keytools/sign.c +++ b/tools/keytools/sign.c @@ -1809,7 +1809,7 @@ static int base_diff(const char *f_base, uint8_t *pubkey, uint32_t pubkey_sz, in struct stat st; void *base = NULL; void *buffer = NULL; - uint8_t dest[WOLFBOOT_SECTOR_SIZE]; + static uint8_t dest[WOLFBOOT_SECTOR_SIZE]; uint8_t ff = 0xff; int r; uint32_t blksz = WOLFBOOT_SECTOR_SIZE; @@ -1887,11 +1887,11 @@ static int base_diff(const char *f_base, uint8_t *pubkey, uint32_t pubkey_sz, in /* Retrieve the hash digest of the base image */ if (CMD.hash_algo == HASH_SHA256) - base_hash_sz = sign_tool_find_header(base + 8, HDR_SHA256, &base_hash); + base_hash_sz = sign_tool_find_header((uint8_t*)base + 8, HDR_SHA256, &base_hash); else if (CMD.hash_algo == HASH_SHA384) - base_hash_sz = sign_tool_find_header(base + 8, HDR_SHA384, &base_hash); + base_hash_sz = sign_tool_find_header((uint8_t*)base + 8, HDR_SHA384, &base_hash); else if (CMD.hash_algo == HASH_SHA3) - base_hash_sz = sign_tool_find_header(base + 8, HDR_SHA3_384, &base_hash); + base_hash_sz = sign_tool_find_header((uint8_t*)base + 8, HDR_SHA3_384, &base_hash); #if HAVE_MMAP /* Open second image file */ @@ -2656,6 +2656,7 @@ int main(int argc, char** argv) CMD.fw_version = argv[i+2]; } + memset(buf, 0, sizeof(buf)); strncpy((char*)buf, CMD.image_file, sizeof(buf)-1); tmpstr = strrchr((char*)buf, '.'); if (tmpstr) { diff --git a/tools/keytools/wolfBootKeygenTool.vcxproj b/tools/keytools/wolfBootKeygenTool.vcxproj index ec740ee8a..95d61a458 100644 --- a/tools/keytools/wolfBootKeygenTool.vcxproj +++ b/tools/keytools/wolfBootKeygenTool.vcxproj @@ -22,32 +22,32 @@ {599F7765-B224-41D4-AA56-597FFA9763BC} Win32Proj wolfBootKeygenTool - 10.0.20348.0 + 10.0 Application true - v141 + v143 Unicode Application false - v141 + v143 true Unicode Application true - v141 + v143 Unicode Application false - v141 + v143 true Unicode diff --git a/tools/keytools/wolfBootSignTool.vcxproj b/tools/keytools/wolfBootSignTool.vcxproj index f5a105066..fc5cdb2d4 100755 --- a/tools/keytools/wolfBootSignTool.vcxproj +++ b/tools/keytools/wolfBootSignTool.vcxproj @@ -22,32 +22,32 @@ {0E5B9C81-CA2B-47CA-BA83-074078CF3393} Win32Proj wolfBootSignTool - 10.0.20348.0 + 10.0 Application true - v141 + v143 Unicode Application false - v141 + v143 true Unicode Application true - v141 + v143 Unicode Application false - v141 + v143 true Unicode @@ -92,8 +92,8 @@ Level3 Disabled - WOLFSSL_USER_SETTINGS;DELTA_UPDATES;%(PreprocessorDefinitions) - .;../../lib/wolfssl;../../include;%(AdditionalIncludeDirectories) + WOLFSSL_USER_SETTINGS;DELTA_UPDATES;%(PreprocessorDefinitions) + .;../../lib/wolfssl;../../include;%(AdditionalIncludeDirectories) Console @@ -106,8 +106,8 @@ Level3 Disabled - WOLFSSL_USER_SETTINGS;DELTA_UPDATES;%(PreprocessorDefinitions) - .;../../lib/wolfssl;../../include;%(AdditionalIncludeDirectories) + WOLFSSL_USER_SETTINGS;DELTA_UPDATES;%(PreprocessorDefinitions) + .;../../lib/wolfssl;../../include;%(AdditionalIncludeDirectories) Console @@ -122,8 +122,8 @@ MaxSpeed true true - WOLFSSL_USER_SETTINGS;DELTA_UPDATES;%(PreprocessorDefinitions) - .;../../lib/wolfssl;../../include;%(AdditionalIncludeDirectories) + WOLFSSL_USER_SETTINGS;DELTA_UPDATES;%(PreprocessorDefinitions) + .;../../lib/wolfssl;../../include;%(AdditionalIncludeDirectories) Console @@ -140,8 +140,8 @@ MaxSpeed true true - WOLFSSL_USER_SETTINGS;DELTA_UPDATES;%(PreprocessorDefinitions) - .;../../lib/wolfssl;../../include;%(AdditionalIncludeDirectories) + WOLFSSL_USER_SETTINGS;DELTA_UPDATES;%(PreprocessorDefinitions) + .;../../lib/wolfssl;../../include;%(AdditionalIncludeDirectories) Console @@ -151,7 +151,7 @@ - +