mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-10-21 20:19:33 +00:00
python3-m2crypto: add SWIG py2/py3 C-API compat patch
_rsa.i, _lib.i and _ec.i use the Python 2 C-API names PyInt_AsLong, PyInt_FromLong and PyString_FromString. Python 3.14 no longer ships any fallback definitions for them, so the generated _m2crypto_wrap.c fails to compile: src/SWIG/_m2crypto_wrap.c:4895:21: error: call to undeclared function 'PyInt_AsLong' src/SWIG/_m2crypto_wrap.c:9842:26: error: call to undeclared function 'PyString_FromString' Add a patch mapping them to their Python 3 equivalents in the shared raw-C block emitted ahead of the %include'd modules that use them. Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
This commit is contained in:
2 files changed
+42
No files matched your search
+41
@@ -0,0 +1,41 @@
|
|||||||
|
From: Khem Raj <khem.raj@oss.qualcomm.com>
|
||||||
|
Subject: _m2crypto.i: add py2/py3 C-API compat macros
|
||||||
|
|
||||||
|
_rsa.i, _lib.i and _ec.i use the Python 2 C-API names PyInt_AsLong,
|
||||||
|
PyInt_FromLong and PyString_FromString. Python 3.14 no longer ships
|
||||||
|
any fallback definitions for them, so the generated _m2crypto_wrap.c
|
||||||
|
fails to compile:
|
||||||
|
|
||||||
|
src/SWIG/_m2crypto_wrap.c:4895:21: error: call to undeclared function 'PyInt_AsLong'
|
||||||
|
src/SWIG/_m2crypto_wrap.c:9842:26: error: call to undeclared function 'PyString_FromString'
|
||||||
|
|
||||||
|
Map them to their Python 3 equivalents in the shared raw-C block that
|
||||||
|
is emitted ahead of the %include'd modules that use them.
|
||||||
|
|
||||||
|
Upstream-Status: Pending
|
||||||
|
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
|
||||||
|
---
|
||||||
|
--- a/src/SWIG/_m2crypto.i
|
||||||
|
+++ b/src/SWIG/_m2crypto.i
|
||||||
|
@@ -64,6 +64,21 @@
|
||||||
|
static PyObject *x509_store_verify_cb_func;
|
||||||
|
%}
|
||||||
|
|
||||||
|
+%{
|
||||||
|
+#ifndef PyInt_Check
|
||||||
|
+#define PyInt_Check(x) PyLong_Check(x)
|
||||||
|
+#endif
|
||||||
|
+#ifndef PyInt_AsLong
|
||||||
|
+#define PyInt_AsLong(x) PyLong_AsLong(x)
|
||||||
|
+#endif
|
||||||
|
+#ifndef PyInt_FromLong
|
||||||
|
+#define PyInt_FromLong(x) PyLong_FromLong(x)
|
||||||
|
+#endif
|
||||||
|
+#ifndef PyString_FromString
|
||||||
|
+#define PyString_FromString(x) PyUnicode_FromString(x)
|
||||||
|
+#endif
|
||||||
|
+%}
|
||||||
|
+
|
||||||
|
%include <openssl/opensslv.h>
|
||||||
|
|
||||||
|
/* Bring in STACK_OF macro definition */
|
||||||
@@ -7,6 +7,7 @@ LIC_FILES_CHKSUM = "file://LICENSES/BSD-2-Clause.txt;md5=8099b0e569f862ece05740a
|
|||||||
SRC_URI[sha256sum] = "178e290f558ddf0379aaefd34c0a8ddb21f21502594e588f928dda85f1ad202b"
|
SRC_URI[sha256sum] = "178e290f558ddf0379aaefd34c0a8ddb21f21502594e588f928dda85f1ad202b"
|
||||||
|
|
||||||
SRC_URI += "file://0001-setup.py-Make-the-cmd-available.patch"
|
SRC_URI += "file://0001-setup.py-Make-the-cmd-available.patch"
|
||||||
|
SRC_URI += "file://0002-_m2crypto.i-add-py2-py3-C-API-compat-macros.patch"
|
||||||
|
|
||||||
CVE_STATUS[CVE-2009-0127] = "disputed: upstream claims there is no bug"
|
CVE_STATUS[CVE-2009-0127] = "disputed: upstream claims there is no bug"
|
||||||
CVE_STATUS[CVE-2020-25657] = "fixed-version: the used version (0.46.2) contains the fix already"
|
CVE_STATUS[CVE-2020-25657] = "fixed-version: the used version (0.46.2) contains the fix already"
|
||||||
|
|||||||
Reference in new issue
Block a user