Gitweb links:

...log 
http://git.netsurf-browser.org/toolchains.git/shortlog/671590abe5fe58e1d9524fdf0ce85ae18d6e0f62
...commit 
http://git.netsurf-browser.org/toolchains.git/commit/671590abe5fe58e1d9524fdf0ce85ae18d6e0f62
...tree 
http://git.netsurf-browser.org/toolchains.git/tree/671590abe5fe58e1d9524fdf0ce85ae18d6e0f62

The branch, master has been updated
       via  671590abe5fe58e1d9524fdf0ce85ae18d6e0f62 (commit)
       via  cc59ad495fab2c0ce9c7bcbb7b16927bc6d5d1a3 (commit)
       via  7ff2458c536cad82bd0b589abbef1ec3770778ee (commit)
       via  c6bed28c3416c86995ec584f33f01d9e32008c5a (commit)
       via  7e5235f5a858116d1fcbbdbb78a5db401518bc91 (commit)
      from  668e343f49cfda6e4752d5b5ff1b2690da850d4c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commitdiff 
http://git.netsurf-browser.org/toolchains.git/commit/?id=671590abe5fe58e1d9524fdf0ce85ae18d6e0f62
commit 671590abe5fe58e1d9524fdf0ce85ae18d6e0f62
Author: John-Mark Bell <[email protected]>
Commit: John-Mark Bell <[email protected]>

    libcurl/ppc-amigaos: refresh patches

diff --git a/sdk/recipes/patches/libcurl/ppc-amigaos/lib.amigaos.c.p 
b/sdk/recipes/patches/libcurl/ppc-amigaos/lib.amigaos.c.p
index 5243fc5..1c3293b 100644
--- a/sdk/recipes/patches/libcurl/ppc-amigaos/lib.amigaos.c.p
+++ b/sdk/recipes/patches/libcurl/ppc-amigaos/lib.amigaos.c.p
@@ -1,20 +1,33 @@
---- lib/amigaos.c      2019-03-25 08:42:50.000000000 +0000
-+++ lib/amigaos.c      2019-03-30 12:49:06.680985341 +0000
-@@ -24,7 +24,7 @@
+--- lib/amigaos.c.orig 2017-10-10 15:19:45.611896396 +0100
++++ lib/amigaos.c      2017-10-17 15:42:25.304921197 +0100
+@@ -86,7 +86,9 @@
+       ULONG enabled = 0;
  
- #ifdef __AMIGA__
- #  include "amigaos.h"
--#  if defined(HAVE_PROTO_BSDSOCKET_H) && !defined(USE_AMISSL)
-+#  if 0
- #    include <amitcp/socketbasetags.h>
- #  endif
- #  ifdef __libnix__
-@@ -37,7 +37,7 @@
- #include "memdebug.h"
+       SocketBaseTags(SBTM_SETVAL(SBTC_CAN_SHARE_LIBRARY_BASES), TRUE,
++#ifdef SBTC_HAVE_GETHOSTADDR_R_API
+                      SBTM_GETREF(SBTC_HAVE_GETHOSTADDR_R_API), 
(ULONG)&enabled,
++#endif
+                      TAG_DONE);
  
