Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master grimoire by Ismael Luceno (084482dc7811f726c06284499cdaed1cfecece3a)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Ismael Luceno <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master grimoire by Ismael Luceno (084482dc7811f726c06284499cdaed1cfecece3a)
  • Date: Thu, 15 Sep 2022 23:34:47 +0000

GIT changes to master grimoire by Ismael Luceno <ismael AT sourcemage.org>:

devel/python3/DETAILS | 2
devel/python3/HISTORY | 7
devel/python3/PRE_BUILD | 3
devel/python3/patches-3.10-libressl/hashopenssl.patch | 47 -----
devel/python3/patches-3.10-libressl/ssl.patch | 27 ---
devel/python3/patches-3.10/0001-Fix-build-against-LibreSSL.patch | 84
++++++++++
6 files changed, 90 insertions(+), 80 deletions(-)

New commits:
commit 084482dc7811f726c06284499cdaed1cfecece3a
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>

python3: Fix build against LibreSSL; PATCHLEVEL++

commit 582345a4eadc91cd15619a1d7237d7242532e9ed
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>

Revert "devel/python3: added OpenBSD libressl patches for python 3.10"

This reverts commit 397a65d5ecedbf1e1cb4355ad2ec8b69ab42b65c.

diff --git a/devel/python3/DETAILS b/devel/python3/DETAILS
index a4bcaf4..10f08c2 100755
--- a/devel/python3/DETAILS
+++ b/devel/python3/DETAILS
@@ -14,7 +14,7 @@ case "$PYTHON3_BRANCH" in
VERSION=3.6.10 ;;
esac
SECURITY_PATCH=19
- PATCHLEVEL=1
+ PATCHLEVEL=2
SOURCE=Python-$VERSION.tar.xz
SOURCE2=$SOURCE.asc
SOURCE_DIRECTORY="$BUILD_DIRECTORY/Python-$VERSION"
diff --git a/devel/python3/HISTORY b/devel/python3/HISTORY
index ac8e7e5..8fbd3c8 100644
--- a/devel/python3/HISTORY
+++ b/devel/python3/HISTORY
@@ -1,6 +1,7 @@
-2022-09-15 Pavel Vinogradov <public AT sourcemage.org>
- * PRE_BUILD, patches-3.10-libressl{hashopenssl,ssl}.patch: added
OpenBSD
- libressl patches for python 3.10
+2022-09-15 Ismael Luceno <ismael AT sourcemage.org>
+ * patches-3.10/0001-Fix-build-against-LibreSSL.patch:
+ fixed build against LibreSSL
+ * DETAILS: PATCHLEVEL++

