summaryrefslogtreecommitdiffstats
path: root/providers/implementations
diff options
context:
space:
mode:
authorMarcin Kolny <marcin.kolny@gmail.com>2023-07-03 00:38:40 +0100
committerPauli <pauli@openssl.org>2023-07-06 12:54:17 +1000
commitd88a0f5f3944535dd83d55bedc4d239544c5678d (patch)
tree2dc74550c8bd0a4f03ff898e39e723b95af57769 /providers/implementations
parent3e76b388521ccafddd8ba19d9ab62c8d25e83e0c (diff)
Add limited support for WebAssembly WASI target
CLA: trivial Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21344)
Diffstat (limited to 'providers/implementations')
-rw-r--r--providers/implementations/rands/seeding/rand_unix.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/providers/implementations/rands/seeding/rand_unix.c b/providers/implementations/rands/seeding/rand_unix.c
index 2aae396f23..a6d246ad23 100644
--- a/providers/implementations/rands/seeding/rand_unix.c
+++ b/providers/implementations/rands/seeding/rand_unix.c
@@ -395,6 +395,10 @@ static ssize_t syscall_random(void *buf, size_t buflen)
# elif (defined(__DragonFly__) && __DragonFly_version >= 500700) \
|| (defined(__NetBSD__) && __NetBSD_Version >= 1000000000)
return getrandom(buf, buflen, 0);
+# elif defined(__wasi__)
+ if (getentropy(buf, buflen) == 0)
+ return (ssize_t)buflen;
+ return -1;
# else
errno = ENOSYS;
return -1;