From 2d9292bfa5565b90cecf2ee91511a103661e8003 Mon Sep 17 00:00:00 2001 From: gojimmypi Date: Wed, 20 Sep 2023 18:40:11 -0700 Subject: [PATCH 1/2] initialize internal.c vars for espressif/cmake --- src/internal.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/internal.c b/src/internal.c index 6f60d7b37..88c1ac278 100644 --- a/src/internal.c +++ b/src/internal.c @@ -873,6 +873,7 @@ int IdentifyKey(const byte* in, word32 inSz, int isPrivate, void* heap) word32 idx; int ret; int dynType = isPrivate ? DYNTYPE_PRIVKEY : DYNTYPE_PUBKEY; + (void) dynType; key = (union wolfSSH_key*)WMALLOC(sizeof(union wolfSSH_key), heap, dynType); @@ -8323,8 +8324,8 @@ int SendKexInit(WOLFSSH* ssh) byte* payload = NULL; char* kexAlgoNames = NULL; char* keyAlgoNames = NULL; - const byte* algo; - word32 algoCount, idx = 0, payloadSz = 0, + const byte* algo = 0; + word32 algoCount = 0, idx = 0, payloadSz = 0, kexAlgoNamesSz = 0, keyAlgoNamesSz = 0; int ret = WS_SUCCESS; @@ -9051,8 +9052,8 @@ int SendKexDhReply(WOLFSSH* ssh) byte kPad = 0; word32 sigBlockSz = 0; word32 payloadSz = 0; - byte* output; - word32 idx; + byte* output = 0; + word32 idx = 0; word32 keyIdx = 0; byte msgId = MSGID_KEXDH_REPLY; enum wc_HashType hashId = WC_HASH_TYPE_NONE; From 56ca2d636ab31e4790ae6733da4673368d0a98cb Mon Sep 17 00:00:00 2001 From: gojimmypi Date: Sat, 23 Sep 2023 08:38:44 -0700 Subject: [PATCH 2/2] WOLFSSH_UNUSED instead of (void)var --- src/internal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/internal.c b/src/internal.c index 88c1ac278..56fb1f4d2 100644 --- a/src/internal.c +++ b/src/internal.c @@ -873,7 +873,7 @@ int IdentifyKey(const byte* in, word32 inSz, int isPrivate, void* heap) word32 idx; int ret; int dynType = isPrivate ? DYNTYPE_PRIVKEY : DYNTYPE_PUBKEY; - (void) dynType; + WOLFSSH_UNUSED(dynType); key = (union wolfSSH_key*)WMALLOC(sizeof(union wolfSSH_key), heap, dynType);