summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn-Mark Bell <jmb@netsurf-browser.org>2022-11-03 14:24:21 +0000
committerJohn-Mark Bell <jmb@netsurf-browser.org>2022-11-03 16:24:56 +0000
commitda2a97fb030faa0f5c48b5c6e6ba21982dd8ff2b (patch)
tree6ac2b3efdbdbef1430cd45fb6b55528e4fae3221
parentcd0deb266d6aa466033d8c75075d92aae5a83812 (diff)
downloadtoolchains-da2a97fb030faa0f5c48b5c6e6ba21982dd8ff2b.tar.gz
toolchains-da2a97fb030faa0f5c48b5c6e6ba21982dd8ff2b.tar.bz2
OpenSSL/m68k-unknown-amigaos: refresh patches
-rw-r--r--sdk/recipes/files/openssl/m68k-unknown-amigaos/crypto/rand/rand_amiga.c189
-rw-r--r--sdk/recipes/files/openssl/m68k-unknown-amigaos/providers/implementations/rands/seeding/rand_amiga.c282
-rw-r--r--sdk/recipes/patches/openssl/m68k-unknown-amigaos/apps.apps.c.p6
-rw-r--r--sdk/recipes/patches/openssl/m68k-unknown-amigaos/apps.include.http_server.h.p11
-rw-r--r--sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.bio.b_sock2.c.p24
-rw-r--r--sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.bn.bn_div.c.p2
-rw-r--r--sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.include.internal.md32_common.h.p36
-rw-r--r--sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.rand.build.info.p9
-rw-r--r--sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.ui.ui_openssl.c.p32
-rw-r--r--sdk/recipes/patches/openssl/m68k-unknown-amigaos/include.openssl.e_os2.h.p11
-rw-r--r--sdk/recipes/patches/openssl/m68k-unknown-amigaos/providers.implementations.rands.seeding.build.info.p12
11 files changed, 337 insertions, 277 deletions
diff --git a/sdk/recipes/files/openssl/m68k-unknown-amigaos/crypto/rand/rand_amiga.c b/sdk/recipes/files/openssl/m68k-unknown-amigaos/crypto/rand/rand_amiga.c
deleted file mode 100644
index 3c18b7d..0000000
--- a/sdk/recipes/files/openssl/m68k-unknown-amigaos/crypto/rand/rand_amiga.c
+++ /dev/null
@@ -1,189 +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
-{
- ULONG Seconds;
- ULONG Microseconds;
-};
-
-/* ...and ditto for TimeRequest */
-struct TimeRequest
-{
- struct IORequest Request;
- struct TimeVal Time;
-};
-
-#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/m68k-unknown-amigaos/providers/implementations/rands/seeding/rand_amiga.c b/sdk/recipes/files/openssl/m68k-unknown-amigaos/providers/implementations/rands/seeding/rand_amiga.c
new file mode 100644
index 0000000..205d527
--- /dev/null
+++ b/sdk/recipes/files/openssl/m68k-unknown-amigaos/providers/implementations/rands/seeding/rand_amiga.c
@@ -0,0 +1,282 @@
+#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
+{
+ ULONG Seconds;
+ ULONG Microseconds;
+};
+
+/* ... and ditto for TimeRequest */
+struct TimeRequest
+{
+ struct IORequest Request;
+ struct TimeVal Time;
+};
+
+#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/m68k-unknown-amigaos/apps.apps.c.p b/sdk/recipes/patches/openssl/m68k-unknown-amigaos/apps.apps.c.p
index 947eeca..1e677d2 100644
--- a/sdk/recipes/patches/openssl/m68k-unknown-amigaos/apps.apps.c.p
+++ b/sdk/recipes/patches/openssl/m68k-unknown-amigaos/apps.apps.c.p
@@ -1,6 +1,6 @@
---- apps.c 2014-10-15 13:53:39.000000000 +0100
-+++ apps/apps.c 2015-01-05 21:02:13.650018727 +0000
-@@ -2872,10 +2872,11 @@ double app_tminterval(int stop, int user
+--- apps/lib/apps.c.orig 2014-10-15 13:53:39.000000000 +0100
++++ apps/lib/apps.c 2015-01-05 21:02:13.650018727 +0000
+@@ -2797,10 +2797,11 @@ double app_tminterval(int stop, int user
struct rusage rus;
struct timeval now;
static struct timeval tmstart;
diff --git a/sdk/recipes/patches/openssl/m68k-unknown-amigaos/apps.include.http_server.h.p b/sdk/recipes/patches/openssl/m68k-unknown-amigaos/apps.include.http_server.h.p
new file mode 100644
index 0000000..8d9684e
--- /dev/null
+++ b/sdk/recipes/patches/openssl/m68k-unknown-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/m68k-unknown-amigaos/crypto.bio.b_sock2.c.p b/sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.bio.b_sock2.c.p
index 4f6fa4b..93db04c 100644
--- a/sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.bio.b_sock2.c.p
+++ b/sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.bio.b_sock2.c.p
@@ -1,14 +1,14 @@
---- crypto/bio/b_sock2.c.orig 2019-02-15 10:07:24.181612545 +0000
-+++ crypto/bio/b_sock2.c 2019-02-15 10:07:15.637654488 +0000
-@@ -94,6 +94,7 @@
+--- crypto/bio/bio_sock2.c.orig 2019-02-15 10:07:24.181612545 +0000
++++ crypto/bio/bio_sock2.c 2019-02-15 10:07:15.637654488 +0000
+@@ -98,6 +98,7 @@
}
}
+#if defined(TCP_NODELAY)
if (options & BIO_SOCK_NODELAY) {
- if (setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(on)) != 0) {
- SYSerr(SYS_F_SETSOCKOPT, get_last_socket_error());
-@@ -101,6 +102,7 @@
+ if (setsockopt(sock, IPPROTO_TCP, TCP_NODELAY,
+ (const void *)&on, sizeof(on)) != 0) {
+@@ -107,6 +108,7 @@
return 0;
}
}
@@ -16,19 +16,19 @@
if (connect(sock, BIO_ADDR_sockaddr(addr),
BIO_ADDR_sockaddr_size(addr)) == -1) {
-@@ -193,6 +195,7 @@
+@@ -252,6 +254,7 @@
}
}
+#if defined(TCP_NODELAY)
if (options & BIO_SOCK_NODELAY) {
- if (setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(on)) != 0) {
- SYSerr(SYS_F_SETSOCKOPT, get_last_socket_error());
-@@ -200,6 +203,7 @@
+ if (setsockopt(sock, IPPROTO_TCP, TCP_NODELAY,
+ (const void *)&on, sizeof(on)) != 0) {
+@@ -261,6 +264,7 @@
return 0;
}
}
+#endif
- # ifdef IPV6_V6ONLY
- if (BIO_ADDR_family(addr) == AF_INET6) {
+ /* On OpenBSD it is always ipv6 only with ipv6 sockets thus read-only */
+ # if defined(IPV6_V6ONLY) && !defined(__OpenBSD__)
diff --git a/sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.bn.bn_div.c.p b/sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.bn.bn_div.c.p
index 0d5492f..3fa3a53 100644
--- a/sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.bn.bn_div.c.p
+++ b/sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.bn.bn_div.c.p
@@ -1,6 +1,6 @@
--- crypto/bn/bn_div.c 2017-01-26 13:22:03.000000000 +0000
+++ crypto/bn/bn_div.c 2017-02-11 16:06:29.437010335 +0000
-@@ -175,6 +175,22 @@ int BN_div(BIGNUM *dv, BIGNUM *rem, cons
+@@ -194,6 +194,22 @@ int BN_div(BIGNUM *dv, BIGNUM *rem, cons
q; \
})
# define REMAINDER_IS_ALREADY_CALCULATED
diff --git a/sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.include.internal.md32_common.h.p b/sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.include.internal.md32_common.h.p
deleted file mode 100644
index 7447d54..0000000
--- a/sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.include.internal.md32_common.h.p
+++ /dev/null
@@ -1,36 +0,0 @@
---- crypto/include/internal/md32_common.h 2017-11-02 14:29:03.000000000 +0000
-+++ crypto/include/internal/md32_common.h 2018-07-23 20:12:11.228066913 +0100
-@@ -182,6 +182,9 @@
- # define HOST_l2c(l,c) (*((unsigned int *)(c))=(l), (c)+=4, (l))
- # endif
- # endif
-+# elif defined(__mc68020)
-+# define HOST_c2l(c,l) ({ asm volatile ("movel %0@+,%1" : "=a"(c), "=d"(l) : "0"(c)); })
-+# define HOST_l2c(l,c) ({ asm volatile ("movel %1,%0@+" : "=a"(c) : "d"(l), "0"(c)); })
- # endif
- # endif
- # if defined(__s390__) || defined(__s390x__)
-@@ -215,6 +218,22 @@
- # define HOST_l2c(l,c) ({ asm ("strv %1,%0" \
- :"=m"(*(unsigned int *)(c)) :"d"(l));\
- (c)+=4; (l); })
-+# elif defined(__mc68020)
-+# define HOST_c2l(c,l) ({ unsigned int r; \
-+ asm volatile ("movel %1@+,%0\n" \
-+ "rorw #8,%0\n" \
-+ "swap %0\n" \
-+ "rorw #8,%0\n" \
-+ : "=d"(r), "=a"(c) \
-+ : "1"(c)); \
-+ (l)=r; })
-+# define HOST_l2c(l,c) ({ unsigned int r=(l); \
-+ asm volatile ("rorw #8,%0\n" \
-+ "swap %0\n" \
-+ "rorw #8,%0\n" \
-+ "movel %0,%1@+\n" \
-+ : "=d"(r), "=a"(c) \
-+ : "0"(r), "1"(c)); })
- # endif
- # endif
- # if defined(__i386) || defined(__i386__) || defined(__x86_64) || defined(__x86_64__)
-
diff --git a/sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.rand.build.info.p b/sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.rand.build.info.p
deleted file mode 100644
index 58b672f..0000000
--- a/sdk/recipes/patches/openssl/m68k-unknown-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/m68k-unknown-amigaos/crypto.ui.ui_openssl.c.p b/sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.ui.ui_openssl.c.p
index 0448499..3407a48 100644
--- a/sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.ui.ui_openssl.c.p
+++ b/sdk/recipes/patches/openssl/m68k-unknown-amigaos/crypto.ui.ui_openssl.c.p
@@ -1,21 +1,21 @@
--- crypto/ui/ui_openssl.c.orig 2017-11-23 13:22:15.760078583 +0000
+++ crypto/ui/ui_openssl.c 2017-11-23 13:21:40.534382076 +0000
-@@ -99,6 +99,18 @@
+@@ -103,6 +103,18 @@
+ # undef SGTTY
+ # endif
- #endif
-
-+#if defined(OPENSSL_SYS_AMIGAOS3)
-+#undef TERMIOS
-+#undef TERMIO
-+#undef SGTTY
++# if defined(OPENSSL_SYS_AMIGAOS3)
++# undef TERMIOS
++# undef TERMIO
++# undef SGTTY
+struct termios { int foo; };
-+# define TTY_STRUCT struct termios
-+# define TTY_FLAGS foo
-+# define TTY_get(tty,data) /* tcgetattr(tty,data) */ -1
-+# define TTY_set(tty,data) /* tcsetattr(tty,TCSANOW,data) */ 0
-+# define ECHO 0
-+#endif
++# define TTY_STRUCT struct termios
++# define TTY_FLAGS foo
++# define TTY_get(tty,data) /* tcgetattr(tty,data) */ -1
++# define TTY_set(tty,data) /* tcsetattr(tty,TCSANOW,data) */ 0
++# define ECHO 0
++# endif
+
- #ifdef TERMIOS
- # include <termios.h>
- # define TTY_STRUCT struct termios
+ # ifdef TERMIOS
+ # include <termios.h>
+ # define TTY_STRUCT struct termios
diff --git a/sdk/recipes/patches/openssl/m68k-unknown-amigaos/include.openssl.e_os2.h.p b/sdk/recipes/patches/openssl/m68k-unknown-amigaos/include.openssl.e_os2.h.p
deleted file mode 100644
index 6ea1ec8..0000000
--- a/sdk/recipes/patches/openssl/m68k-unknown-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/m68k-unknown-amigaos/providers.implementations.rands.seeding.build.info.p b/sdk/recipes/patches/openssl/m68k-unknown-amigaos/providers.implementations.rands.seeding.build.info.p
new file mode 100644
index 0000000..c887eff
--- /dev/null
+++ b/sdk/recipes/patches/openssl/m68k-unknown-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
+