Add more fixes for WebAssembly/WASI build
authorMarcin Kolny <marcin.kolny@gmail.com>
Fri, 7 Jul 2023 10:11:10 +0000 (11:11 +0100)
committerPauli <pauli@openssl.org>
Wed, 12 Jul 2023 00:50:09 +0000 (10:50 +1000)
* force use timegm - WASI does not have timezone tables
* use basic implementation for `OPENSSL_issetugid()` - WASI doesn't support forking processes

CLA: trivial

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21389)

crypto/asn1/a_time.c
crypto/uid.c

index dd3724fc836f1630f07b5e3e49733c659eb3737c..3bce55c01ad3f90c5773dba895e95818866a1c08 100644 (file)
@@ -595,7 +595,7 @@ int ASN1_TIME_compare(const ASN1_TIME *a, const ASN1_TIME *b)
 # define timezone _timezone
 #endif
 
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__wasi__)
 # define USE_TIMEGM
 #endif
 
index 698127779f54d93c5ccfb6d27cb3658d228b53fb..e26c27c6749b2e716c2750606df2a66adbb742fc 100644 (file)
@@ -10,7 +10,7 @@
 #include <openssl/crypto.h>
 #include <openssl/opensslconf.h>
 
-#if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_UEFI)
+#if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_UEFI) || defined(__wasi__)
 
 int OPENSSL_issetugid(void)
 {