Skip to content

Commit 065b3e4

Browse files
committed
wolfssl: add patch to fix debug messages
1 parent a459981 commit 065b3e4

File tree

4 files changed

+45
-0
lines changed

4 files changed

+45
-0
lines changed

windows_32.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
- git apply ../../wolfssl/0007-fix-kyber-prf-non-avx2.patch
2222
- git apply ../../wolfssl/0008-intel-illegal-instruction.patch
2323
- git apply ../../wolfssl/0009-reverse-only-with-avx12.patch
24+
- git apply ../../wolfssl/0010-rng-move-debug-messages-while-preserving-semantics.patch
2425
- "cp ../../windows/wolfssl-user_settings-common.h wolfssl/user_settings.h"
2526
- "cat ../../windows/wolfssl-user_settings-32.h >> wolfssl/user_settings.h"
2627
- "cp -f wolfssl/user_settings.h IDE/WIN/user_settings.h"

windows_64.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
- git apply ../../wolfssl/0007-fix-kyber-prf-non-avx2.patch
2222
- git apply ../../wolfssl/0008-intel-illegal-instruction.patch
2323
- git apply ../../wolfssl/0009-reverse-only-with-avx12.patch
24+
- git apply ../../wolfssl/0010-rng-move-debug-messages-while-preserving-semantics.patch
2425
- "cp ../../windows/wolfssl-user_settings-common.h wolfssl/user_settings.h"
2526
- "cat ../../windows/wolfssl-user_settings-64.h >> wolfssl/user_settings.h"
2627
- "cp -f wolfssl/user_settings.h IDE/WIN/user_settings.h"

windows_64_multithread.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
- git apply ../../wolfssl/0007-fix-kyber-prf-non-avx2.patch
2222
- git apply ../../wolfssl/0008-intel-illegal-instruction.patch
2323
- git apply ../../wolfssl/0009-reverse-only-with-avx12.patch
24+
- git apply ../../wolfssl/0010-rng-move-debug-messages-while-preserving-semantics.patch
2425
- "cp ../../windows/wolfssl-user_settings-common.h wolfssl/user_settings.h"
2526
- "cat ../../windows/wolfssl-user_settings-64.h >> wolfssl/user_settings.h"
2627
- "cat ../../windows/wolfssl-user_settings-multithread.h >> wolfssl/user_settings.h"
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
From bb11833d885eb4867fe9ec0f73fb65d5a26412f7 Mon Sep 17 00:00:00 2001
2+
From: Raihaan Shouhell <raihaan.shouhell@kape.com>
3+
Date: Mon, 17 Mar 2025 20:55:57 +0800
4+
Subject: [PATCH] rng: move debug messages while preserving semantics
5+
6+
---
7+
wolfcrypt/src/random.c | 14 ++++++++++----
8+
1 file changed, 10 insertions(+), 4 deletions(-)
9+
10+
diff --git a/wolfcrypt/src/random.c b/wolfcrypt/src/random.c
11+
index 278e2d72c..7c32cc024 100644
12+
--- a/wolfcrypt/src/random.c
13+
+++ b/wolfcrypt/src/random.c
14+
@@ -1719,15 +1719,21 @@ static int _InitRng(WC_RNG* rng, byte* nonce, word32 nonceSz,
15+
#else
16+
ret = wc_GenerateSeed(&rng->seed, seed, seedSz);
17+
#endif /* WC_RNG_SEED_CB */
18+
- if (ret == 0)
19+
- ret = wc_RNG_TestSeed(seed, seedSz);
20+
- else {
21+
+ if (ret != 0) {
22+
#if defined(DEBUG_WOLFSSL)
23+
- WOLFSSL_MSG_EX("wc_RNG_TestSeed failed... %d", ret);
24+
+ WOLFSSL_MSG_EX("Seed generation failed... %d", ret);
25+
#endif
26+
ret = DRBG_FAILURE;
27+
rng->status = DRBG_FAILED;
28+
}
29+
+ if (ret == 0)
30+
+ ret = wc_RNG_TestSeed(seed, seedSz);
31+
+
32+
+ #if defined(DEBUG_WOLFSSL)
33+
+ if (ret != 0) {
34+
+ WOLFSSL_MSG_EX("wc_RNG_TestSeed failed... %d", ret);
35+
+ }
36+
+ #endif
37+
38+
if (ret == DRBG_SUCCESS)
39+
ret = Hash_DRBG_Instantiate((DRBG_internal *)rng->drbg,
40+
--
41+
2.48.1
42+

0 commit comments

Comments
 (0)