openssl3: new package, openssl 3.0.0

This commit is contained in:
Tom G. Christensen
2021-11-27 19:43:00 +01:00
parent be5c408ecd
commit cdba37fb86
11 changed files with 375 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
From 4b50edca4dfb70ba36ece8dfb457c2c52dd65065 Mon Sep 17 00:00:00 2001
From: "Tom G. Christensen" <tgc@jupiterrise.com>
Date: Wed, 27 Oct 2021 20:15:30 +0200
Subject: [PATCH 1/6] Fix fallback for missing getaddrinfo()
Allow port 0 which is what the testsuite uses.
---
crypto/bio/bio_addr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/crypto/bio/bio_addr.c b/crypto/bio/bio_addr.c
index d18c849ade..16a3676492 100644
--- a/crypto/bio/bio_addr.c
+++ b/crypto/bio/bio_addr.c
@@ -867,7 +867,7 @@ int BIO_lookup_ex(const char *host, const char *service, int lookup_type,
}
if (endp != service && *endp == '\0'
- && portnum > 0 && portnum < 65536) {
+ && portnum >= 0 && portnum < 65536) {
se_fallback.s_port = htons((unsigned short)portnum);
se_fallback.s_proto = proto;
se = &se_fallback;
--
2.27.0

View File

@@ -0,0 +1,29 @@
From 9aa7d4ac148ac0b9aa695936d6f5d01ab198f05c Mon Sep 17 00:00:00 2001
From: "Tom G. Christensen" <tgc@jupiterrise.com>
Date: Wed, 27 Oct 2021 20:38:52 +0200
Subject: [PATCH 2/6] Include <sys/atomic.h> directly on Solaris
Only Solaris 10 has <atomic.h> and it is only a wrapper around
<sys/atomic.h>.
---
crypto/threads_pthread.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/crypto/threads_pthread.c b/crypto/threads_pthread.c
index 9f00d8be5e..2792f82684 100644
--- a/crypto/threads_pthread.c
+++ b/crypto/threads_pthread.c
@@ -13,8 +13,8 @@
#include <openssl/crypto.h>
#include "internal/cryptlib.h"
-#if defined(__sun)
-# include <atomic.h>
+#if defined(__sun) || defined (sun)
+# include <sys/atomic.h>
#endif
#if defined(OPENSSL_THREADS) && !defined(CRYPTO_TDEBUG) && !defined(OPENSSL_SYS_WINDOWS)
--
2.27.0

View File

@@ -0,0 +1,27 @@
From 6266f902d2e12987812060db6fad106e1614dc13 Mon Sep 17 00:00:00 2001
From: "Tom G. Christensen" <tgc@jupiterrise.com>
Date: Wed, 27 Oct 2021 20:48:25 +0200
Subject: [PATCH 3/6] Provide socklen_t on Solaris 2.6
---
crypto/bio/bio_local.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/crypto/bio/bio_local.h b/crypto/bio/bio_local.h
index 749e8f810c..f1c9aa9473 100644
--- a/crypto/bio/bio_local.h
+++ b/crypto/bio/bio_local.h
@@ -141,6 +141,10 @@ struct bio_st {
typedef unsigned int socklen_t;
# endif
+# if !defined(socklen_t) && ((defined(sun) || defined(__sun)))
+typedef size_t socklen_t;
+# endif
+
extern CRYPTO_RWLOCK *bio_lookup_lock;
int BIO_ADDR_make(BIO_ADDR *ap, const struct sockaddr *sa);
--
2.27.0

View File

@@ -0,0 +1,36 @@
From 6abfca6f0805c0c3e9b6bd0e7298ce01962f08b8 Mon Sep 17 00:00:00 2001
From: "Tom G. Christensen" <tgc@jupiterrise.com>
Date: Wed, 27 Oct 2021 20:52:24 +0200
Subject: [PATCH 4/6] Fix build with posix95 pthreads
Solaris 2.6 only conforms to POSIX.1c pthreads which has no mutex
attribute support.
---
crypto/threads_pthread.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/crypto/threads_pthread.c b/crypto/threads_pthread.c
index 2792f82684..31005ad4c3 100644
--- a/crypto/threads_pthread.c
+++ b/crypto/threads_pthread.c
@@ -58,10 +58,14 @@ CRYPTO_RWLOCK *CRYPTO_THREAD_lock_new(void)
*/
pthread_mutexattr_init(&attr);
# if !defined (__TANDEM) && !defined (_SPT_MODEL_)
-# if !defined(NDEBUG) && !defined(OPENSSL_NO_MUTEX_ERRORCHECK)
- pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK);
+# if defined(PTHREAD_MUTEX_NORMAL)
+# if !defined(NDEBUG) && !defined(OPENSSL_NO_MUTEX_ERRORCHECK)
+ pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK);
+# else
+ pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_NORMAL);
+# endif
# else
- pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_NORMAL);
+ /* Assume POSIX.1c threads with no MUTEX type attribute. */
# endif
# else
/* The SPT Thread Library does not define MUTEX attributes. */
--
2.27.0

View File

@@ -0,0 +1,29 @@
From da14a764a1a533bb6043fa9e682256fe6c02772f Mon Sep 17 00:00:00 2001
From: "Tom G. Christensen" <tgc@jupiterrise.com>
Date: Wed, 27 Oct 2021 21:33:59 +0200
Subject: [PATCH 5/6] Handle missing <stdint.h> on older Solaris
Basically we assume that if we are on a Solaris platform with gcc older
than 4.5 then <stdint.h> is not available.
If gcc >= 4.5 then either gcc or the platform will provide <stdint.h>.
---
include/openssl/e_os2.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/include/openssl/e_os2.h b/include/openssl/e_os2.h
index 6728909271..a0b68bb376 100644
--- a/include/openssl/e_os2.h
+++ b/include/openssl/e_os2.h
@@ -235,6 +235,9 @@ typedef UINT64 uint64_t;
# undef OPENSSL_NO_INTTYPES_H
/* Because the specs say that inttypes.h includes stdint.h if present */
# undef OPENSSL_NO_STDINT_H
+# elif (defined(sun) || defined(__sun)) && (defined(__GNUC__) && ((__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)))
+# include <inttypes.h>
+# undef OPENSSL_NO_INTTYPES_H
# elif defined(_MSC_VER) && _MSC_VER<1600
/*
* minimally required typdefs for systems not supporting inttypes.h or
--
2.27.0

View File

@@ -0,0 +1,25 @@
From 749b94c6b91e1abdbd7acb816ac901336c81a911 Mon Sep 17 00:00:00 2001
From: "Tom G. Christensen" <tgc@jupiterrise.com>
Date: Thu, 28 Oct 2021 21:33:49 +0200
Subject: [PATCH 6/6] Handle missing strtoumax
---
test/params_conversion_test.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/params_conversion_test.c b/test/params_conversion_test.c
index 9422ef1473..300899f861 100644
--- a/test/params_conversion_test.c
+++ b/test/params_conversion_test.c
@@ -19,7 +19,7 @@
# define strcasecmp _stricmp
# endif
-# ifdef OPENSSL_SYS_VMS
+# if defined(OPENSSL_SYS_VMS) || !defined(strtoumax)
# define strtoumax strtoull
# define strtoimax strtoll
# endif
--
2.27.0