From 9ac480a60d72ccb6d1f930305c88ca7e184f635d Mon Sep 17 00:00:00 2001 From: jordan Date: Wed, 2 Jul 2025 10:00:28 -0500 Subject: [PATCH 1/2] linuxkm fedora: fix uninitialized build errors. --- wolfcrypt/src/camellia.c | 2 +- wolfcrypt/src/des3.c | 4 ++-- wolfcrypt/src/misc.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/wolfcrypt/src/camellia.c b/wolfcrypt/src/camellia.c index c1ff47e39..affc698c5 100644 --- a/wolfcrypt/src/camellia.c +++ b/wolfcrypt/src/camellia.c @@ -1022,7 +1022,7 @@ static int camellia_setup256(const unsigned char *key, u32 *subkey) static int camellia_setup192(const unsigned char *key, u32 *subkey) { unsigned char kk[32]; - u32 krll, krlr, krrl,krrr; + u32 krll = 0, krlr = 0, krrl = 0, krrr = 0; XMEMCPY(kk, key, 24); XMEMCPY((unsigned char *)&krll, key+16,4); diff --git a/wolfcrypt/src/des3.c b/wolfcrypt/src/des3.c index c4593c226..adefaa229 100644 --- a/wolfcrypt/src/des3.c +++ b/wolfcrypt/src/des3.c @@ -1677,7 +1677,7 @@ static void DesProcessBlock(Des* des, const byte* in, byte* out) { - word32 l, r; + word32 l = 0, r = 0; XMEMCPY(&l, in, sizeof(l)); XMEMCPY(&r, in + sizeof(l), sizeof(r)); @@ -1700,7 +1700,7 @@ static void Des3ProcessBlock(Des3* des, const byte* in, byte* out) { - word32 l, r; + word32 l = 0, r = 0; XMEMCPY(&l, in, sizeof(l)); XMEMCPY(&r, in + sizeof(l), sizeof(r)); diff --git a/wolfcrypt/src/misc.c b/wolfcrypt/src/misc.c index c41d08483..0c53cdae4 100644 --- a/wolfcrypt/src/misc.c +++ b/wolfcrypt/src/misc.c @@ -1009,7 +1009,7 @@ WC_MISC_STATIC WC_INLINE void ato64(const byte *in, w64wrapper *w64) #ifdef BIG_ENDIAN_ORDER XMEMCPY(&w64->n, in, sizeof(w64->n)); #else - word64 _in; + word64 _in = 0; XMEMCPY(&_in, in, sizeof(_in)); w64->n = ByteReverseWord64(_in); #endif /* BIG_ENDIAN_ORDER */ From 9e811b5bd590a1068b66574bfe0035940860a8f4 Mon Sep 17 00:00:00 2001 From: jordan Date: Wed, 2 Jul 2025 10:46:38 -0500 Subject: [PATCH 2/2] wolfcrypt misc: avoid frivolous initialization. --- wolfcrypt/src/misc.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/wolfcrypt/src/misc.c b/wolfcrypt/src/misc.c index 0c53cdae4..43ef03f32 100644 --- a/wolfcrypt/src/misc.c +++ b/wolfcrypt/src/misc.c @@ -1009,9 +1009,12 @@ WC_MISC_STATIC WC_INLINE void ato64(const byte *in, w64wrapper *w64) #ifdef BIG_ENDIAN_ORDER XMEMCPY(&w64->n, in, sizeof(w64->n)); #else - word64 _in = 0; - XMEMCPY(&_in, in, sizeof(_in)); - w64->n = ByteReverseWord64(_in); + union { + word64 w; + byte b[sizeof(word64)]; + } _in; + XMEMCPY(_in.b, in, sizeof(_in)); + w64->n = ByteReverseWord64(_in.w); #endif /* BIG_ENDIAN_ORDER */ }