Skip to content

Commit

Permalink
Merge pull request #165 from jhnc-oss/backport/dunfell/160-opcuaasyncio
Browse files Browse the repository at this point in the history
Add python3-opcua-asyncio
  • Loading branch information
offa authored Aug 30, 2023
2 parents bcc518c + 0d15812 commit 5d8d738
Show file tree
Hide file tree
Showing 12 changed files with 171 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
From d890e2a60616af098d6ec1d4e4a53cc82a335731 Mon Sep 17 00:00:00 2001
From: Paul Kehrer <paul.l.kehrer@gmail.com>
Date: Thu, 26 Nov 2020 11:52:47 -0600
Subject: [PATCH] define OAEP properties for all openssl versions (#5589)

In 3.0 these aren't macros so we can't test this way. All our supported
OpenSSLs have these bindings now and LibreSSL does not.


This patch can be removed on python3-cryptography >= 3.3. Updated for
2.8 compatibility.

Upstream-Status: Accepted
Signed-off-by: jhnc-oss
---
diff --git a/src/_cffi_src/openssl/rsa.py b/src/_cffi_src/openssl/rsa.py
--- a/src/_cffi_src/openssl/rsa.py
+++ b/src/_cffi_src/openssl/rsa.py
@@ -60,17 +60,13 @@ int EVP_PKEY_CTX_set_rsa_oaep_md(EVP_PKEY_CTX *, EVP_MD *);
CUSTOMIZATIONS = """
static const long Cryptography_HAS_PSS_PADDING = 1;

-#if defined(EVP_PKEY_CTX_set_rsa_oaep_md)
+#if !CRYPTOGRAPHY_IS_LIBRESSL
static const long Cryptography_HAS_RSA_OAEP_MD = 1;
-#else
-static const long Cryptography_HAS_RSA_OAEP_MD = 0;
-int (*EVP_PKEY_CTX_set_rsa_oaep_md)(EVP_PKEY_CTX *, EVP_MD *) = NULL;
-#endif
-
-#if defined(EVP_PKEY_CTX_set0_rsa_oaep_label)
static const long Cryptography_HAS_RSA_OAEP_LABEL = 1;
#else
+static const long Cryptography_HAS_RSA_OAEP_MD = 0;
static const long Cryptography_HAS_RSA_OAEP_LABEL = 0;
+int (*EVP_PKEY_CTX_set_rsa_oaep_md)(EVP_PKEY_CTX *, EVP_MD *) = NULL;
int (*EVP_PKEY_CTX_set0_rsa_oaep_label)(EVP_PKEY_CTX *, unsigned char *,
int) = NULL;
#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
From a13da93e43d2a7e06b345787807a0c689dc3ad85 Mon Sep 17 00:00:00 2001
From: Paul Kehrer <paul.l.kehrer@gmail.com>
Date: Thu, 30 Jul 2020 09:44:31 -0500
Subject: [PATCH] remove some more constants we don't need (#5361)

these are gone in 3.0 anyway and were removed in that draft PR


This patch can be removed on python3-cryptography >= 3.1.

Upstream-Status: Accepted
Signed-off-by: jhnc-oss

---
diff --git a/src/_cffi_src/openssl/crypto.py b/src/_cffi_src/openssl/crypto.py
--- a/src/_cffi_src/openssl/crypto.py
+++ b/src/_cffi_src/openssl/crypto.py
@@ -23,10 +23,6 @@ static const int OPENSSL_CFLAGS;
static const int OPENSSL_BUILT_ON;
static const int OPENSSL_PLATFORM;
static const int OPENSSL_DIR;
-static const int CRYPTO_MEM_CHECK_ON;
-static const int CRYPTO_MEM_CHECK_OFF;
-static const int CRYPTO_MEM_CHECK_ENABLE;
-static const int CRYPTO_MEM_CHECK_DISABLE;
"""

FUNCTIONS = """
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Remove EVP_R_KEYGEN_FAILURE for OpenSSL v3.x compatibility

This patch can be removed on python3-cryptography >= 3.1.

Upstream-Status: Accepted
Signed-off-by: jhnc-oss
---
diff --git a/src/_cffi_src/openssl/err.py b/src/_cffi_src/openssl/err.py
index d4033f5a4..f573bdf3a 100644
--- a/src/_cffi_src/openssl/err.py
+++ b/src/_cffi_src/openssl/err.py
@@ -66,7 +66,6 @@ static const int EVP_R_DIFFERENT_KEY_TYPES;
static const int EVP_R_INITIALIZATION_ERROR;
static const int EVP_R_INPUT_NOT_INITIALIZED;
static const int EVP_R_INVALID_KEY_LENGTH;
-static const int EVP_R_KEYGEN_FAILURE;
static const int EVP_R_MISSING_PARAMETERS;
static const int EVP_R_NO_CIPHER_SET;
static const int EVP_R_NO_DIGEST_SET;
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"

SRC_URI += "\
file://0001-define-OAEP-properties-for-all-openssl-versions.patch \
file://0002-remove-some-more-constants-we-dont-need.patch \
file://0003-openssl3-compatibility.patch \
"
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Index: openssl-3.0.4/Configure
}

-if ($target =~ /linux.*-mips/ && !$disabled{asm}
- && !grep { $_ !~ /-m(ips|arch=)/ } (@{$config{CFLAGS}})) {
- && !grep { $_ =~ /-m(ips|arch=)/ } (@{$config{CFLAGS}})) {
- # minimally required architecture flags for assembly modules
- my $value;
- $value = '-mips2' if ($target =~ /mips32/);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ SRC_URI:append:class-nativesdk = " \
file://environment.d-openssl.sh \
"

SRC_URI[sha256sum] = "6c13d2bf38fdf31eac3ce2a347073673f5d63263398f1f69d0df4a41253e4b3e"
SRC_URI[sha256sum] = "1761d4f5b13a1028b9b6f3d4b8e17feb0cedc9370f6afe61d7193d2cdce83323"

inherit lib_package multilib_header multilib_script ptest perlnative
MULTILIB_SCRIPTS = "${PN}-bin:${bindir}/c_rehash"
Expand Down Expand Up @@ -77,7 +77,7 @@ do_configure () {
esac
target="$os-${HOST_ARCH}"
case $target in
linux-arc)
linux-arc | linux-microblaze*)
target=linux-latomic
;;
linux-arm*)
Expand Down Expand Up @@ -105,7 +105,7 @@ do_configure () {
linux-*-mips64 | linux-mips64 | linux-*-mips64el | linux-mips64el)
target=linux64-mips64
;;
linux-microblaze* | linux-nios2* | linux-sh3 | linux-sh4 | linux-arc*)
linux-nios2* | linux-sh3 | linux-sh4 | linux-arc*)
target=linux-generic32
;;
linux-powerpc)
Expand Down Expand Up @@ -137,7 +137,9 @@ do_configure () {
fi
# WARNING: do not set compiler/linker flags (-I/-D etc.) in EXTRA_OECONF, as they will fully replace the
# environment variables set by bitbake. Adjust the environment variables instead.
HASHBANGPERL="/usr/bin/env perl" PERL=perl PERL5LIB="${S}/external/perl/Text-Template-1.46/lib/" \
PERLEXTERNAL="$(realpath ${S}/external/perl/Text-Template-*/lib)"
test -d "$PERLEXTERNAL" || bberror "PERLEXTERNAL '$PERLEXTERNAL' not found!"
HASHBANGPERL="/usr/bin/env perl" PERL=perl PERL5LIB="$PERLEXTERNAL" \
perl ${S}/Configure ${EXTRA_OECONF} ${PACKAGECONFIG_CONFARGS} ${DEPRECATED_CRYPTO_FLAGS} --prefix=$useprefix --openssldir=${libdir}/ssl-3 --libdir=${libdir} $target
perl ${B}/configdata.pm --dump
}
Expand Down
6 changes: 6 additions & 0 deletions recipes-devtools/python/backport.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,9 @@ Available with *openembedded-core kirkstone (Yocto Project 4.0)*.

Upstream revision: `0ad97879bb13d542d5b475376805af87cdeb6837`


## python3-sortedcontainers

Available with *openembedded-core kirkstone (Yocto Project 4.0)*.

Upstream revision: `c8c4e324eccc816432381d61b94c6ec13e25d634`
9 changes: 9 additions & 0 deletions recipes-devtools/python/python3-sortedcontainers_2.4.0.bb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
SUMMARY = "Sorted Containers is an Apache2 licensed sorted collections library, written in pure-Python, and fast as C-extensions."
HOMEPAGE = "http://www.grantjenks.com/docs/sortedcontainers/"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=7c7c6a1a12ec816da16c1839137d53ae"

inherit pypi setuptools3
SRC_URI[sha256sum] = "25caa5a06cc30b6b83d11423433f65d1f9d76c4c6a0c90e3379eaa43b9bfdb88"

BBCLASSEXTEND = "native nativesdk"
10 changes: 10 additions & 0 deletions recipes-devtools/python3-aiosqlite/python3-aiosqlite.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
SUMMARY = "asyncio bridge to the standard sqlite3 module "
DESCRIPTION = "aiosqlite provides a friendly, async interface to sqlite databases."
AUTHOR = "omnilib"
HOMEPAGE = "https://github.com/omnilib/aiosqlite"
BUGTRACKER = "https://github.com/omnilib/aiosqlite/issues"
SECTION = "development"
LICENSE = "MIT"

CVE_PRODUCT = ""

16 changes: 16 additions & 0 deletions recipes-devtools/python3-aiosqlite/python3-aiosqlite_0.19.0.bb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
require ${PN}.inc

LIC_FILES_CHKSUM = "file://LICENSE;md5=f0c422eaa1f23d09f8203dc0af3e2d54"

SRC_URI[sha256sum] = "95ee77b91c8d2808bd08a59fbebf66270e9090c3d92ffbf260dc0db0b979577d"

PYPI_PACKAGE = "aiosqlite"

inherit pypi setuptools3

RDEPENDS:${PN} += "\
python3-typing-extensions \
"

BBCLASSEXTEND = "native nativesdk"

10 changes: 10 additions & 0 deletions recipes-devtools/python3-opcua-asyncio/python3-opcua-asyncio.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
SUMMARY = "OPC UA library for python"
DESCRIPTION = "OPC UA / IEC 62541 Client and Server for Python"
AUTHOR = "FreeOpcUa"
HOMEPAGE = "https://github.com/FreeOpcUa/opcua-asyncio"
BUGTRACKER = "https://github.com/FreeOpcUa/opcua-asyncio/issues"
SECTION = "development"
LICENSE = "LGPLv3+"

CVE_PRODUCT = ""

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
require ${PN}.inc

LIC_FILES_CHKSUM = "file://COPYING;md5=e6a600fd5e1d9cbde2d983680233ad02"

SRC_URI[sha256sum] = "581a5f4d32e65959105d907c82cec3c4ab98ef82230a2ca1778ca58f1a3b1d45"

PYPI_PACKAGE = "asyncua"

inherit pypi setuptools3

RDEPENDS:${PN} += "\
python3-aiofiles \
python3-aiosqlite \
python3-cryptography \
python3-dateutil \
python3-pytz \
python3-sortedcontainers \
"

BBCLASSEXTEND = "native nativesdk"

0 comments on commit 5d8d738

Please sign in to comment.