- #ifdef __AMIGA__
--#if defined(HAVE_PROTO_BSDSOCKET_H) && !defined(USE_AMISSL)
-+#if 0
- struct Library *SocketBase = NULL;
- extern int errno, h_errno;
+       if(enabled) {
+@@ -132,20 +134,6 @@
+   struct SocketIFace *ISocket = __CurlISocket;
  
+   if(SocketFeatures & HAVE_BSDSOCKET_GETHOSTBYNAME_R) {
+-    LONG h_errnop = 0;
+-    struct hostent *buf;
+-
+-    buf = calloc(1, CURL_HOSTENT_SIZE);
+-    if(buf) {
+-      h = gethostbyname_r((STRPTR)hostname, buf,
+-                          (char *)buf + sizeof(struct hostent),
+-                          CURL_HOSTENT_SIZE - sizeof(struct hostent),
+-                          &h_errnop);
+-      if(h) {
+-        ai = Curl_he2ai(h, port);
+-      }
+-      free(buf);
+-    }
+   }
+   else {
+     #ifdef CURLRES_THREADED
diff --git a/sdk/recipes/patches/libcurl/ppc-amigaos/lib.amigaos.h.p 
b/sdk/recipes/patches/libcurl/ppc-amigaos/lib.amigaos.h.p
deleted file mode 100644
index 2f62a1c..0000000
--- a/sdk/recipes/patches/libcurl/ppc-amigaos/lib.amigaos.h.p
+++ /dev/null
@@ -1,11 +0,0 @@
---- lib/amigaos.h      2019-03-25 08:42:50.000000000 +0000
-+++ lib/amigaos.h      2019-03-30 12:49:50.744493740 +0000
-@@ -23,7 +23,7 @@
-  ***************************************************************************/
- #include "curl_setup.h"
- 
--#if defined(__AMIGA__) && defined(HAVE_BSDSOCKET_H) && !defined(USE_AMISSL)
-+#if 0
- 
- bool Curl_amiga_init();
- void Curl_amiga_cleanup();
diff --git a/sdk/recipes/patches/libcurl/ppc-amigaos/lib.curl_setup.h.p 
b/sdk/recipes/patches/libcurl/ppc-amigaos/lib.curl_setup.h.p
deleted file mode 100644
index 0e52d73..0000000
--- a/sdk/recipes/patches/libcurl/ppc-amigaos/lib.curl_setup.h.p
+++ /dev/null
@@ -1,12 +0,0 @@
---- lib/curl_setup.h   2019-03-30 13:44:08.576270700 +0000
-+++ lib/curl_setup.h   2019-03-30 13:44:33.011975643 +0000
-@@ -314,7 +314,8 @@
- #  include <exec/execbase.h>
- #  include <proto/exec.h>
- #  include <proto/dos.h>
--#  ifdef HAVE_PROTO_BSDSOCKET_H
-+#  define HAVE_SELECT 1
-+#  if 0
- #    include <proto/bsdsocket.h> /* ensure bsdsocket.library use */
- #    define select(a,b,c,d,e) WaitSelect(a,b,c,d,e,0)
- #  endif
diff --git a/sdk/recipes/patches/libcurl/ppc-amigaos/lib.hostip4.c.p 
b/sdk/recipes/patches/libcurl/ppc-amigaos/lib.hostip4.c.p
deleted file mode 100644
index 39952b8..0000000
--- a/sdk/recipes/patches/libcurl/ppc-amigaos/lib.hostip4.c.p
+++ /dev/null
@@ -1,60 +0,0 @@
---- lib/hostip4.c      2020-01-05 09:50:51.000000000 +0000
-+++ lib/hostip4.c      2020-05-07 16:02:59.313823259 +0100
-@@ -120,6 +120,10 @@ Curl_addrinfo *Curl_getaddrinfo(struct c
-  * implying that only threadsafe code and function calls may be used.
-  *
-  */
-+#ifdef __amigaos4__
-+#include <proto/exec.h>
-+#include <proto/bsdsocket.h>
-+#endif
- Curl_addrinfo *Curl_ipv4_resolve_r(const char *hostname,
-                                    int port)
- {
-@@ -130,6 +134,9 @@ Curl_addrinfo *Curl_ipv4_resolve_r(const
-   struct hostent *h = NULL;
-   struct in_addr in;
-   struct hostent *buf = NULL;
-+#ifdef __amigaos4__
-+  struct SocketIFace *ISocket = NULL;
-+#endif
- 
- #ifdef ENABLE_IPV6
-   {
-@@ -302,7 +309,20 @@ Curl_addrinfo *Curl_ipv4_resolve_r(const
-      * gethostbyname() is the preferred one.
-      */
-   else {
-+#ifdef __amigaos4__
-+    struct Library *SocketBase = IExec->OpenLibrary("bsdsocket.library", 4);
-+    if (SocketBase)
-+    {
-+       ISocket = (struct SocketIFace *)IExec->GetInterface(SocketBase, 
"main", 1, NULL);
-+    }
-+
-+    if (ISocket)
-+    {
-+       h = ISocket->gethostbyname((void*)hostname);
-+    }
-+#else  
-     h = gethostbyname((void *)hostname);
-+#endif
- #endif /* HAVE_GETADDRINFO_THREADSAFE || HAVE_GETHOSTBYNAME_R */
-   }
- 
-@@ -312,7 +332,14 @@ Curl_addrinfo *Curl_ipv4_resolve_r(const
-     if(buf) /* used a *_r() function */
-       free(buf);
-   }
--
-+#ifdef __amigaos4__
-+  if (ISocket)
-+  {
-+     struct Library *SocketBase = ISocket->Data.LibBase;
-+     IExec->DropInterface((struct Interface *)ISocket);
-+     IExec->CloseLibrary(SocketBase);
-+  }
-+#endif 
-   return ai;
- }
- #endif /* defined(CURLRES_IPV4) && !defined(CURLRES_ARES) */


commitdiff 
http://git.netsurf-browser.org/toolchains.git/commit/?id=cc59ad495fab2c0ce9c7bcbb7b16927bc6d5d1a3
commit cc59ad495fab2c0ce9c7bcbb7b16927bc6d5d1a3
Author: John-Mark Bell <[email protected]>
Commit: John-Mark Bell <[email protected]>

    c-ares/ppc-amigaos: no IPv6 support in stdlib

diff --git a/sdk/recipes/patches/libcares/ppc-amigaos/configure.p 
b/sdk/recipes/patches/libcares/ppc-amigaos/configure.p
deleted file mode 100644
index 254a483..0000000
--- a/sdk/recipes/patches/libcares/ppc-amigaos/configure.p
+++ /dev/null
@@ -1,11 +0,0 @@
---- configure.orig     2011-03-08 23:18:37.000000000 +0000
-+++ configure  2011-03-08 23:18:59.000000000 +0000
-@@ -18503,8 +18503,6 @@
-        stdbool.h \
-        time.h \
-        limits.h \
--       arpa/nameser.h \
--       arpa/nameser_compat.h \
-        arpa/inet.h
- do :
-   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
diff --git a/sdk/recipes/patches/libcares/ppc-amigaos/ipv6-support.p 
b/sdk/recipes/patches/libcares/ppc-amigaos/ipv6-support.p
new file mode 100644
index 0000000..c6be683
--- /dev/null
+++ b/sdk/recipes/patches/libcares/ppc-amigaos/ipv6-support.p
@@ -0,0 +1,66 @@
+--- src/lib/ares_ipv6.h.orig   2017-10-10 15:19:45.611896396 +0100
++++ src/lib/ares_ipv6.h        2017-10-17 15:42:25.304921197 +0100
+@@ -22,6 +22,7 @@
+ #endif
+ 
+ #ifndef HAVE_STRUCT_SOCKADDR_IN6
++#define s6_addr _S6_un._S6_u8
+ struct sockaddr_in6
+ {
+   unsigned short       sin6_family;
+--- src/lib/ares__sortaddrinfo.c.orig  2017-10-10 15:19:45.611896396 +0100
++++ src/lib/ares__sortaddrinfo.c       2017-10-17 15:42:25.304921197 +0100
+@@ -71,6 +71,39 @@
+ 
+ #define ARES_IN_LOOPBACK(a) ((((long int)(a)) & 0xff000000) == 0x7f000000)
+ 
++#ifndef IN6_IS_ADDR_LINKLOCAL
++#define IN6_IS_ADDR_LINKLOCAL(a) \
++      ((((__const uint32_t *) (a))[0] & htonl (0xffc00000))                 \
++       == htonl (0xfe800000))
++#endif
++#ifndef IN6_IS_ADDR_LOOPBACK
++#define IN6_IS_ADDR_LOOPBACK(a) \
++      (((__const uint32_t *) (a))[0] == 0                                   \
++       && ((__const uint32_t *) (a))[1] == 0                                \
++       && ((__const uint32_t *) (a))[2] == 0                                \
++       && ((__const uint32_t *) (a))[3] == htonl (1))
++#endif
++#ifndef IN6_IS_ADDR_MULTICAST
++#define IN6_IS_ADDR_MULTICAST(a) (((__const uint8_t *) (a))[0] == 0xff)
++#endif
++#ifndef IN6_IS_ADDR_SITELOCAL
++#define IN6_IS_ADDR_SITELOCAL(a) \
++      ((((__const uint32_t *) (a))[0] & htonl (0xffc00000))                 \
++       == htonl (0xfec00000))
++#endif
++#ifndef IN6_IS_ADDR_V4COMPAT
++#define IN6_IS_ADDR_V4COMPAT(a) \
++      ((((__const uint32_t *) (a))[0] == 0)                                 \
++       && (((__const uint32_t *) (a))[1] == 0)                              \
++       && (((__const uint32_t *) (a))[2] == 0)                              \
++       && (ntohl (((__const uint32_t *) (a))[3]) > 1))
++#endif
++#ifndef IN6_IS_ADDR_V4MAPPED
++#define IN6_IS_ADDR_V4MAPPED(a) \
++      ((((__const uint32_t *) (a))[0] == 0)                                 \
++       && (((__const uint32_t *) (a))[1] == 0)                              \
++       && (((__const uint32_t *) (a))[2] == htonl (0xffff)))
++#endif
+ /* RFC 4193. */
+ #define ARES_IN6_IS_ADDR_ULA(a) (((a)->s6_addr[0] & 0xfe) == 0xfc)
+ 
+@@ -253,8 +286,13 @@
+ /*
+  * Find number of matching initial bits between the two addresses a1 and a2.
+  */
++#ifndef HAVE_STRUCT_SOCKADDR_IN6
++static int common_prefix_len(const struct ares_in6_addr *a1,
++                             const struct ares_in6_addr *a2)
++#else
+ static int common_prefix_len(const struct in6_addr *a1,
+                              const struct in6_addr *a2)
++#endif
+ {
+   const char *p1 = (const char *)a1;
+   const char *p2 = (const char *)a2;


commitdiff 
http://git.netsurf-browser.org/toolchains.git/commit/?id=7ff2458c536cad82bd0b589abbef1ec3770778ee
commit 7ff2458c536cad82bd0b589abbef1ec3770778ee
Author: John-Mark Bell <[email protected]>
Commit: John-Mark Bell <[email protected]>

    OpenSSL/ppc-amigaos: rework entropy gathering for OpenSSL 3

diff --git a/sdk/recipes/files/openssl/ppc-amigaos/crypto/rand/rand_amiga.c 
b/sdk/recipes/files/openssl/ppc-amigaos/crypto/rand/rand_amiga.c
deleted file mode 100644
index cd3f236..0000000
--- a/sdk/recipes/files/openssl/ppc-amigaos/crypto/rand/rand_amiga.c
+++ /dev/null
@@ -1,182 +0,0 @@
-#include <openssl/rand.h>
-#include <openssl/sha.h>
-#include "rand_lcl.h"
-
-#if defined(OPENSSL_SYS_AMIGAOS3) || defined(OPENSSL_SYS_AMIGAOS4)
-#define __USE_INLINE__ 1
-
-#include <proto/exec.h>
-#include <proto/timer.h>
-#include <devices/timer.h>
-
-/* Maximum number of attempts to get a delay of 1 microsecond that is not 
equal to 0 */
-#define MAX_ATTEMPTS 1000
-
-#ifdef __amigaos4__
-
-#ifdef CreateMsgPort
-#undef CreateMsgPort
-#endif
-#define CreateMsgPort() AllocSysObject(ASOT_PORT,NULL)
-#ifdef DeleteMsgPort
-#undef DeleteMsgPort
-#endif
-#define DeleteMsgPort(msgPort) FreeSysObject(ASOT_PORT,msgPort)
-#ifdef CreateIORequest
-#undef CreateIORequest
-#endif
-#define CreateIORequest(ioReplyPort,size) 
AllocSysObjectTags(ASOT_IOREQUEST,ASOIOR_ReplyPort,ioReplyPort,ASOIOR_Size,size,TAG_DONE)
-#ifdef DeleteIORequest
-#undef DeleteIORequest
-#endif
-#define DeleteIORequest(ioReq) FreeSysObject(ASOT_IOREQUEST,ioReq)
-
-#else
-
-#define GetInterface(a, b, c, d) 1
-#define DropInterface(x)
-
-/* OS3 has a different but compatible TimeVal definition */
-struct TimeVal
-{
-    uint32 Seconds;
-    uint32 Microseconds;
-};
-
-#endif /* !__amigaos4__ */
-
-int RAND_poll(void)
-{
-       unsigned char temp_buffer[SHA_DIGEST_LENGTH], 
data_buffer[SHA_DIGEST_LENGTH];
-       struct MsgPort *port = NULL;
-       double entropy_added = 0;
-       struct TimeRequest *time_request = NULL;
-#ifdef __amigaos4__
-       struct IOStdReq *entropy_request = NULL;
-
-       if ((port = CreateMsgPort())
-           && (entropy_request = (struct IOStdReq *)CreateIORequest(port, 
sizeof(*entropy_request))))
-       {
-               if (OpenDevice(TIMERNAME, UNIT_ENTROPY, (struct IORequest 
*)entropy_request, 0) == 0)
-               {
-                       while(entropy_added < ENTROPY_NEEDED)
-                       {
-                               entropy_request->io_Command = TR_READENTROPY;
-                               entropy_request->io_Data = &temp_buffer[0];
-                               entropy_request->io_Length = 
sizeof(temp_buffer);
-
-                               if (DoIO((struct IORequest *)entropy_request) 
== 0)
-                               {
-                                       SHA1(&temp_buffer[0], 
sizeof(temp_buffer), &data_buffer[0]);
-                                       RAND_add(&data_buffer[0], 
sizeof(data_buffer), sizeof(data_buffer));
-                                       entropy_added += sizeof(data_buffer);
-                               }
-                               else
-                                       break;
-                       }
-
-                       CloseDevice((struct IORequest *)entropy_request);
-               }
-       }
-
-       DeleteIORequest((struct IORequest *)entropy_request);
-#endif /* __amigaos4__ */
-
-       /* The following block will be used on "classic" machines. It does not 
generate
-        * a high degree of randomness, but it does the job since RAND_poll is
-        * called only once by OpenSSL to generate a 32 byte seed.
-        */
-       if (entropy_added < ENTROPY_NEEDED
-           && (port || (port = CreateMsgPort()))
-           && (time_request = (struct TimeRequest *)CreateIORequest(port, 
sizeof(*time_request))))
-       {
-               if (OpenDevice(TIMERNAME, UNIT_VBLANK, (struct IORequest 
*)time_request, 0) == 0)
-               {
-                       #if defined(__amigaos4__)
-                       struct TimerIFace *ITimer = NULL;
-                       #endif
-                       struct Device *TimerBase;
-
-                       if ((TimerBase = time_request->Request.io_Device)
-                       #if defined(__amigaos4__)
-                           && (ITimer = (struct TimerIFace 
*)GetInterface((struct Library *)TimerBase, "main", 1, NULL))
-                       #endif
-                       )
-                       {
-                               struct EClockVal curr_eclock;
-                               ULONG prev_ev_lo = 0;
-                               struct TimeVal tv;
-                               int i, attempt;
-                               BOOL aborted;
-
-                               ReadEClock(&curr_eclock);
-                               aborted = FALSE;
-
-                               while(!aborted && entropy_added < 
ENTROPY_NEEDED)
-                               {
-                                       for(i = 0;
-                                           !aborted && i < 
(int)sizeof(temp_buffer) - (int)sizeof(ULONG);
-                                           i++)
-                                       {
-                                               attempt = 0;
-
-                                               /* Ask for a one microsecond 
delay and measure the time
-                                                * the delay actually took.
-                                                */
-                                               do
-                                               {
-                                                       
time_request->Request.io_Command = TR_ADDREQUEST;
-                                                       
time_request->Time.Seconds = 0;
-                                                       
time_request->Time.Microseconds = 1;
-
-                                                       if (DoIO((struct 
IORequest *)time_request) == 0)
-                                                       {
-                                                               prev_ev_lo = 
curr_eclock.ev_lo;
-                                                               
ReadEClock(&curr_eclock);
-
-                                                               attempt++;
-                                                       }
-                                                       else
-                                                               aborted = TRUE;
-                                               } while(!aborted && prev_ev_lo 
== 0 && attempt < MAX_ATTEMPTS);
-
-                                               if (attempt >= MAX_ATTEMPTS)
-                                                       aborted = TRUE;
-
-                                               /* Since we are going for 
randomness, ev_hi is irrelevant */
-                                               temp_buffer[i] = (unsigned 
char)(curr_eclock.ev_lo - prev_ev_lo);
-                                       }
-
-                                       GetSysTime(&tv);
-
-                                       if (sizeof(temp_buffer) > sizeof(ULONG))
-                                               *(ULONG 
*)&temp_buffer[sizeof(temp_buffer) - sizeof(ULONG)]
-                                                   = tv.Microseconds;
-
-                                       /* Shuffle the bits around and specify 
that about
-                                        * one fourth of it adds to the entropy.
-                                        */
-                                       if (!aborted)
-                                       {
-                                               SHA1(&temp_buffer[0], 
sizeof(temp_buffer), &data_buffer[0]);
-                                               RAND_add(&data_buffer[0], 
sizeof(data_buffer), (double)sizeof(data_buffer) / 4);
-                                               entropy_added += 
sizeof(data_buffer) / 4;
-                                       }
-                               }
-                       }
-
-                       #if defined(__amigaos4__)
-                       DropInterface((struct Interface *)ITimer);
-                       #endif
-                       CloseDevice((struct IORequest *)time_request);
-               }
-       }
-
-       DeleteIORequest((struct IORequest *)time_request);
-
-       DeleteMsgPort(port);
-
-       return(entropy_added >= ENTROPY_NEEDED);
-}
-
-#endif /* OPENSSL_SYS_AMIGA */
diff --git 
a/sdk/recipes/files/openssl/ppc-amigaos/providers/implementations/rands/seeding/rand_amiga.c
 
b/sdk/recipes/files/openssl/ppc-amigaos/providers/implementations/rands/seeding/rand_amiga.c
new file mode 100644
index 0000000..ed315ed
--- /dev/null
+++ 
b/sdk/recipes/files/openssl/ppc-amigaos/providers/implementations/rands/seeding/rand_amiga.c
@@ -0,0 +1,275 @@
+#include "internal/cryptlib.h"
+#include <openssl/rand.h>
+#include <openssl/sha.h>
+#include "crypto/rand_pool.h"
+#include "crypto/rand.h"
+#include "prov/seeding.h"
+
+#if defined(OPENSSL_SYS_AMIGAOS3) || defined(OPENSSL_SYS_AMIGAOS4)
+
+# ifndef OPENSSL_RAND_SEED_OS
+#  error "Unsupported seeding method configured; must be os"
+# endif
+
+#define __USE_INLINE__ 1
+
+#include <sys/types.h>
+#include <time.h>
+#include <unistd.h>
+
+#include <proto/exec.h>
+#include <proto/timer.h>
+#include <devices/timer.h>
+
+/* Maximum number of attempts to get a delay of 1 microsecond that is not 
equal to 0 */
+#define MAX_ATTEMPTS 1000
+
+#ifdef __amigaos4__
+
+#ifdef CreateMsgPort
+#undef CreateMsgPort
+#endif
+#define CreateMsgPort() AllocSysObject(ASOT_PORT,NULL)
+#ifdef DeleteMsgPort
+#undef DeleteMsgPort
+#endif
+#define DeleteMsgPort(msgPort) FreeSysObject(ASOT_PORT,msgPort)
+#ifdef CreateIORequest
+#undef CreateIORequest
+#endif
+#define CreateIORequest(ioReplyPort,size) 
AllocSysObjectTags(ASOT_IOREQUEST,ASOIOR_ReplyPort,ioReplyPort,ASOIOR_Size,size,TAG_DONE)
+#ifdef DeleteIORequest
+#undef DeleteIORequest
+#endif
+#define DeleteIORequest(ioReq) FreeSysObject(ASOT_IOREQUEST,ioReq)
+
+#else
+
+#define GetInterface(a, b, c, d) 1
+#define DropInterface(x)
+
+/* OS3 has a different but compatible TimeVal definition */
+struct TimeVal
+{
+    uint32 Seconds;
+    uint32 Microseconds;
+};
+
+#endif /* !__amigaos4__ */
+
+size_t ossl_pool_acquire_entropy(RAND_POOL *pool)
+{
+    unsigned char temp_buffer[SHA_DIGEST_LENGTH], 
data_buffer[SHA_DIGEST_LENGTH];
+    struct MsgPort *port = NULL;
+    size_t bytes_needed;
+    size_t entropy_available = 0;
+    struct TimeRequest *time_request = NULL;
+#ifdef __amigaos4__
+    struct IOStdReq *entropy_request = NULL;
+
+    bytes_needed = ossl_rand_pool_bytes_needed(pool, 1);
+
+    if ((port = CreateMsgPort())
+        && (entropy_request = (struct IOStdReq *)CreateIORequest(port, 
sizeof(*entropy_request))))
+    {
+        if (OpenDevice(TIMERNAME, UNIT_ENTROPY, (struct IORequest 
*)entropy_request, 0) == 0)
+        {
+            while(bytes_needed > 0)
+            {
+                entropy_request->io_Command = TR_READENTROPY;
+                entropy_request->io_Data = &temp_buffer[0];
+                entropy_request->io_Length = sizeof(temp_buffer);
+
+                if (DoIO((struct IORequest *)entropy_request) == 0)
+                {
+                    unsigned char *buffer;
+                    size_t bytes = (bytes_needed < sizeof(data_buffer) ? 
bytes_needed : sizeof(data_buffer));
+
+                    buffer = ossl_rand_pool_add_begin(pool, bytes_needed);
+                    SHA1(&temp_buffer[0], sizeof(temp_buffer), 
&data_buffer[0]);
+                    memcpy(buffer, data_buffer, bytes);
+                    ossl_rand_pool_add_end(pool, bytes, 8 * bytes);
+                    bytes_needed -= bytes;
+                }
+                else
+                    break;
+            }
+
+            CloseDevice((struct IORequest *)entropy_request);
+        }
+    }
+
+    DeleteIORequest((struct IORequest *)entropy_request);
+
+    entropy_available = ossl_rand_pool_entropy_available(pool);
+    if (entropy_available > 0)
+        return entropy_available;
+#endif /* __amigaos4__ */
+
+    /* The following block will be used on "classic" machines. It does not 
generate
+     * a high degree of randomness, but it does the job since RAND_poll is
+     * called only once by OpenSSL to generate a 32 byte seed.
+     */
+
+    bytes_needed = ossl_rand_pool_bytes_needed(pool, 1);
+
+    if (bytes_needed > 0
+        && (port || (port = CreateMsgPort()))
+        && (time_request = (struct TimeRequest *)CreateIORequest(port, 
sizeof(*time_request))))
+    {
+        if (OpenDevice(TIMERNAME, UNIT_VBLANK, (struct IORequest 
*)time_request, 0) == 0)
+        {
+            #if defined(__amigaos4__)
+            struct TimerIFace *ITimer = NULL;
+            #endif
+            struct Device *TimerBase;
+
+            if ((TimerBase = time_request->Request.io_Device)
+            #if defined(__amigaos4__)
+                && (ITimer = (struct TimerIFace *)GetInterface((struct Library 
*)TimerBase, "main", 1, NULL))
+            #endif
+            )
+            {
+                struct EClockVal curr_eclock;
+                ULONG prev_ev_lo = 0;
+                struct TimeVal tv;
+                int i, attempt;
+                BOOL aborted;
+
+                ReadEClock(&curr_eclock);
+                aborted = FALSE;
+
+                while(!aborted && bytes_needed > 0)
+                {
+                    for(i = 0;
+                        !aborted && i < (int)sizeof(temp_buffer) - 
(int)sizeof(ULONG);
+                        i++)
+                    {
+                        attempt = 0;
+
+                        /* Ask for a one microsecond delay and measure the time
+                         * the delay actually took.
+                         */
+                        do
+                        {
+                            time_request->Request.io_Command = TR_ADDREQUEST;
+                            time_request->Time.Seconds = 0;
+                            time_request->Time.Microseconds = 1;
+
+                            if (DoIO((struct IORequest *)time_request) == 0)
+                            {
+                                prev_ev_lo = curr_eclock.ev_lo;
+                                ReadEClock(&curr_eclock);
+
+                                attempt++;
+                            }
+                            else
+                                aborted = TRUE;
+                        } while(!aborted && prev_ev_lo == 0 && attempt < 
MAX_ATTEMPTS);
+
+                        if (attempt >= MAX_ATTEMPTS)
+                            aborted = TRUE;
+
+                        /* Since we are going for randomness, ev_hi is 
irrelevant */
+                        temp_buffer[i] = (unsigned char)(curr_eclock.ev_lo - 
prev_ev_lo);
+                    }
+
+                    GetSysTime(&tv);
+
+                    if (sizeof(temp_buffer) > sizeof(ULONG))
+                        *(ULONG *)&temp_buffer[sizeof(temp_buffer) - 
sizeof(ULONG)]
+                            = tv.Microseconds;
+
+                    /* Shuffle the bits around and specify that about
+                     * one fourth of it adds to the entropy.
+                     */
+                    if (!aborted)
+                    {
+                        unsigned char *buffer;
+                        size_t bytes = (bytes_needed < sizeof(data_buffer) ? 
bytes_needed : sizeof(data_buffer));
+
+                        SHA1(&temp_buffer[0], sizeof(temp_buffer), 
&data_buffer[0]);
+
+                        ossl_rand_pool_add_end(pool, bytes, 
(sizeof(data_buffer) / 4) * 8);
+                        bytes_needed -= bytes;
+                    }
+                }
+            }
+
+            #if defined(__amigaos4__)
+            DropInterface((struct Interface *)ITimer);
+            #endif
+            CloseDevice((struct IORequest *)time_request);
+        }
+    }
+
+    DeleteIORequest((struct IORequest *)time_request);
+
+    DeleteMsgPort(port);
+
+    return ossl_rand_pool_entropy_available(pool);
+}
+
+int ossl_pool_add_nonce_data(RAND_POOL *pool)
+{
+    struct {
+        pid_t pid;
+        CRYPTO_THREAD_ID tid;
+        uint64_t time;
+    } data;
+
+    /* Erase the entire structure including any padding */
+    memset(&data, 0, sizeof(data));
+
+    /*
+     * Add process id, thread id, and a high resolution timestamp to
+     * ensure that the nonce is unique with high probability for
+     * different process instances.
+     */
+    data.pid = getpid();
+    data.tid = CRYPTO_THREAD_get_current_id();
+    /*XXX: can this be improved? */
+    data.time = time(NULL);
+
+    return ossl_rand_pool_add(pool, (unsigned char *)&data, sizeof(data), 0);
+}
+
+int ossl_rand_pool_add_additional_data(RAND_POOL *pool)
+{
+    struct {
+        int fork_id;
+        CRYPTO_THREAD_ID tid;
+        uint64_t time;
+    } data;
+
+    /* Erase the entire structure including any padding */
+    memset(&data, 0, sizeof(data));
+
+    /*
+     * Add some noise from the thread id and a high resolution timer.
+     * The fork_id adds some extra fork-safety.
+     * The thread id adds a little randomness if the drbg is accessed
+     * concurrently (which is the case for the <master> drbg).
+     */
+    data.fork_id = openssl_get_fork_id();
+    data.tid = CRYPTO_THREAD_get_current_id();
+    /*XXX: can this be improved? */
+    data.time = (uint64_t) time(NULL);
+
+    return ossl_rand_pool_add(pool, (unsigned char *)&data, sizeof(data), 0);
+}
+
+int ossl_rand_pool_init(void)
+{
+    return 1;
+}
+
+void ossl_rand_pool_cleanup(void)
+{
+}
+
+void ossl_rand_pool_keep_random_devices_open(int keep)
+{
+}
+
+#endif /* OPENSSL_SYS_AMIGA */
diff --git a/sdk/recipes/patches/openssl/ppc-amigaos/crypto.rand.build.info.p 
b/sdk/recipes/patches/openssl/ppc-amigaos/crypto.rand.build.info.p
deleted file mode 100644
index 58b672f..0000000
--- a/sdk/recipes/patches/openssl/ppc-amigaos/crypto.rand.build.info.p
+++ /dev/null
@@ -1,9 +0,0 @@
---- crypto/rand/build.info.orig        2017-11-22 11:36:06.585363219 +0000
-+++ crypto/rand/build.info     2017-11-22 11:36:39.267232034 +0000
-@@ -1,4 +1,4 @@
- LIBS=../../libcrypto
- SOURCE[../../libcrypto]=\
--        md_rand.c randfile.c rand_lib.c rand_err.c rand_egd.c \
--        rand_win.c rand_unix.c rand_vms.c
-+        md_rand.c randfile.c rand_lib.c rand_err.c rand_amiga.c \
-+        rand_egd.c rand_win.c rand_unix.c rand_vms.c
diff --git 
a/sdk/recipes/patches/openssl/ppc-amigaos/providers.implementations.rands.seeding.build.info.p
 
b/sdk/recipes/patches/openssl/ppc-amigaos/providers.implementations.rands.seeding.build.info.p
new file mode 100644
index 0000000..c887eff
--- /dev/null
+++ 
b/sdk/recipes/patches/openssl/ppc-amigaos/providers.implementations.rands.seeding.build.info.p
@@ -0,0 +1,12 @@
+--- providers/implementations/rands/seeding/build.info.orig    2017-11-21 
22:49:00.185608040 +0000
++++ providers/implementations/rands/seeding/build.info 2017-11-21 
22:49:21.488219518 +0000
+@@ -5,6 +5,9 @@
+ IF[{- $config{target} =~ /vms/i -}]
+   $COMMON=$COMMON rand_vms.c
+ ENDIF
++IF[{- $config{target} =~ /amiga/i -}]
++  $COMMON=$COMMON rand_amiga.c
++ENDIF
+
+ SOURCE[../../../libdefault.a]=$COMMON
+ 


commitdiff 
http://git.netsurf-browser.org/toolchains.git/commit/?id=c6bed28c3416c86995ec584f33f01d9e32008c5a
commit c6bed28c3416c86995ec584f33f01d9e32008c5a
Author: John-Mark Bell <[email protected]>
Commit: John-Mark Bell <[email protected]>

    OpenSSL/ppc-amigaos: avoid broken stdatomic.h
    
    For whatever reason, when the toolchain is built against newlib,
    GCC does not provide stdint.h, and thus does not pre-define the
    likes of __INT_LEAST8_TYPE__ or __UINTPTR_TYPE__. Thus, including
    stdatomic.h (which expects these to be defined) fails hard.
    
    Drop this if ever the toolchain is fixed.

diff --git a/sdk/recipes/patches/openssl/ppc-amigaos/atomics-are-broken.p 
b/sdk/recipes/patches/openssl/ppc-amigaos/atomics-are-broken.p
new file mode 100644
index 0000000..a08fec5
--- /dev/null
+++ b/sdk/recipes/patches/openssl/ppc-amigaos/atomics-are-broken.p
@@ -0,0 +1,22 @@
+--- include/internal/tsan_assist.h.orig        2017-11-21 22:49:00.185608040 
+0000
++++ include/internal/tsan_assist.h     2017-11-21 22:49:21.488219518 +0000
+@@ -48,7 +48,7 @@
+  */
+ 
+ #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L \
+-    && !defined(__STDC_NO_ATOMICS__)
++    && !defined(__STDC_NO_ATOMICS__) && !defined(__AMIGA__)
+ # include <stdatomic.h>
+ 
+ # if defined(ATOMIC_POINTER_LOCK_FREE) \
+--- include/internal/refcount.h.orig   2017-11-21 22:49:00.185608040 +0000
++++ include/internal/refcount.h        2017-11-21 22:49:21.488219518 +0000
+@@ -15,7 +15,7 @@
+ 
+ # ifndef OPENSSL_DEV_NO_ATOMICS
+ #  if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L \
+-      && !defined(__STDC_NO_ATOMICS__)
++      && !defined(__STDC_NO_ATOMICS__) && !defined(__AMIGA__)
+ #   include <stdatomic.h>
+ #   define HAVE_C11_ATOMICS
+ #  endif


commitdiff 
http://git.netsurf-browser.org/toolchains.git/commit/?id=7e5235f5a858116d1fcbbdbb78a5db401518bc91
commit 7e5235f5a858116d1fcbbdbb78a5db401518bc91
Author: John-Mark Bell <[email protected]>
Commit: John-Mark Bell <[email protected]>

    OpenSSL/ppc-amigaos: refresh patches

diff --git a/sdk/recipes/patches/openssl/apps.speed.c.p 
b/sdk/recipes/patches/openssl/apps.speed.c.p
index 1ccac30..132d473 100644
--- a/sdk/recipes/patches/openssl/apps.speed.c.p
+++ b/sdk/recipes/patches/openssl/apps.speed.c.p
@@ -1,5 +1,5 @@
---- apps/speed.c.orig  2017-11-22 08:07:53.851790744 +0000
-+++ apps/speed.c       2017-11-22 08:15:49.608768064 +0000
+--- apps/speed.c.orig  2017-11-21 22:49:00.185608040 +0000
++++ apps/speed.c       2017-11-21 22:49:21.488219518 +0000
 @@ -62,6 +62,12 @@
  #include "./testdsa.h"
  #include <openssl/modes.h>
@@ -13,14 +13,22 @@
  #ifndef HAVE_FORK
  # if defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_WINDOWS) || 
defined(OPENSSL_SYS_VXWORKS)
  #  define HAVE_FORK 0
-@@ -134,8 +240,10 @@
- static double Time_F(int s)
- {
-     double ret = app_tminterval(s, usertime);
-+    #ifdef SIGALRM
-     if (s == STOP)
-         alarm(0);
-+    #endif
+@@ -186,6 +192,18 @@
+ 
      return ret;
  }
- 
++#elif defined(OPENSSL_SYS_AMIGAOS3) || defined(OPENSSL_SYS_AMIGAOS4)
++static void alarm_aos(unsigned int secs)
++{
++    (void) secs;
++}
++#define alarm alarm_aos
++
++static double Time_F(int s)
++{
++    double ret = app_tminterval(s, usertime);
++    return ret;
++}
+ #else
+ # error "SIGALRM not defined and the platform is not Windows"
+ #endif
diff --git a/sdk/recipes/patches/openssl/aps.opt.c.p 
b/sdk/recipes/patches/openssl/aps.opt.c.p
deleted file mode 100644
index 2ba3fba..0000000
--- a/sdk/recipes/patches/openssl/aps.opt.c.p
+++ /dev/null
@@ -1,14 +0,0 @@
---- apps/lib/opt.c.orig        2017-11-22 08:42:07.605882648 +0000
-+++ apps/lib/opt.c     2017-11-22 08:48:31.712843519 +0000
-@@ -564,6 +564,11 @@
-     defined(INTMAX_MAX) && defined(UINTMAX_MAX) && \
-     !defined(OPENSSL_NO_INTTYPES_H)
- 
-+#if defined(OPENSSL_SYS_AMIGAOS3) || defined(OPENSSL_SYS_AMIGAOS4)
-+# define strtoimax strtol
-+# define strtoumax strtoul
-+#endif
-+
- /* Parse an intmax_t, put it into *result; return 0 on failure, else 1. */
- int opt_intmax(const char *value, ossl_intmax_t *result)
- {
diff --git a/sdk/recipes/patches/openssl/newlib-no-strtoiumax.p 
b/sdk/recipes/patches/openssl/newlib-no-strtoiumax.p
new file mode 100644
index 0000000..27f6a9d
--- /dev/null
+++ b/sdk/recipes/patches/openssl/newlib-no-strtoiumax.p
@@ -0,0 +1,22 @@
+--- apps/lib/opt.c.orig        2017-10-10 15:19:45.611896396 +0100
++++ apps/lib/opt.c     2017-10-17 15:42:25.304921197 +0100
+@@ -562,7 +562,7 @@
+ 
+ #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L && \
+     defined(INTMAX_MAX) && defined(UINTMAX_MAX) && \
+-    !defined(OPENSSL_NO_INTTYPES_H)
++    !defined(OPENSSL_NO_INTTYPES_H) && !defined(OPENSSL_SYS_AMIGAOS3) && 
!defined(OPENSSL_SYS_AMIGAOS4)
+ 
+ /* Parse an intmax_t, put it into *result; return 0 on failure, else 1. */
+ int opt_intmax(const char *value, ossl_intmax_t *result)
+--- test/params_conversion_test.c.orig 2017-10-10 15:19:45.611896396 +0100
++++ test/params_conversion_test.c      2017-10-17 15:42:25.304921197 +0100
+@@ -15,7 +15,7 @@
+ /* On machines that dont support <inttypes.h> just disable the tests */
+ #if !defined(OPENSSL_NO_INTTYPES_H)
+ 
+-# ifdef OPENSSL_SYS_VMS
++# if defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_AMIGAOS3) || 
defined(OPENSSL_SYS_AMIGAOS4)
+ #  define strtoumax strtoull
+ #  define strtoimax strtoll
+ # endif
diff --git 
a/sdk/recipes/patches/openssl/ppc-amigaos/apps.include.http_server.h.p 
b/sdk/recipes/patches/openssl/ppc-amigaos/apps.include.http_server.h.p
new file mode 100644
index 0000000..8d9684e
--- /dev/null
+++ b/sdk/recipes/patches/openssl/ppc-amigaos/apps.include.http_server.h.p
@@ -0,0 +1,11 @@
+--- apps/include/http_server.h.orig    2017-11-21 22:49:00.185608040 +0000
++++ apps/include/http_server.h 2017-11-21 22:49:21.488219518 +0000
+@@ -27,7 +27,7 @@
+ # endif
+ 
+ # if !defined(NO_FORK) && !defined(OPENSSL_NO_SOCK) \
+-    && !defined(OPENSSL_NO_POSIX_IO)
++    && !defined(OPENSSL_NO_POSIX_IO) && !defined(NO_SYSLOG)
+ #  define HTTP_DAEMON
+ #  include <sys/types.h>
+ #  include <sys/wait.h>
diff --git a/sdk/recipes/patches/openssl/ppc-amigaos/crypto.bio_b_addr.c.p 
b/sdk/recipes/patches/openssl/ppc-amigaos/crypto.bio_b_addr.c.p
index dd10e8c..ac14e86 100644
--- a/sdk/recipes/patches/openssl/ppc-amigaos/crypto.bio_b_addr.c.p
+++ b/sdk/recipes/patches/openssl/ppc-amigaos/crypto.bio_b_addr.c.p
@@ -1,6 +1,6 @@
---- crypto/bio/b_addr.c.orig   2017-11-21 22:49:00.185608040 +0000
-+++ crypto/bio/b_addr.c        2017-11-21 22:49:21.488219518 +0000
-@@ -854,7 +854,7 @@
+--- crypto/bio/bio_addr.c.orig 2017-11-21 22:49:00.185608040 +0000
++++ crypto/bio/bio_addr.c      2017-11-21 22:49:21.488219518 +0000
+@@ -910,7 +910,7 @@
                  addrlistp++)
                  ;
  
diff --git a/sdk/recipes/patches/openssl/ppc-amigaos/crypto.ppccap.c.p 
b/sdk/recipes/patches/openssl/ppc-amigaos/crypto.ppccap.c.p
index 56949ca..46d6213 100644
--- a/sdk/recipes/patches/openssl/ppc-amigaos/crypto.ppccap.c.p
+++ b/sdk/recipes/patches/openssl/ppc-amigaos/crypto.ppccap.c.p
@@ -1,15 +1,15 @@
 --- crypto/ppccap.c.orig       2017-11-22 13:14:44.655536374 +0000
 +++ crypto/ppccap.c    2017-11-22 13:16:03.666387174 +0000
-@@ -135,6 +135,8 @@
- }
- #endif
+@@ -34,6 +34,8 @@
+ 
+ static sigset_t all_masked;
  
 +#ifndef OPENSSL_SYS_AMIGAOS4
 +
  static sigjmp_buf ill_jmp;
  static void ill_handler(int sig)
  {
-@@ -341,3 +343,24 @@
+@@ -309,3 +311,29 @@
      sigaction(SIGILL, &ill_oact, NULL);
      sigprocmask(SIG_SETMASK, &oset, NULL);
  }
@@ -33,4 +33,9 @@
 +        OPENSSL_ppccap_P |= PPC_ALTIVEC;
 +    }
 +}
++
++uint32_t OPENSSL_rdtsc(void)
++{
++    return 0;
++}
 +#endif
diff --git a/sdk/recipes/patches/openssl/ppc-amigaos/include.openssl.e_os2.h.p 
b/sdk/recipes/patches/openssl/ppc-amigaos/include.openssl.e_os2.h.p
deleted file mode 100644
index 6ea1ec8..0000000
--- a/sdk/recipes/patches/openssl/ppc-amigaos/include.openssl.e_os2.h.p
+++ /dev/null
@@ -1,11 +0,0 @@
---- include/openssl/e_os2.h.orig       2017-11-21 23:09:39.684814614 +0000
-+++ include/openssl/e_os2.h    2017-11-21 23:10:32.501369938 +0000
-@@ -223,6 +223,8 @@
- #   define OSSL_SSIZE_MAX SSIZE_MAX
- #  elif defined(_POSIX_SSIZE_MAX)
- #   define OSSL_SSIZE_MAX _POSIX_SSIZE_MAX
-+#  else
-+#   define OSSL_SSIZE_MAX INT_MAX
- #  endif
- # endif
- 
diff --git a/sdk/recipes/patches/openssl/ppc-amigaos/test.rsa_complex.c.p 
b/sdk/recipes/patches/openssl/ppc-amigaos/test.rsa_complex.c.p
index a5fa68a..969062b 100644
--- a/sdk/recipes/patches/openssl/ppc-amigaos/test.rsa_complex.c.p
+++ b/sdk/recipes/patches/openssl/ppc-amigaos/test.rsa_complex.c.p
@@ -1,14 +1,14 @@
 --- test/rsa_complex.c.orig    2019-02-14 10:16:06.665734720 +0000
 +++ test/rsa_complex.c 2019-02-14 10:16:18.581682332 +0000
-@@ -12,11 +12,6 @@
-  * The former defines "I" as a macro and earlier versions of the latter use
-  * for function arguments.
+@@ -16,11 +16,6 @@
   */
--#if defined(__STDC_VERSION__)
--# if __STDC_VERSION__ >= 199901L
--#  include <complex.h>
+ 
+ #if !defined(__DJGPP__)
+-# if defined(__STDC_VERSION__)
+-#  if __STDC_VERSION__ >= 199901L
+-#   include <complex.h>
+-#  endif
 -# endif
--#endif
- #include <openssl/rsa.h>
+ # include <openssl/rsa.h>
+ #endif
  #include <stdlib.h>
- 
diff --git a/sdk/recipes/patches/openssl/test.drbgtest.c.p 
b/sdk/recipes/patches/openssl/test.drbgtest.c.p
new file mode 100644
index 0000000..ecf3e81
--- /dev/null
+++ b/sdk/recipes/patches/openssl/test.drbgtest.c.p
@@ -0,0 +1,20 @@
+--- test/drbgtest.c.orig       2017-10-10 15:19:45.611896396 +0100
++++ test/drbgtest.c    2017-10-17 15:42:25.304921197 +0100
+@@ -277,7 +277,7 @@
+ }
+ 
+ 
+-#if defined(OPENSSL_SYS_UNIX) && !defined(OPENSSL_RAND_SEED_EGD)
++#if defined(OPENSSL_SYS_UNIX) && !defined(OPENSSL_RAND_SEED_EGD) && 
!defined(OPENSSL_SYS_AMIGAOS3) && !defined(OPENSSL_SYS_AMIGAOS4)
+ /* number of children to fork */
+ #define DRBG_FORK_COUNT 9
+ /* two results per child, two for the parent */
+@@ -895,7 +895,7 @@
+ int setup_tests(void)
+ {
+     ADD_TEST(test_rand_reseed);
+-#if defined(OPENSSL_SYS_UNIX) && !defined(OPENSSL_RAND_SEED_EGD)
++#if defined(OPENSSL_SYS_UNIX) && !defined(OPENSSL_RAND_SEED_EGD) && 
!defined(OPENSSL_SYS_AMIGAOS3) && !defined(OPENSSL_SYS_AMIGAOS4)
+     ADD_ALL_TESTS(test_rand_fork_safety, RANDOM_SIZE);
+ #endif
+     ADD_TEST(test_rand_prediction_resistance);


-----------------------------------------------------------------------

Summary of changes:
 .../openssl/ppc-amigaos/crypto/rand/rand_amiga.c   |  182 -------------
 .../implementations/rands/seeding/rand_amiga.c     |  275 ++++++++++++++++++++
 .../patches/libcares/ppc-amigaos/configure.p       |   11 -
 .../patches/libcares/ppc-amigaos/ipv6-support.p    |   66 +++++
 .../patches/libcurl/ppc-amigaos/lib.amigaos.c.p    |   47 ++--
 .../patches/libcurl/ppc-amigaos/lib.amigaos.h.p    |   11 -
 .../patches/libcurl/ppc-amigaos/lib.curl_setup.h.p |   12 -
 .../patches/libcurl/ppc-amigaos/lib.hostip4.c.p    |   60 -----
 sdk/recipes/patches/openssl/apps.speed.c.p         |   30 ++-
 sdk/recipes/patches/openssl/aps.opt.c.p            |   14 -
 sdk/recipes/patches/openssl/newlib-no-strtoiumax.p |   22 ++
 .../ppc-amigaos/apps.include.http_server.h.p       |   11 +
 .../openssl/ppc-amigaos/atomics-are-broken.p       |   22 ++
 .../openssl/ppc-amigaos/crypto.bio_b_addr.c.p      |    6 +-
 .../patches/openssl/ppc-amigaos/crypto.ppccap.c.p  |   13 +-
 .../openssl/ppc-amigaos/crypto.rand.build.info.p   |    9 -
 .../openssl/ppc-amigaos/include.openssl.e_os2.h.p  |   11 -
 ...ders.implementations.rands.seeding.build.info.p |   12 +
 .../openssl/ppc-amigaos/test.rsa_complex.c.p       |   18 +-
 sdk/recipes/patches/openssl/test.drbgtest.c.p      |   20 ++
 20 files changed, 498 insertions(+), 354 deletions(-)
 delete mode 100644 
sdk/recipes/files/openssl/ppc-amigaos/crypto/rand/rand_amiga.c
 create mode 100644 
sdk/recipes/files/openssl/ppc-amigaos/providers/implementations/rands/seeding/rand_amiga.c
 delete mode 100644 sdk/recipes/patches/libcares/ppc-amigaos/configure.p
 create mode 100644 sdk/recipes/patches/libcares/ppc-amigaos/ipv6-support.p
 delete mode 100644 sdk/recipes/patches/libcurl/ppc-amigaos/lib.amigaos.h.p
 delete mode 100644 sdk/recipes/patches/libcurl/ppc-amigaos/lib.curl_setup.h.p
 delete mode 100644 sdk/recipes/patches/libcurl/ppc-amigaos/lib.hostip4.c.p
 delete mode 100644 sdk/recipes/patches/openssl/aps.opt.c.p
 create mode 100644 sdk/recipes/patches/openssl/newlib-no-strtoiumax.p
 create mode 100644 
sdk/recipes/patches/openssl/ppc-amigaos/apps.include.http_server.h.p
 create mode 100644 sdk/recipes/patches/openssl/ppc-amigaos/atomics-are-broken.p
 delete mode 100644 
sdk/recipes/patches/openssl/ppc-amigaos/crypto.rand.build.info.p
 delete mode 100644 
sdk/recipes/patches/openssl/ppc-amigaos/include.openssl.e_os2.h.p
 create mode 100644 
sdk/recipes/patches/openssl/ppc-amigaos/providers.implementations.rands.seeding.build.info.p
 create mode 100644 sdk/recipes/patches/openssl/test.drbgtest.c.p

diff --git a/sdk/recipes/files/openssl/ppc-amigaos/crypto/rand/rand_amiga.c 
b/sdk/recipes/files/openssl/ppc-amigaos/crypto/rand/rand_amiga.c
deleted file mode 100644
index cd3f236..0000000
--- a/sdk/recipes/files/openssl/ppc-amigaos/crypto/rand/rand_amiga.c
+++ /dev/null
@@ -1,182 +0,0 @@
-#include <openssl/rand.h>
-#include <openssl/sha.h>
-#include "rand_lcl.h"
-
-#if defined(OPENSSL_SYS_AMIGAOS3) || defined(OPENSSL_SYS_AMIGAOS4)
-#define __USE_INLINE__ 1
-
-#include <proto/exec.h>
-#include <proto/timer.h>
-#include <devices/timer.h>
-
-/* Maximum number of attempts to get a delay of 1 microsecond that is not 
equal to 0 */
-#define MAX_ATTEMPTS 1000
-
-#ifdef __amigaos4__
-
-#ifdef CreateMsgPort
-#undef CreateMsgPort
-#endif
-#define CreateMsgPort() AllocSysObject(ASOT_PORT,NULL)
-#ifdef DeleteMsgPort
-#undef DeleteMsgPort
-#endif
-#define DeleteMsgPort(msgPort) FreeSysObject(ASOT_PORT,msgPort)
-#ifdef CreateIORequest
-#undef CreateIORequest
-#endif
-#define CreateIORequest(ioReplyPort,size) 
AllocSysObjectTags(ASOT_IOREQUEST,ASOIOR_ReplyPort,ioReplyPort,ASOIOR_Size,size,TAG_DONE)
-#ifdef DeleteIORequest
-#undef DeleteIORequest
-#endif
-#define DeleteIORequest(ioReq) FreeSysObject(ASOT_IOREQUEST,ioReq)
-
-#else
-
-#define GetInterface(a, b, c, d) 1
-#define DropInterface(x)
-
-/* OS3 has a different but compatible TimeVal definition */
-struct TimeVal
-{
-    uint32 Seconds;
-    uint32 Microseconds;
-};
-
-#endif /* !__amigaos4__ */
-
-int RAND_poll(void)
-{
-       unsigned char temp_buffer[SHA_DIGEST_LENGTH], 
data_buffer[SHA_DIGEST_LENGTH];
-       struct MsgPort *port = NULL;
-       double entropy_added = 0;
-       struct TimeRequest *time_request = NULL;
-#ifdef __amigaos4__
-       struct IOStdReq *entropy_request = NULL;
-
-       if ((port = CreateMsgPort())
-           && (entropy_request = (struct IOStdReq *)CreateIORequest(port, 
sizeof(*entropy_request))))
-       {
-               if (OpenDevice(TIMERNAME, UNIT_ENTROPY, (struct IORequest 
*)entropy_request, 0) == 0)
-               {
-                       while(entropy_added < ENTROPY_NEEDED)
-                       {
-                               entropy_request->io_Command = TR_READENTROPY;
-                               entropy_request->io_Data = &temp_buffer[0];
-                               entropy_request->io_Length = 
sizeof(temp_buffer);
-
-                               if (DoIO((struct IORequest *)entropy_request) 
== 0)
-                               {
-                                       SHA1(&temp_buffer[0], 
sizeof(temp_buffer), &data_buffer[0]);
-                                       RAND_add(&data_buffer[0], 
sizeof(data_buffer), sizeof(data_buffer));
-                                       entropy_added += sizeof(data_buffer);
-                               }
-                               else
-                                       break;
-                       }
-
-                       CloseDevice((struct IORequest *)entropy_request);
-               }
-       }
-
-       DeleteIORequest((struct IORequest *)entropy_request);
-#endif /* __amigaos4__ */
-
-       /* The following block will be used on "classic" machines. It does not 
generate
-        * a high degree of randomness, but it does the job since RAND_poll is
-        * called only once by OpenSSL to generate a 32 byte seed.
-        */
-       if (entropy_added < ENTROPY_NEEDED
-           && (port || (port = CreateMsgPort()))
-           && (time_request = (struct TimeRequest *)CreateIORequest(port, 
sizeof(*time_request))))
-       {
-               if (OpenDevice(TIMERNAME, UNIT_VBLANK, (struct IORequest 
*)time_request, 0) == 0)
-               {
-                       #if defined(__amigaos4__)
-                       struct TimerIFace *ITimer = NULL;
-                       #endif
-                       struct Device *TimerBase;
-
-                       if ((TimerBase = time_request->Request.io_Device)
-                       #if defined(__amigaos4__)
-                           && (ITimer = (struct TimerIFace 
*)GetInterface((struct Library *)TimerBase, "main", 1, NULL))
-                       #endif
-                       )
-                       {
-                               struct EClockVal curr_eclock;
-                               ULONG prev_ev_lo = 0;
-                               struct TimeVal tv;
-                               int i, attempt;
-                               BOOL aborted;
-
-                               ReadEClock(&curr_eclock);
-                               aborted = FALSE;
-
-                               while(!aborted && entropy_added < 
ENTROPY_NEEDED)
-                               {
-                                       for(i = 0;
-                                           !aborted && i < 
(int)sizeof(temp_buffer) - (int)sizeof(ULONG);
-                                           i++)
-                                       {
-                                               attempt = 0;
-
-                                               /* Ask for a one microsecond 
delay and measure the time
-                                                * the delay actually took.
-                                                */
-                                               do
-                                               {
-                                                       
time_request->Request.io_Command = TR_ADDREQUEST;
-                                                       
time_request->Time.Seconds = 0;
-                                                       
time_request->Time.Microseconds = 1;
-
-                                                       if (DoIO((struct 
IORequest *)time_request) == 0)
-                                                       {
-                                                               prev_ev_lo = 
curr_eclock.ev_lo;
-                                                               
ReadEClock(&curr_eclock);
-
-                                                               attempt++;
-                                                       }
-                                                       else
-                                                               aborted = TRUE;
-                                               } while(!aborted && prev_ev_lo 
== 0 && attempt < MAX_ATTEMPTS);
-
-                                               if (attempt >= MAX_ATTEMPTS)
-                                                       aborted = TRUE;
-
-                                               /* Since we are going for 
randomness, ev_hi is irrelevant */
-                                               temp_buffer[i] = (unsigned 
char)(curr_eclock.ev_lo - prev_ev_lo);
-                                       }
-
-                                       GetSysTime(&tv);
-
-                                       if (sizeof(temp_buffer) > sizeof(ULONG))
-                                               *(ULONG 
*)&temp_buffer[sizeof(temp_buffer) - sizeof(ULONG)]
-                                                   = tv.Microseconds;
-
-                                       /* Shuffle the bits around and specify 
that about
-                                        * one fourth of it adds to the entropy.
-                                        */
-                                       if (!aborted)
-                                       {
-                                               SHA1(&temp_buffer[0], 
sizeof(temp_buffer), &data_buffer[0]);
-                                               RAND_add(&data_buffer[0], 
sizeof(data_buffer), (double)sizeof(data_buffer) / 4);
-                                               entropy_added += 
sizeof(data_buffer) / 4;
-                                       }
-                               }
-                       }
-
-                       #if defined(__amigaos4__)
-                       DropInterface((struct Interface *)ITimer);
-                       #endif
-                       CloseDevice((struct IORequest *)time_request);
-               }
-       }
-
-       DeleteIORequest((struct IORequest *)time_request);
-
-       DeleteMsgPort(port);
-
-       return(entropy_added >= ENTROPY_NEEDED);
-}
-
-#endif /* OPENSSL_SYS_AMIGA */
diff --git 
a/sdk/recipes/files/openssl/ppc-amigaos/providers/implementations/rands/seeding/rand_amiga.c
 
b/sdk/recipes/files/openssl/ppc-amigaos/providers/implementations/rands/seeding/rand_amiga.c
new file mode 100644
index 0000000..ed315ed
--- /dev/null
+++ 
b/sdk/recipes/files/openssl/ppc-amigaos/providers/implementations/rands/seeding/rand_amiga.c
@@ -0,0 +1,275 @@
+#include "internal/cryptlib.h"
+#include <openssl/rand.h>
+#include <openssl/sha.h>
+#include "crypto/rand_pool.h"
+#include "crypto/rand.h"
+#include "prov/seeding.h"
+
+#if defined(OPENSSL_SYS_AMIGAOS3) || defined(OPENSSL_SYS_AMIGAOS4)
+
+# ifndef OPENSSL_RAND_SEED_OS
+#  error "Unsupported seeding method configured; must be os"
+# endif
+
+#define __USE_INLINE__ 1
+
+#include <sys/types.h>
+#include <time.h>
+#include <unistd.h>
+
+#include <proto/exec.h>
+#include <proto/timer.h>
+#include <devices/timer.h>
+
+/* Maximum number of attempts to get a delay of 1 microsecond that is not 
equal to 0 */
+#define MAX_ATTEMPTS 1000
+
+#ifdef __amigaos4__
+
+#ifdef CreateMsgPort
+#undef CreateMsgPort
+#endif
+#define CreateMsgPort() AllocSysObject(ASOT_PORT,NULL)
+#ifdef DeleteMsgPort
+#undef DeleteMsgPort
+#endif
+#define DeleteMsgPort(msgPort) FreeSysObject(ASOT_PORT,msgPort)
+#ifdef CreateIORequest
+#undef CreateIORequest
+#endif
+#define CreateIORequest(ioReplyPort,size) 
AllocSysObjectTags(ASOT_IOREQUEST,ASOIOR_ReplyPort,ioReplyPort,ASOIOR_Size,size,TAG_DONE)
+#ifdef DeleteIORequest
+#undef DeleteIORequest
+#endif
+#define DeleteIORequest(ioReq) FreeSysObject(ASOT_IOREQUEST,ioReq)
+
+#else
+
+#define GetInterface(a, b, c, d) 1
+#define DropInterface(x)
+
+/* OS3 has a different but compatible TimeVal definition */
+struct TimeVal
+{
+    uint32 Seconds;
+    uint32 Microseconds;
+};
+
+#endif /* !__amigaos4__ */
+
+size_t ossl_pool_acquire_entropy(RAND_POOL *pool)
+{
+    unsigned char temp_buffer[SHA_DIGEST_LENGTH], 
data_buffer[SHA_DIGEST_LENGTH];
+    struct MsgPort *port = NULL;
+    size_t bytes_needed;
+    size_t entropy_available = 0;
+    struct TimeRequest *time_request = NULL;
+#ifdef __amigaos4__
+    struct IOStdReq *entropy_request = NULL;
+
+    bytes_needed = ossl_rand_pool_bytes_needed(pool, 1);
+
+    if ((port = CreateMsgPort())
+        && (entropy_request = (struct IOStdReq *)CreateIORequest(port, 
sizeof(*entropy_request))))
+    {
+        if (OpenDevice(TIMERNAME, UNIT_ENTROPY, (struct IORequest 
*)entropy_request, 0) == 0)
+        {
+            while(bytes_needed > 0)
+            {
+                entropy_request->io_Command = TR_READENTROPY;
+                entropy_request->io_Data = &temp_buffer[0];
+                entropy_request->io_Length = sizeof(temp_buffer);
+
+                if (DoIO((struct IORequest *)entropy_request) == 0)
+                {
+                    unsigned char *buffer;
+                    size_t bytes = (bytes_needed < sizeof(data_buffer) ? 
bytes_needed : sizeof(data_buffer));
+
+                    buffer = ossl_rand_pool_add_begin(pool, bytes_needed);
+                    SHA1(&temp_buffer[0], sizeof(temp_buffer), 
&data_buffer[0]);
+                    memcpy(buffer, data_buffer, bytes);
+                    ossl_rand_pool_add_end(pool, bytes, 8 * bytes);
+                    bytes_needed -= bytes;
+                }
+                else
+                    break;
+            }
+
+            CloseDevice((struct IORequest *)entropy_request);
+        }
+    }
+
+    DeleteIORequest((struct IORequest *)entropy_request);
+
+    entropy_available = ossl_rand_pool_entropy_available(pool);
+    if (entropy_available > 0)
+        return entropy_available;
+#endif /* __amigaos4__ */
+
+    /* The following block will be used on "classic" machines. It does not 
generate
+     * a high degree of randomness, but it does the job since RAND_poll is
+     * called only once by OpenSSL to generate a 32 byte seed.
+     */
+
+    bytes_needed = ossl_rand_pool_bytes_needed(pool, 1);
+
+    if (bytes_needed > 0
+        && (port || (port = CreateMsgPort()))
+        && (time_request = (struct TimeRequest *)CreateIORequest(port, 
sizeof(*time_request))))
+    {
+        if (OpenDevice(TIMERNAME, UNIT_VBLANK, (struct IORequest 
*)time_request, 0) == 0)
+        {
+            #if defined(__amigaos4__)
+            struct TimerIFace *ITimer = NULL;
+            #endif
+            struct Device *TimerBase;
+
+            if ((TimerBase = time_request->Request.io_Device)
+            #if defined(__amigaos4__)
+                && (ITimer = (struct TimerIFace *)GetInterface((struct Library 
*)TimerBase, "main", 1, NULL))
+            #endif
+            )
+            {
+                struct EClockVal curr_eclock;
+                ULONG prev_ev_lo = 0;
+                struct TimeVal tv;
+                int i, attempt;
+                BOOL aborted;
+
+                ReadEClock(&curr_eclock);
+                aborted = FALSE;
+
+                while(!aborted && bytes_needed > 0)
+                {
+                    for(i = 0;
+                        !aborted && i < (int)sizeof(temp_buffer) - 
(int)sizeof(ULONG);
+                        i++)
+                    {
+                        attempt = 0;
+
+                        /* Ask for a one microsecond delay and measure the time
+                         * the delay actually took.
+                         */
+                        do
+                        {
+                            time_request->Request.io_Command = TR_ADDREQUEST;
+                            time_request->Time.Seconds = 0;
+                            time_request->Time.Microseconds = 1;
+
+                            if (DoIO((struct IORequest *)time_request) == 0)
+                            {
+                                prev_ev_lo = curr_eclock.ev_lo;
+                                ReadEClock(&curr_eclock);
+
+                                attempt++;
+                            }
+                            else
+                                aborted = TRUE;
+                        } while(!aborted && prev_ev_lo == 0 && attempt < 
MAX_ATTEMPTS);
+
+                        if (attempt >= MAX_ATTEMPTS)
+                            aborted = TRUE;
+
+                        /* Since we are going for randomness, ev_hi is 
irrelevant */
+                        temp_buffer[i] = (unsigned char)(curr_eclock.ev_lo - 
prev_ev_lo);
+                    }
+
+                    GetSysTime(&tv);
+
+                    if (sizeof(temp_buffer) > sizeof(ULONG))
+                        *(ULONG *)&temp_buffer[sizeof(temp_buffer) - 
sizeof(ULONG)]
+                            = tv.Microseconds;
+
+                    /* Shuffle the bits around and specify that about
+                     * one fourth of it adds to the entropy.
+                     */
+                    if (!aborted)
+                    {
+                        unsigned char *buffer;
+                        size_t bytes = (bytes_needed < sizeof(data_buffer) ? 
bytes_needed : sizeof(data_buffer));
+
+                        SHA1(&temp_buffer[0], sizeof(temp_buffer), 
&data_buffer[0]);
+
+                        ossl_rand_pool_add_end(pool, bytes, 
(sizeof(data_buffer) / 4) * 8);
+                        bytes_needed -= bytes;
+                    }
+                }
+            }
+
+            #if defined(__amigaos4__)
+            DropInterface((struct Interface *)ITimer);
+            #endif
+            CloseDevice((struct IORequest *)time_request);
+        }
+    }
+
+    DeleteIORequest((struct IORequest *)time_request);
+
+    DeleteMsgPort(port);
+
+    return ossl_rand_pool_entropy_available(pool);
+}
+
+int ossl_pool_add_nonce_data(RAND_POOL *pool)
+{
+    struct {
+        pid_t pid;
+        CRYPTO_THREAD_ID tid;
+        uint64_t time;
+    } data;
+
+    /* Erase the entire structure including any padding */
+    memset(&data, 0, sizeof(data));
+
+    /*
+     * Add process id, thread id, and a high resolution timestamp to
+     * ensure that the nonce is unique with high probability for
+     * different process instances.
+     */
+    data.pid = getpid();
+    data.tid = CRYPTO_THREAD_get_current_id();
+    /*XXX: can this be improved? */
+    data.time = time(NULL);
+
+    return ossl_rand_pool_add(pool, (unsigned char *)&data, sizeof(data), 0);
+}
+
+int ossl_rand_pool_add_additional_data(RAND_POOL *pool)
+{
+    struct {
+        int fork_id;
+        CRYPTO_THREAD_ID tid;
+        uint64_t time;
+    } data;
+
+    /* Erase the entire structure including any padding */
+    memset(&data, 0, sizeof(data));
+
+    /*
+     * Add some noise from the thread id and a high resolution timer.
+     * The fork_id adds some extra fork-safety.
+     * The thread id adds a little randomness if the drbg is accessed
+     * concurrently (which is the case for the <master> drbg).
+     */
+    data.fork_id = openssl_get_fork_id();
+    data.tid = CRYPTO_THREAD_get_current_id();
+    /*XXX: can this be improved? */
+    data.time = (uint64_t) time(NULL);
+
+    return ossl_rand_pool_add(pool, (unsigned char *)&data, sizeof(data), 0);
+}
+
+int ossl_rand_pool_init(void)
+{
+    return 1;
+}
+
+void ossl_rand_pool_cleanup(void)
+{
+}
+
+void ossl_rand_pool_keep_random_devices_open(int keep)
+{
+}
+
+#endif /* OPENSSL_SYS_AMIGA */
diff --git a/sdk/recipes/patches/libcares/ppc-amigaos/configure.p 
b/sdk/recipes/patches/libcares/ppc-amigaos/configure.p
deleted file mode 100644
index 254a483..0000000
--- a/sdk/recipes/patches/libcares/ppc-amigaos/configure.p
+++ /dev/null
@@ -1,11 +0,0 @@
---- configure.orig     2011-03-08 23:18:37.000000000 +0000
-+++ configure  2011-03-08 23:18:59.000000000 +0000
-@@ -18503,8 +18503,6 @@
-        stdbool.h \
-        time.h \
-        limits.h \
--       arpa/nameser.h \
--       arpa/nameser_compat.h \
-        arpa/inet.h
- do :
-   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
diff --git a/sdk/recipes/patches/libcares/ppc-amigaos/ipv6-support.p 
b/sdk/recipes/patches/libcares/ppc-amigaos/ipv6-support.p
new file mode 100644
index 0000000..c6be683
--- /dev/null
+++ b/sdk/recipes/patches/libcares/ppc-amigaos/ipv6-support.p
@@ -0,0 +1,66 @@
+--- src/lib/ares_ipv6.h.orig   2017-10-10 15:19:45.611896396 +0100
++++ src/lib/ares_ipv6.h        2017-10-17 15:42:25.304921197 +0100
+@@ -22,6 +22,7 @@
+ #endif
+ 
+ #ifndef HAVE_STRUCT_SOCKADDR_IN6
++#define s6_addr _S6_un._S6_u8
+ struct sockaddr_in6
+ {
+   unsigned short       sin6_family;
+--- src/lib/ares__sortaddrinfo.c.orig  2017-10-10 15:19:45.611896396 +0100
++++ src/lib/ares__sortaddrinfo.c       2017-10-17 15:42:25.304921197 +0100
+@@ -71,6 +71,39 @@
+ 
+ #define ARES_IN_LOOPBACK(a) ((((long int)(a)) & 0xff000000) == 0x7f000000)
+ 
++#ifndef IN6_IS_ADDR_LINKLOCAL
++#define IN6_IS_ADDR_LINKLOCAL(a) \
++      ((((__const uint32_t *) (a))[0] & htonl (0xffc00000))                 \
++       == htonl (0xfe800000))
++#endif
++#ifndef IN6_IS_ADDR_LOOPBACK
++#define IN6_IS_ADDR_LOOPBACK(a) \
++      (((__const uint32_t *) (a))[0] == 0                                   \
++       && ((__const uint32_t *) (a))[1] == 0                                \
++       && ((__const uint32_t *) (a))[2] == 0                                \
++       && ((__const uint32_t *) (a))[3] == htonl (1))
++#endif
++#ifndef IN6_IS_ADDR_MULTICAST
++#define IN6_IS_ADDR_MULTICAST(a) (((__const uint8_t *) (a))[0] == 0xff)
++#endif
++#ifndef IN6_IS_ADDR_SITELOCAL
++#define IN6_IS_ADDR_SITELOCAL(a) \
++      ((((__const uint32_t *) (a))[0] & htonl (0xffc00000))                 \
++       == htonl (0xfec00000))
++#endif
++#ifndef IN6_IS_ADDR_V4COMPAT
++#define IN6_IS_ADDR_V4COMPAT(a) \
++      ((((__const uint32_t *) (a))[0] == 0)                                 \
++       && (((__const uint32_t *) (a))[1] == 0)                              \
++       && (((__const uint32_t *) (a))[2] == 0)                              \
++       && (ntohl (((__const uint32_t *) (a))[3]) > 1))
++#endif
++#ifndef IN6_IS_ADDR_V4MAPPED
++#define IN6_IS_ADDR_V4MAPPED(a) \
++      ((((__const uint32_t *) (a))[0] == 0)                                 \
++       && (((__const uint32_t *) (a))[1] == 0)                              \
++       && (((__const uint32_t *) (a))[2] == htonl (0xffff)))
++#endif
+ /* RFC 4193. */
+ #define ARES_IN6_IS_ADDR_ULA(a) (((a)->s6_addr[0] & 0xfe) == 0xfc)
+ 
+@@ -253,8 +286,13 @@
+ /*
+  * Find number of matching initial bits between the two addresses a1 and a2.
+  */
++#ifndef HAVE_STRUCT_SOCKADDR_IN6
++static int common_prefix_len(const struct ares_in6_addr *a1,
++                             const struct ares_in6_addr *a2)
++#else
+ static int common_prefix_len(const struct in6_addr *a1,
+                              const struct in6_addr *a2)
++#endif
+ {
+   const char *p1 = (const char *)a1;
+   const char *p2 = (const char *)a2;
diff --git a/sdk/recipes/patches/libcurl/ppc-amigaos/lib.amigaos.c.p 
b/sdk/recipes/patches/libcurl/ppc-amigaos/lib.amigaos.c.p
index 5243fc5..1c3293b 100644
--- a/sdk/recipes/patches/libcurl/ppc-amigaos/lib.amigaos.c.p
+++ b/sdk/recipes/patches/libcurl/ppc-amigaos/lib.amigaos.c.p
@@ -1,20 +1,33 @@
---- lib/amigaos.c      2019-03-25 08:42:50.000000000 +0000
-+++ lib/amigaos.c      2019-03-30 12:49:06.680985341 +0000
-@@ -24,7 +24,7 @@
+--- lib/amigaos.c.orig 2017-10-10 15:19:45.611896396 +0100
++++ lib/amigaos.c      2017-10-17 15:42:25.304921197 +0100
+@@ -86,7 +86,9 @@
+       ULONG enabled = 0;
  
- #ifdef __AMIGA__
- #  include "amigaos.h"
--#  if defined(HAVE_PROTO_BSDSOCKET_H) && !defined(USE_AMISSL)
-+#  if 0
- #    include <amitcp/socketbasetags.h>
- #  endif
- #  ifdef __libnix__
-@@ -37,7 +37,7 @@
- #include "memdebug.h"
+       SocketBaseTags(SBTM_SETVAL(SBTC_CAN_SHARE_LIBRARY_BASES), TRUE,
++#ifdef SBTC_HAVE_GETHOSTADDR_R_API
+                      SBTM_GETREF(SBTC_HAVE_GETHOSTADDR_R_API), 
(ULONG)&enabled,
++#endif
+                      TAG_DONE);
  
- #ifdef __AMIGA__
--#if defined(HAVE_PROTO_BSDSOCKET_H) && !defined(USE_AMISSL)
-+#if 0
- struct Library *SocketBase = NULL;
- extern int errno, h_errno;
+       if(enabled) {
+@@ -132,20 +134,6 @@
+   struct SocketIFace *ISocket = __CurlISocket;
  
+   if(SocketFeatures & HAVE_BSDSOCKET_GETHOSTBYNAME_R) {
+-    LONG h_errnop = 0;
+-    struct hostent *buf;
+-
+-    buf = calloc(1, CURL_HOSTENT_SIZE);
+-    if(buf) {
+-      h = gethostbyname_r((STRPTR)hostname, buf,
+-                          (char *)buf + sizeof(struct hostent),
+-                          CURL_HOSTENT_SIZE - sizeof(struct hostent),
+-                          &h_errnop);
+-      if(h) {
+-        ai = Curl_he2ai(h, port);
+-      }
+-      free(buf);
+-    }
+   }
+   else {
+     #ifdef CURLRES_THREADED
diff --git a/sdk/recipes/patches/libcurl/ppc-amigaos/lib.amigaos.h.p 
b/sdk/recipes/patches/libcurl/ppc-amigaos/lib.amigaos.h.p
deleted file mode 100644
index 2f62a1c..0000000
--- a/sdk/recipes/patches/libcurl/ppc-amigaos/lib.amigaos.h.p
+++ /dev/null
@@ -1,11 +0,0 @@
---- lib/amigaos.h      2019-03-25 08:42:50.000000000 +0000
-+++ lib/amigaos.h      2019-03-30 12:49:50.744493740 +0000
-@@ -23,7 +23,7 @@
-  ***************************************************************************/
- #include "curl_setup.h"
- 
--#if defined(__AMIGA__) && defined(HAVE_BSDSOCKET_H) && !defined(USE_AMISSL)
-+#if 0
- 
- bool Curl_amiga_init();
- void Curl_amiga_cleanup();
diff --git a/sdk/recipes/patches/libcurl/ppc-amigaos/lib.curl_setup.h.p 
b/sdk/recipes/patches/libcurl/ppc-amigaos/lib.curl_setup.h.p
deleted file mode 100644
index 0e52d73..0000000
--- a/sdk/recipes/patches/libcurl/ppc-amigaos/lib.curl_setup.h.p
+++ /dev/null
@@ -1,12 +0,0 @@
---- lib/curl_setup.h   2019-03-30 13:44:08.576270700 +0000
-+++ lib/curl_setup.h   2019-03-30 13:44:33.011975643 +0000
-@@ -314,7 +314,8 @@
- #  include <exec/execbase.h>
- #  include <proto/exec.h>
- #  include <proto/dos.h>
--#  ifdef HAVE_PROTO_BSDSOCKET_H
-+#  define HAVE_SELECT 1
-+#  if 0
- #    include <proto/bsdsocket.h> /* ensure bsdsocket.library use */
- #    define select(a,b,c,d,e) WaitSelect(a,b,c,d,e,0)
- #  endif
diff --git a/sdk/recipes/patches/libcurl/ppc-amigaos/lib.hostip4.c.p 
b/sdk/recipes/patches/libcurl/ppc-amigaos/lib.hostip4.c.p
deleted file mode 100644
index 39952b8..0000000
--- a/sdk/recipes/patches/libcurl/ppc-amigaos/lib.hostip4.c.p
+++ /dev/null
@@ -1,60 +0,0 @@
---- lib/hostip4.c      2020-01-05 09:50:51.000000000 +0000
-+++ lib/hostip4.c      2020-05-07 16:02:59.313823259 +0100
-@@ -120,6 +120,10 @@ Curl_addrinfo *Curl_getaddrinfo(struct c
-  * implying that only threadsafe code and function calls may be used.
-  *
-  */
-+#ifdef __amigaos4__
-+#include <proto/exec.h>
-+#include <proto/bsdsocket.h>
-+#endif
- Curl_addrinfo *Curl_ipv4_resolve_r(const char *hostname,
-                                    int port)
- {
-@@ -130,6 +134,9 @@ Curl_addrinfo *Curl_ipv4_resolve_r(const
-   struct hostent *h = NULL;
-   struct in_addr in;
-   struct hostent *buf = NULL;
-+#ifdef __amigaos4__
-+  struct SocketIFace *ISocket = NULL;
-+#endif
- 
- #ifdef ENABLE_IPV6
-   {
-@@ -302,7 +309,20 @@ Curl_addrinfo *Curl_ipv4_resolve_r(const
-      * gethostbyname() is the preferred one.
-      */
-   else {
-+#ifdef __amigaos4__
-+    struct Library *SocketBase = IExec->OpenLibrary("bsdsocket.library", 4);
-+    if (SocketBase)
-+    {
-+       ISocket = (struct SocketIFace *)IExec->GetInterface(SocketBase, 
"main", 1, NULL);
-+    }
-+
-+    if (ISocket)
-+    {
-+       h = ISocket->gethostbyname((void*)hostname);
-+    }
-+#else  
-     h = gethostbyname((void *)hostname);
-+#endif
- #endif /* HAVE_GETADDRINFO_THREADSAFE || HAVE_GETHOSTBYNAME_R */
-   }
- 
-@@ -312,7 +332,14 @@ Curl_addrinfo *Curl_ipv4_resolve_r(const
-     if(buf) /* used a *_r() function */
-       free(buf);
-   }
--
-+#ifdef __amigaos4__
-+  if (ISocket)
-+  {
-+     struct Library *SocketBase = ISocket->Data.LibBase;
-+     IExec->DropInterface((struct Interface *)ISocket);
-+     IExec->CloseLibrary(SocketBase);
-+  }
-+#endif 
-   return ai;
- }
- #endif /* defined(CURLRES_IPV4) && !defined(CURLRES_ARES) */
diff --git a/sdk/recipes/patches/openssl/apps.speed.c.p 
b/sdk/recipes/patches/openssl/apps.speed.c.p
index 1ccac30..132d473 100644
--- a/sdk/recipes/patches/openssl/apps.speed.c.p
+++ b/sdk/recipes/patches/openssl/apps.speed.c.p
@@ -1,5 +1,5 @@
---- apps/speed.c.orig  2017-11-22 08:07:53.851790744 +0000
-+++ apps/speed.c       2017-11-22 08:15:49.608768064 +0000
+--- apps/speed.c.orig  2017-11-21 22:49:00.185608040 +0000
++++ apps/speed.c       2017-11-21 22:49:21.488219518 +0000
 @@ -62,6 +62,12 @@
  #include "./testdsa.h"
  #include <openssl/modes.h>
@@ -13,14 +13,22 @@
  #ifndef HAVE_FORK
  # if defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_WINDOWS) || 
defined(OPENSSL_SYS_VXWORKS)
  #  define HAVE_FORK 0
-@@ -134,8 +240,10 @@
- static double Time_F(int s)
- {
-     double ret = app_tminterval(s, usertime);
-+    #ifdef SIGALRM
-     if (s == STOP)
-         alarm(0);
-+    #endif
+@@ -186,6 +192,18 @@
+ 
      return ret;
  }
- 
++#elif defined(OPENSSL_SYS_AMIGAOS3) || defined(OPENSSL_SYS_AMIGAOS4)
++static void alarm_aos(unsigned int secs)
++{
++    (void) secs;
++}
++#define alarm alarm_aos
++
++static double Time_F(int s)
++{
++    double ret = app_tminterval(s, usertime);
++    return ret;
++}
+ #else
+ # error "SIGALRM not defined and the platform is not Windows"
+ #endif
diff --git a/sdk/recipes/patches/openssl/aps.opt.c.p 
b/sdk/recipes/patches/openssl/aps.opt.c.p
deleted file mode 100644
index 2ba3fba..0000000
--- a/sdk/recipes/patches/openssl/aps.opt.c.p
+++ /dev/null
@@ -1,14 +0,0 @@
---- apps/lib/opt.c.orig        2017-11-22 08:42:07.605882648 +0000
-+++ apps/lib/opt.c     2017-11-22 08:48:31.712843519 +0000
-@@ -564,6 +564,11 @@
-     defined(INTMAX_MAX) && defined(UINTMAX_MAX) && \
-     !defined(OPENSSL_NO_INTTYPES_H)
- 
-+#if defined(OPENSSL_SYS_AMIGAOS3) || defined(OPENSSL_SYS_AMIGAOS4)
-+# define strtoimax strtol
-+# define strtoumax strtoul
-+#endif
-+
- /* Parse an intmax_t, put it into *result; return 0 on failure, else 1. */
- int opt_intmax(const char *value, ossl_intmax_t *result)
- {
diff --git a/sdk/recipes/patches/openssl/newlib-no-strtoiumax.p 
b/sdk/recipes/patches/openssl/newlib-no-strtoiumax.p
new file mode 100644
index 0000000..27f6a9d
--- /dev/null
+++ b/sdk/recipes/patches/openssl/newlib-no-strtoiumax.p
@@ -0,0 +1,22 @@
+--- apps/lib/opt.c.orig        2017-10-10 15:19:45.611896396 +0100
++++ apps/lib/opt.c     2017-10-17 15:42:25.304921197 +0100
+@@ -562,7 +562,7 @@
+ 
+ #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L && \
+     defined(INTMAX_MAX) && defined(UINTMAX_MAX) && \
+-    !defined(OPENSSL_NO_INTTYPES_H)
++    !defined(OPENSSL_NO_INTTYPES_H) && !defined(OPENSSL_SYS_AMIGAOS3) && 
!defined(OPENSSL_SYS_AMIGAOS4)
+ 
+ /* Parse an intmax_t, put it into *result; return 0 on failure, else 1. */
+ int opt_intmax(const char *value, ossl_intmax_t *result)
+--- test/params_conversion_test.c.orig 2017-10-10 15:19:45.611896396 +0100
++++ test/params_conversion_test.c      2017-10-17 15:42:25.304921197 +0100
+@@ -15,7 +15,7 @@
+ /* On machines that dont support <inttypes.h> just disable the tests */
+ #if !defined(OPENSSL_NO_INTTYPES_H)
+ 
+-# ifdef OPENSSL_SYS_VMS
++# if defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_AMIGAOS3) || 
defined(OPENSSL_SYS_AMIGAOS4)
+ #  define strtoumax strtoull
+ #  define strtoimax strtoll
+ # endif
diff --git 
a/sdk/recipes/patches/openssl/ppc-amigaos/apps.include.http_server.h.p 
b/sdk/recipes/patches/openssl/ppc-amigaos/apps.include.http_server.h.p
new file mode 100644
index 0000000..8d9684e
--- /dev/null
+++ b/sdk/recipes/patches/openssl/ppc-amigaos/apps.include.http_server.h.p
@@ -0,0 +1,11 @@
+--- apps/include/http_server.h.orig    2017-11-21 22:49:00.185608040 +0000
++++ apps/include/http_server.h 2017-11-21 22:49:21.488219518 +0000
+@@ -27,7 +27,7 @@
+ # endif
+ 
+ # if !defined(NO_FORK) && !defined(OPENSSL_NO_SOCK) \
+-    && !defined(OPENSSL_NO_POSIX_IO)
++    && !defined(OPENSSL_NO_POSIX_IO) && !defined(NO_SYSLOG)
+ #  define HTTP_DAEMON
+ #  include <sys/types.h>
+ #  include <sys/wait.h>
diff --git a/sdk/recipes/patches/openssl/ppc-amigaos/atomics-are-broken.p 
b/sdk/recipes/patches/openssl/ppc-amigaos/atomics-are-broken.p
new file mode 100644
index 0000000..a08fec5
--- /dev/null
+++ b/sdk/recipes/patches/openssl/ppc-amigaos/atomics-are-broken.p
@@ -0,0 +1,22 @@
+--- include/internal/tsan_assist.h.orig        2017-11-21 22:49:00.185608040 
+0000
++++ include/internal/tsan_assist.h     2017-11-21 22:49:21.488219518 +0000
+@@ -48,7 +48,7 @@
+  */
+ 
+ #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L \
+-    && !defined(__STDC_NO_ATOMICS__)
++    && !defined(__STDC_NO_ATOMICS__) && !defined(__AMIGA__)
+ # include <stdatomic.h>
+ 
+ # if defined(ATOMIC_POINTER_LOCK_FREE) \
+--- include/internal/refcount.h.orig   2017-11-21 22:49:00.185608040 +0000
++++ include/internal/refcount.h        2017-11-21 22:49:21.488219518 +0000
+@@ -15,7 +15,7 @@
+ 
+ # ifndef OPENSSL_DEV_NO_ATOMICS
+ #  if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L \
+-      && !defined(__STDC_NO_ATOMICS__)
++      && !defined(__STDC_NO_ATOMICS__) && !defined(__AMIGA__)
+ #   include <stdatomic.h>
+ #   define HAVE_C11_ATOMICS
+ #  endif
diff --git a/sdk/recipes/patches/openssl/ppc-amigaos/crypto.bio_b_addr.c.p 
b/sdk/recipes/patches/openssl/ppc-amigaos/crypto.bio_b_addr.c.p
index dd10e8c..ac14e86 100644
--- a/sdk/recipes/patches/openssl/ppc-amigaos/crypto.bio_b_addr.c.p
+++ b/sdk/recipes/patches/openssl/ppc-amigaos/crypto.bio_b_addr.c.p
@@ -1,6 +1,6 @@
---- crypto/bio/b_addr.c.orig   2017-11-21 22:49:00.185608040 +0000
-+++ crypto/bio/b_addr.c        2017-11-21 22:49:21.488219518 +0000
-@@ -854,7 +854,7 @@
+--- crypto/bio/bio_addr.c.orig 2017-11-21 22:49:00.185608040 +0000
++++ crypto/bio/bio_addr.c      2017-11-21 22:49:21.488219518 +0000
+@@ -910,7 +910,7 @@
                  addrlistp++)
                  ;
  
diff --git a/sdk/recipes/patches/openssl/ppc-amigaos/crypto.ppccap.c.p 
b/sdk/recipes/patches/openssl/ppc-amigaos/crypto.ppccap.c.p
index 56949ca..46d6213 100644
--- a/sdk/recipes/patches/openssl/ppc-amigaos/crypto.ppccap.c.p
+++ b/sdk/recipes/patches/openssl/ppc-amigaos/crypto.ppccap.c.p
@@ -1,15 +1,15 @@
 --- crypto/ppccap.c.orig       2017-11-22 13:14:44.655536374 +0000
 +++ crypto/ppccap.c    2017-11-22 13:16:03.666387174 +0000
-@@ -135,6 +135,8 @@
- }
- #endif
+@@ -34,6 +34,8 @@
+ 
+ static sigset_t all_masked;
  
 +#ifndef OPENSSL_SYS_AMIGAOS4
 +
  static sigjmp_buf ill_jmp;
  static void ill_handler(int sig)
  {
-@@ -341,3 +343,24 @@
+@@ -309,3 +311,29 @@
      sigaction(SIGILL, &ill_oact, NULL);
      sigprocmask(SIG_SETMASK, &oset, NULL);
  }
@@ -33,4 +33,9 @@
 +        OPENSSL_ppccap_P |= PPC_ALTIVEC;
 +    }
 +}
++
++uint32_t OPENSSL_rdtsc(void)
++{
++    return 0;
++}
 +#endif
diff --git a/sdk/recipes/patches/openssl/ppc-amigaos/crypto.rand.build.info.p 
b/sdk/recipes/patches/openssl/ppc-amigaos/crypto.rand.build.info.p
deleted file mode 100644
index 58b672f..0000000
--- a/sdk/recipes/patches/openssl/ppc-amigaos/crypto.rand.build.info.p
+++ /dev/null
@@ -1,9 +0,0 @@
---- crypto/rand/build.info.orig        2017-11-22 11:36:06.585363219 +0000
-+++ crypto/rand/build.info     2017-11-22 11:36:39.267232034 +0000
-@@ -1,4 +1,4 @@
- LIBS=../../libcrypto
- SOURCE[../../libcrypto]=\
--        md_rand.c randfile.c rand_lib.c rand_err.c rand_egd.c \
--        rand_win.c rand_unix.c rand_vms.c
-+        md_rand.c randfile.c rand_lib.c rand_err.c rand_amiga.c \
-+        rand_egd.c rand_win.c rand_unix.c rand_vms.c
diff --git a/sdk/recipes/patches/openssl/ppc-amigaos/include.openssl.e_os2.h.p 
b/sdk/recipes/patches/openssl/ppc-amigaos/include.openssl.e_os2.h.p
deleted file mode 100644
index 6ea1ec8..0000000
--- a/sdk/recipes/patches/openssl/ppc-amigaos/include.openssl.e_os2.h.p
+++ /dev/null
@@ -1,11 +0,0 @@
---- include/openssl/e_os2.h.orig       2017-11-21 23:09:39.684814614 +0000
-+++ include/openssl/e_os2.h    2017-11-21 23:10:32.501369938 +0000
-@@ -223,6 +223,8 @@
- #   define OSSL_SSIZE_MAX SSIZE_MAX
- #  elif defined(_POSIX_SSIZE_MAX)
- #   define OSSL_SSIZE_MAX _POSIX_SSIZE_MAX
-+#  else
-+#   define OSSL_SSIZE_MAX INT_MAX
- #  endif
- # endif
- 
diff --git 
a/sdk/recipes/patches/openssl/ppc-amigaos/providers.implementations.rands.seeding.build.info.p
 
b/sdk/recipes/patches/openssl/ppc-amigaos/providers.implementations.rands.seeding.build.info.p
new file mode 100644
index 0000000..c887eff
--- /dev/null
+++ 
b/sdk/recipes/patches/openssl/ppc-amigaos/providers.implementations.rands.seeding.build.info.p
@@ -0,0 +1,12 @@
+--- providers/implementations/rands/seeding/build.info.orig    2017-11-21 
22:49:00.185608040 +0000
++++ providers/implementations/rands/seeding/build.info 2017-11-21 
22:49:21.488219518 +0000
+@@ -5,6 +5,9 @@
+ IF[{- $config{target} =~ /vms/i -}]
+   $COMMON=$COMMON rand_vms.c
+ ENDIF
++IF[{- $config{target} =~ /amiga/i -}]
++  $COMMON=$COMMON rand_amiga.c
++ENDIF
+
+ SOURCE[../../../libdefault.a]=$COMMON
+ 
diff --git a/sdk/recipes/patches/openssl/ppc-amigaos/test.rsa_complex.c.p 
b/sdk/recipes/patches/openssl/ppc-amigaos/test.rsa_complex.c.p
index a5fa68a..969062b 100644
--- a/sdk/recipes/patches/openssl/ppc-amigaos/test.rsa_complex.c.p
+++ b/sdk/recipes/patches/openssl/ppc-amigaos/test.rsa_complex.c.p
@@ -1,14 +1,14 @@
 --- test/rsa_complex.c.orig    2019-02-14 10:16:06.665734720 +0000
 +++ test/rsa_complex.c 2019-02-14 10:16:18.581682332 +0000
-@@ -12,11 +12,6 @@
-  * The former defines "I" as a macro and earlier versions of the latter use
-  * for function arguments.
+@@ -16,11 +16,6 @@
   */
--#if defined(__STDC_VERSION__)
--# if __STDC_VERSION__ >= 199901L
--#  include <complex.h>
+ 
+ #if !defined(__DJGPP__)
+-# if defined(__STDC_VERSION__)
+-#  if __STDC_VERSION__ >= 199901L
+-#   include <complex.h>
+-#  endif
 -# endif
--#endif
- #include <openssl/rsa.h>
+ # include <openssl/rsa.h>
+ #endif
  #include <stdlib.h>
- 
diff --git a/sdk/recipes/patches/openssl/test.drbgtest.c.p 
b/sdk/recipes/patches/openssl/test.drbgtest.c.p
new file mode 100644
index 0000000..ecf3e81
--- /dev/null
+++ b/sdk/recipes/patches/openssl/test.drbgtest.c.p
@@ -0,0 +1,20 @@
+--- test/drbgtest.c.orig       2017-10-10 15:19:45.611896396 +0100
++++ test/drbgtest.c    2017-10-17 15:42:25.304921197 +0100
+@@ -277,7 +277,7 @@
+ }
+ 
+ 
+-#if defined(OPENSSL_SYS_UNIX) && !defined(OPENSSL_RAND_SEED_EGD)
++#if defined(OPENSSL_SYS_UNIX) && !defined(OPENSSL_RAND_SEED_EGD) && 
!defined(OPENSSL_SYS_AMIGAOS3) && !defined(OPENSSL_SYS_AMIGAOS4)
+ /* number of children to fork */
+ #define DRBG_FORK_COUNT 9
+ /* two results per child, two for the parent */
+@@ -895,7 +895,7 @@
+ int setup_tests(void)
+ {
+     ADD_TEST(test_rand_reseed);
+-#if defined(OPENSSL_SYS_UNIX) && !defined(OPENSSL_RAND_SEED_EGD)
++#if defined(OPENSSL_SYS_UNIX) && !defined(OPENSSL_RAND_SEED_EGD) && 
!defined(OPENSSL_SYS_AMIGAOS3) && !defined(OPENSSL_SYS_AMIGAOS4)
+     ADD_ALL_TESTS(test_rand_fork_safety, RANDOM_SIZE);
+ #endif
+     ADD_TEST(test_rand_prediction_resistance);


-- 
Cross-compilation toolchains and environments
_______________________________________________
netsurf-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to