2022-09-07 Ismael Luceno <ismael AT sourcemage.org>
* INSTALL: added python3-embed pkgconfig alias
diff --git a/devel/python3/PRE_BUILD b/devel/python3/PRE_BUILD
index 3059019..63d1dad 100755
--- a/devel/python3/PRE_BUILD
+++ b/devel/python3/PRE_BUILD
@@ -3,5 +3,4 @@ cd "$SOURCE_DIRECTORY" &&
case "$VERSION" in 3.[67].*)
apply_patch_dir patches ;;
esac &&
-apply_patch_dir "patches-${VERSION%.*}" &&
-apply_patch_dir "patches-${VERSION%.*}-$(get_spell_provider ${SPELL} SSL)"
+apply_patch_dir "patches-${VERSION%.*}"
diff --git a/devel/python3/patches-3.10-libressl/hashopenssl.patch
b/devel/python3/patches-3.10-libressl/hashopenssl.patch
deleted file mode 100644
index 03f1795..0000000
--- a/devel/python3/patches-3.10-libressl/hashopenssl.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-Index: Modules/_hashopenssl.c
---- a/Modules/_hashopenssl.c
-+++ b/Modules/_hashopenssl.c
-@@ -45,11 +45,6 @@
-
- #define MUNCH_SIZE INT_MAX
-
--#define PY_OPENSSL_HAS_SCRYPT 1
--#define PY_OPENSSL_HAS_SHA3 1
--#define PY_OPENSSL_HAS_SHAKE 1
--#define PY_OPENSSL_HAS_BLAKE2 1
--
- #if OPENSSL_VERSION_NUMBER >= 0x30000000L
- #define PY_EVP_MD EVP_MD
- #define PY_EVP_MD_fetch(algorithm, properties) EVP_MD_fetch(NULL,
algorithm, properties)
-@@ -119,6 +114,7 @@ static const py_hashentry_t py_hashes[] = {
- PY_HASH_ENTRY(Py_hash_sha256, "SHA256", SN_sha256, NID_sha256),
- PY_HASH_ENTRY(Py_hash_sha384, "SHA384", SN_sha384, NID_sha384),
- PY_HASH_ENTRY(Py_hash_sha512, "SHA512", SN_sha512, NID_sha512),
-+#if !defined(LIBRESSL_VERSION_NUMBER)
- /* truncated sha2 */
- PY_HASH_ENTRY(Py_hash_sha512_224, "SHA512_224", SN_sha512_224,
NID_sha512_224),
- PY_HASH_ENTRY(Py_hash_sha512_256, "SHA512_256", SN_sha512_256,
NID_sha512_256),
-@@ -133,6 +129,7 @@ static const py_hashentry_t py_hashes[] = {
- /* blake2 digest */
- PY_HASH_ENTRY(Py_hash_blake2s, "blake2s256", SN_blake2s256,
NID_blake2s256),
- PY_HASH_ENTRY(Py_hash_blake2b, "blake2b512", SN_blake2b512,
NID_blake2b512),
-+#endif
- PY_HASH_ENTRY(NULL, NULL, NULL, 0),
- };
-
-@@ -873,11 +870,15 @@ py_evp_fromname(PyObject *module, const char *digestna
- goto exit;
- }
-
-+#if defined(LIBRESSL_VERSION_NUMBER)
-+ type = get_hashlib_state(module)->EVPtype;
-+#else
- if ((EVP_MD_flags(digest) & EVP_MD_FLAG_XOF) == EVP_MD_FLAG_XOF) {
- type = get_hashlib_state(module)->EVPXOFtype;
- } else {
- type = get_hashlib_state(module)->EVPtype;
- }
-+#endif
-
- self = newEVPobject(type);
- if (self == NULL) {
diff --git a/devel/python3/patches-3.10-libressl/ssl.patch
b/devel/python3/patches-3.10-libressl/ssl.patch
deleted file mode 100644
index d811481..0000000
--- a/devel/python3/patches-3.10-libressl/ssl.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-Neuter security level things until LibreSSL supports them.
-
-Index: Modules/_ssl.c
---- a/Modules/_ssl.c
-+++ b/Modules/_ssl.c
-@@ -169,7 +169,7 @@ extern const SSL_METHOD *TLSv1_2_method(void);
- * Based on Hynek's excellent blog post (update 2021-02-11)
- * https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/
- */
-- #define PY_SSL_DEFAULT_CIPHER_STRING
"@SECLEVEL=2:ECDH+AESGCM:ECDH+CHACHA20:ECDH+AES:DHE+AES:!aNULL:!eNULL:!aDSS:!SHA1:!AESCCM"
-+ #define PY_SSL_DEFAULT_CIPHER_STRING
"ECDH+AESGCM:ECDH+CHACHA20:ECDH+AES:DHE+AES:!aNULL:!eNULL:!aDSS:!SHA1:!AESCCM"
- #ifndef PY_SSL_MIN_PROTOCOL
- #define PY_SSL_MIN_PROTOCOL TLS1_2_VERSION
- #endif
-@@ -3579,6 +3579,12 @@ set_num_tickets(PySSLContext *self, PyObject *arg, voi
- PyDoc_STRVAR(PySSLContext_num_tickets_doc,
- "Control the number of TLSv1.3 session tickets");
- #endif /* TLS1_3_VERSION */
-+
-+int
-+SSL_CTX_get_security_level(const SSL_CTX *ctx)
-+{
-+ return 1;
-+}
-
- static PyObject *
- get_security_level(PySSLContext *self, void *c)
diff --git a/devel/python3/patches-3.10/0001-Fix-build-against-LibreSSL.patch
b/devel/python3/patches-3.10/0001-Fix-build-against-LibreSSL.patch
new file mode 100644
index 0000000..886919a
--- /dev/null
+++ b/devel/python3/patches-3.10/0001-Fix-build-against-LibreSSL.patch
@@ -0,0 +1,84 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Ismael Luceno <ismael AT iodev.co.uk>
+Subject: Fix build against LibreSSL
+Date: Thu, 15 Sep 2022 22:10:54 +0200
+
+Based on patches from OpenBSD.
+
+Upstream-Status: Inappropriate
+Signed-off-by: Ismael Luceno <ismael AT iodev.co.uk>
+---
+ Modules/_hashopenssl.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+--- a/Modules/_hashopenssl.c
++++ b/Modules/_hashopenssl.c
+@@ -45,11 +45,13 @@
+
+ #define MUNCH_SIZE INT_MAX
+
++#if !defined(LIBRESSL_VERSION_NUMBER)
+ #define PY_OPENSSL_HAS_SCRYPT 1
+ #define PY_OPENSSL_HAS_SHA3 1
+ #define PY_OPENSSL_HAS_SHAKE 1
+ #define PY_OPENSSL_HAS_BLAKE2 1
++#endif
+
+ #if OPENSSL_VERSION_NUMBER >= 0x30000000L
+ #define PY_EVP_MD EVP_MD
+ #define PY_EVP_MD_fetch(algorithm, properties) EVP_MD_fetch(NULL,
algorithm, properties)
+@@ -119,6 +114,7 @@ static const py_hashentry_t py_hashes[] = {
+ PY_HASH_ENTRY(Py_hash_sha256, "SHA256", SN_sha256, NID_sha256),
+ PY_HASH_ENTRY(Py_hash_sha384, "SHA384", SN_sha384, NID_sha384),
+ PY_HASH_ENTRY(Py_hash_sha512, "SHA512", SN_sha512, NID_sha512),
++#if !defined(LIBRESSL_VERSION_NUMBER)
+ /* truncated sha2 */
+ PY_HASH_ENTRY(Py_hash_sha512_224, "SHA512_224", SN_sha512_224,
NID_sha512_224),
+ PY_HASH_ENTRY(Py_hash_sha512_256, "SHA512_256", SN_sha512_256,
NID_sha512_256),
+@@ -133,6 +129,7 @@ static const py_hashentry_t py_hashes[] = {
+ /* blake2 digest */
+ PY_HASH_ENTRY(Py_hash_blake2s, "blake2s256", SN_blake2s256,
NID_blake2s256),
+ PY_HASH_ENTRY(Py_hash_blake2b, "blake2b512", SN_blake2b512,
NID_blake2b512),
++#endif
+ PY_HASH_ENTRY(NULL, NULL, NULL, 0),
+ };
+
+@@ -873,9 +870,12 @@ py_evp_fromname(PyObject *module, const char *digestna
+ goto exit;
+ }
+
++#if !defined(LIBRESSL_VERSION_NUMBER)
+ if ((EVP_MD_flags(digest) & EVP_MD_FLAG_XOF) == EVP_MD_FLAG_XOF) {
+ type = get_hashlib_state(module)->EVPXOFtype;
+- } else {
++ } else
++#endif
++ {
+ type = get_hashlib_state(module)->EVPtype;
+ }
+
+--- a/Modules/_ssl.c
++++ b/Modules/_ssl.c
+@@ -169,7 +169,11 @@ extern const SSL_METHOD *TLSv1_2_method(void);
+ * Based on Hynek's excellent blog post (update 2021-02-11)
+ * https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/
+ */
++ #if defined(LIBRESSL_VERSION_NUMBER) && (LIBRESSL_VERSION_NUMBER <=
0x3050300fL)
++ #define PY_SSL_DEFAULT_CIPHER_STRING
"ECDH+AESGCM:ECDH+CHACHA20:ECDH+AES:DHE+AES:!aNULL:!eNULL:!aDSS:!SHA1:!AESCCM"
++ #else
+ #define PY_SSL_DEFAULT_CIPHER_STRING
"@SECLEVEL=2:ECDH+AESGCM:ECDH+CHACHA20:ECDH+AES:DHE+AES:!aNULL:!eNULL:!aDSS:!SHA1:!AESCCM"
++ #endif
+ #ifndef PY_SSL_MIN_PROTOCOL
+ #define PY_SSL_MIN_PROTOCOL TLS1_2_VERSION
+ #endif
+@@ -3579,6 +3579,10 @@ set_num_tickets(PySSLContext *self, PyObject *arg, voi
+ PyDoc_STRVAR(PySSLContext_num_tickets_doc,
+ "Control the number of TLSv1.3 session tickets");
+ #endif /* TLS1_3_VERSION */
++
++#if defined(LIBRESSL_VERSION_NUMBER) && (LIBRESSL_VERSION_NUMBER <=
0x3050300fL)
++static inline int SSL_CTX_get_security_level(const SSL_CTX *ctx) { return
1; }
++#endif
+
+ static PyObject *
+ get_security_level(PySSLContext *self, void *c)



  • [SM-Commit] GIT changes to master grimoire by Ismael Luceno (084482dc7811f726c06284499cdaed1cfecece3a), Ismael Luceno, 09/15/2022

Archive powered by MHonArc 2.6.24.

Top of Page