From: Marcin Kolny Date: Sun, 2 Jul 2023 23:38:40 +0000 (+0100) Subject: Add limited support for WebAssembly WASI target X-Git-Tag: openssl-3.2.0-alpha1~504 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d88a0f5f3944535dd83d55bedc4d239544c5678d;p=thirdparty%2Fopenssl.git Add limited support for WebAssembly WASI target CLA: trivial Reviewed-by: Tim Hudson Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/21344) --- diff --git a/crypto/bio/bss_log.c b/crypto/bio/bss_log.c index f2c84606d2b..a90aebe0b48 100644 --- a/crypto/bio/bss_log.c +++ b/crypto/bio/bss_log.c @@ -24,6 +24,8 @@ #if defined(OPENSSL_SYS_WINCE) #elif defined(OPENSSL_SYS_WIN32) +#elif defined(__wasi__) +# define NO_SYSLOG #elif defined(OPENSSL_SYS_VMS) # include # include diff --git a/providers/implementations/rands/seeding/rand_unix.c b/providers/implementations/rands/seeding/rand_unix.c index 2aae396f239..a6d246ad235 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;