diff options
author | Marcin Kolny <marcin.kolny@gmail.com> | 2023-07-03 01:38:40 +0200 |
---|---|---|
committer | Pauli <pauli@openssl.org> | 2023-07-06 04:54:17 +0200 |
commit | d88a0f5f3944535dd83d55bedc4d239544c5678d (patch) | |
tree | 2dc74550c8bd0a4f03ff898e39e723b95af57769 /providers | |
parent | riscv: Clarify dual-licensing wording for GCM and AES (diff) | |
download | openssl-d88a0f5f3944535dd83d55bedc4d239544c5678d.tar.xz openssl-d88a0f5f3944535dd83d55bedc4d239544c5678d.zip |
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')
-rw-r--r-- | providers/implementations/rands/seeding/rand_unix.c | 4 |
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; |