Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Meta python merge #477

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ RDEPENDS:packagegroup-meta-python3 = "\
python3-pytoml \
python3-pytun \
python3-pytz \
python3-pytz-deprecation-shim \
python3-pyudev \
python3-pyusb \
python3-pywbem \
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
Encourage our old python3-cryptography to at least start to work with OpenSSL 3.

- Backport one patch to err.py to remove a symbol which has been removed in
OpenSSL 3, and isn't used in python3-cryptography.
(50ec692749b7e2e62685b443f5e629627b03987e)

- Backport the detection of OpenSSL 3 and don't link to FIPS_mode/FIPS_mode_set
(parts of f08a7de651f9e6475c8c0a67d2a61ed8b669ddf6)

This is *not* a complete backport of the 3.0 support, but is enough that packages
such as imgtool can import python3-cryptography and operate until the upgrade is
ready.

Upstream-Status: Inappropriate
Signed-off-by: Ross Burton <ross.burton@arm.com>

diff --git a/src/_cffi_src/openssl/cryptography.py b/src/_cffi_src/openssl/cryptography.py
index f24bee5a..920a86de 100644
--- a/src/_cffi_src/openssl/cryptography.py
+++ b/src/_cffi_src/openssl/cryptography.py
@@ -35,6 +35,8 @@ INCLUDES = """

#define CRYPTOGRAPHY_OPENSSL_110F_OR_GREATER \
(OPENSSL_VERSION_NUMBER >= 0x1010006f && !CRYPTOGRAPHY_IS_LIBRESSL)
+#define CRYPTOGRAPHY_OPENSSL_300_OR_GREATER \
+ (OPENSSL_VERSION_NUMBER >= 0x30000000 && !CRYPTOGRAPHY_IS_LIBRESSL)

#define CRYPTOGRAPHY_OPENSSL_LESS_THAN_110J \
(OPENSSL_VERSION_NUMBER < 0x101000af || CRYPTOGRAPHY_IS_LIBRESSL)
@@ -54,6 +56,7 @@ INCLUDES = """

TYPES = """
static const int CRYPTOGRAPHY_OPENSSL_110F_OR_GREATER;
+static const int CRYPTOGRAPHY_OPENSSL_300_OR_GREATER;

static const int CRYPTOGRAPHY_OPENSSL_LESS_THAN_111;
static const int CRYPTOGRAPHY_OPENSSL_LESS_THAN_111B;
diff --git a/src/_cffi_src/openssl/err.py b/src/_cffi_src/openssl/err.py
index 0dd74146..42bab4d9 100644
--- a/src/_cffi_src/openssl/err.py
+++ b/src/_cffi_src/openssl/err.py
@@ -40,7 +40,6 @@ void ERR_clear_error(void);
void ERR_put_error(int, int, int, const char *, int);

int ERR_GET_LIB(unsigned long);
-int ERR_GET_FUNC(unsigned long);
int ERR_GET_REASON(unsigned long);

"""
diff --git a/src/_cffi_src/openssl/fips.py b/src/_cffi_src/openssl/fips.py
index c92bca49..38bfa231 100644
--- a/src/_cffi_src/openssl/fips.py
+++ b/src/_cffi_src/openssl/fips.py
@@ -18,7 +18,7 @@ int FIPS_mode(void);
"""

CUSTOMIZATIONS = """
-#if CRYPTOGRAPHY_IS_LIBRESSL
+#if CRYPTOGRAPHY_IS_LIBRESSL || CRYPTOGRAPHY_OPENSSL_300_OR_GREATER
static const long Cryptography_HAS_FIPS = 0;
int (*FIPS_mode_set)(int) = NULL;
int (*FIPS_mode)(void) = NULL;
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ SRC_URI[sha256sum] = "5a60d3780149e13b7a6ff7ad6526b38846354d11a15e21068e57073e29
SRC_URI += " \
file://run-ptest \
file://h-test.patch \
file://openssl3.patch \
"

inherit pypi setuptools3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ LICENSE = "BSD-2-Clause"
LIC_FILES_CHKSUM = "file://LICENSE;md5=7b9bbbb543b6af3e6b53f9b7fb68f71d"


SRC_URI[sha256sum] = "1fbf909bac3f07faabd05a3f71b3c49428709c3c55f43770a3f76e0eb1b525d1"
SRC_URI[sha256sum] = "469c59fe71c81cdc41c84f842d62dd2739a08fac8cb85f5a518a92a6227e2ed6"

inherit pypi setuptools3

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ HOMEPAGE = "http://code.google.com/p/prettytable"
LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://COPYING;md5=c9a6829fcd174d9535b46211917c7671"

SRC_URI[sha256sum] = "efd6f72d453bc0513b90f5b10fb4d085b919ca0f4c5ef033bda1dd894572ba64"
SRC_URI[sha256sum] = "18e56447f636b447096977d468849c1e2d3cfa0af8e7b5acfcf83a64790c0aca"

do_install:append() {
perm_files=`find "${D}${PYTHON_SITEPACKAGES_DIR}/" -name "*.txt" -o -name "PKG-INFO"`
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
SUMMARY = "Shims to help you safely remove pytz"
HOMEPAGE = "https://github.com/pganssle/pytz-deprecation-shim"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=fca9fd5c15a28eb874ba38577a585d48"

SRC_URI[sha256sum] = "af097bae1b616dde5c5744441e2ddc69e74dfdcb0c263129610d85b87445a59d"

PYPI_PACKAGE = "pytz_deprecation_shim"
PYPI_SRC_URI = "https://files.pythonhosted.org/packages/94/f0/909f94fea74759654390a3e1a9e4e185b6cd9aa810e533e3586f39da3097/${PYPI_PACKAGE}-${PV}.tar.gz"

inherit pypi setuptools3

do_compile:prepend() {
echo "from setuptools import setup" > ${S}/setup.py
echo "setup()" >> ${S}/setup.py
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,18 @@ HOMEPAGE = "https://github.com/facelessuser/soupsieve"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE.md;md5=33c3a77def9b3ad83e01c65bdcc1af67"

SRC_URI[sha256sum] = "052774848f448cf19c7e959adf5566904d525f33a3f8b6ba6f6f8f26ec7de0cc"
SRC_URI[sha256sum] = "e4860f889dfa88774c07da0b276b70c073b6470fa1a4a8350800bb7bce3dcc76"

inherit pypi setuptools3 ptest

SRC_URI += " \
file://run-ptest \
"

RDEPENDS:${PN} += "\
${PYTHON_PN}-beautifulsoup4 \
"

RDEPENDS:${PN}-ptest += " \
${PYTHON_PN}-pytest \
${PYTHON_PN}-beautifulsoup4 \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ HOMEPAGE = "https://pypi.org/project/tzlocal/"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=57e0bd61643d81d05683cdce65b11d10"

SRC_URI[sha256sum] = "8560aabba61b5d2a5e1697bb781f682e6eaa3ce386cee85a09a458cc0003f836"
SRC_URI[sha256sum] = "0f28015ac68a5c067210400a9197fc5d36ba9bc3f8eaf1da3cbd59acdfed9e09"

inherit pypi setuptools3

RDEPENDS:${PN} += "\
${PYTHON_PN}-pytz-deprecation-shim \
"