Skip to content

Commit

Permalink
Add limited support for WebAssembly WASI target
Browse files Browse the repository at this point in the history
CLA: trivial

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from #21344)
  • Loading branch information
loganek authored and paulidale committed Jul 6, 2023
1 parent 3e76b38 commit d88a0f5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crypto/bio/bss_log.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 <opcdef.h>
# include <descrip.h>
Expand Down
4 changes: 4 additions & 0 deletions providers/implementations/rands/seeding/rand_unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d88a0f5

Please sign in to comment.