File tree Expand file tree Collapse file tree 2 files changed +27
-1
lines changed
c-dependencies/js-compute-runtime Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -176,9 +176,10 @@ wasi_snapshot_preview1.reactor.wasm:
176
176
openssl : $(BUILD ) /openssl/token
177
177
178
178
# Extract and prepare the openssl build directory.
179
- $(BUILD ) /openssl-$(OPENSSL_VERSION ) /token : $(BUILD ) /openssl-$(OPENSSL_VERSION ) .tar.gz $(FSM_SRC ) /third_party/getuid.patch
179
+ $(BUILD ) /openssl-$(OPENSSL_VERSION ) /token : $(BUILD ) /openssl-$(OPENSSL_VERSION ) .tar.gz $(FSM_SRC ) /third_party/getuid.patch $( FSM_SRC ) /third_party/rand.patch
180
180
$Q tar -C $(BUILD ) -xf $<
181
181
$Q patch -d $(BUILD ) /openssl-$(OPENSSL_VERSION ) -p1 < $(FSM_SRC ) /third_party/getuid.patch
182
+ $Q patch -d $(BUILD ) /openssl-$(OPENSSL_VERSION ) -p1 < $(FSM_SRC ) /third_party/rand.patch
182
183
$Q touch $@
183
184
184
185
OPENSSL_OPTS := -static -no-sock -no-asm -no-ui-console -no-egd
Original file line number Diff line number Diff line change
1
+ diff --git openssl-3.0.7/crypto/rand/rand_lib.c openssl-3.0.7/crypto/rand/rand_lib.c
2
+ --- a/crypto/rand/rand_lib.c
3
+ +++ b/crypto/rand/rand_lib.c
4
+ @@ -320,6 +320,10 @@ const RAND_METHOD *RAND_get_rand_method(void)
5
+ int RAND_priv_bytes_ex(OSSL_LIB_CTX *ctx, unsigned char *buf, size_t num,
6
+ unsigned int strength)
7
+ {
8
+ + #ifdef __wasi__
9
+ + arc4random_buf(buf, num);
10
+ + return 1;
11
+ + #endif
12
+ EVP_RAND_CTX *rand;
13
+ #if !defined(OPENSSL_NO_DEPRECATED_3_0) && !defined(FIPS_MODULE)
14
+ const RAND_METHOD *meth = RAND_get_rand_method();
15
+ @@ -349,6 +353,10 @@ int RAND_priv_bytes(unsigned char *buf, int num)
16
+ int RAND_bytes_ex(OSSL_LIB_CTX *ctx, unsigned char *buf, size_t num,
17
+ unsigned int strength)
18
+ {
19
+ + #ifdef __wasi__
20
+ + arc4random_buf(buf, num);
21
+ + return 1;
22
+ + #endif
23
+ EVP_RAND_CTX *rand;
24
+ #if !defined(OPENSSL_NO_DEPRECATED_3_0) && !defined(FIPS_MODULE)
25
+ const RAND_METHOD *meth = RAND_get_rand_method();
You can’t perform that action at this time.
0 commit comments