Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c3ec9701b3 | |||
| 13133b2168 |
2
.gitignore
vendored
2
.gitignore
vendored
@ -1 +1 @@
|
|||||||
SOURCES/awscrt-0.20.2.tar.gz
|
SOURCES/awscrt-0.27.2.tar.gz
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
3b76a63f106d4ddb6a27198f935405aa82c43585 SOURCES/awscrt-0.20.2.tar.gz
|
9951436161fdbf91db142b85d6aa208614dc2b0b SOURCES/awscrt-0.27.2.tar.gz
|
||||||
|
|||||||
36
SOURCES/der-c.patch
Normal file
36
SOURCES/der-c.patch
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
--- a/crt/aws-c-cal/source/der.c 2025-08-29 10:43:04.487705098 +0100
|
||||||
|
+++ B/crt/aws-c-cal/source/der.c 2025-08-29 14:27:00.649373755 +0100
|
||||||
|
@@ -80,21 +80,28 @@
|
||||||
|
if (len_bytes & 0x80) {
|
||||||
|
len_bytes &= 0x7f;
|
||||||
|
switch (len_bytes) {
|
||||||
|
- case 1:
|
||||||
|
- if (!aws_byte_cursor_read_u8(cur, (uint8_t *)&len)) {
|
||||||
|
+ case 1: {
|
||||||
|
+ uint8_t len8;
|
||||||
|
+ if (!aws_byte_cursor_read_u8(cur, &len8)) {
|
||||||
|
return aws_raise_error(AWS_ERROR_CAL_MALFORMED_ASN1_ENCOUNTERED);
|
||||||
|
}
|
||||||
|
+ len = len8;
|
||||||
|
break;
|
||||||
|
- case 2:
|
||||||
|
- if (!aws_byte_cursor_read_be16(cur, (uint16_t *)&len)) {
|
||||||
|
+ }
|
||||||
|
+ case 2: {
|
||||||
|
+ uint16_t len16;
|
||||||
|
+ if (!aws_byte_cursor_read_be16(cur, &len16)) {
|
||||||
|
return aws_raise_error(AWS_ERROR_CAL_MALFORMED_ASN1_ENCOUNTERED);
|
||||||
|
}
|
||||||
|
+ len = len16;
|
||||||
|
break;
|
||||||
|
- case 4:
|
||||||
|
+ }
|
||||||
|
+ case 4: {
|
||||||
|
if (!aws_byte_cursor_read_be32(cur, &len)) {
|
||||||
|
return aws_raise_error(AWS_ERROR_CAL_MALFORMED_ASN1_ENCOUNTERED);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
+ }
|
||||||
|
default:
|
||||||
|
return aws_raise_error(AWS_ERROR_CAL_MALFORMED_ASN1_ENCOUNTERED);
|
||||||
|
}
|
||||||
1750
SOURCES/pkcs11.h
1750
SOURCES/pkcs11.h
File diff suppressed because it is too large
Load Diff
58
SOURCES/skip-SHA1-in-test_crypto.patch
Normal file
58
SOURCES/skip-SHA1-in-test_crypto.patch
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
diff --git a/test/test_crypto.py b/test/test_crypto.py
|
||||||
|
index 628900f..7f2296d 100644
|
||||||
|
--- a/test/test_crypto.py
|
||||||
|
+++ b/test/test_crypto.py
|
||||||
|
@@ -236,15 +236,11 @@ class TestCredentials(NativeResourceTest):
|
||||||
|
|
||||||
|
def test_rsa_signing_roundtrip(self):
|
||||||
|
param_list = [RSASignatureAlgorithm.PKCS1_5_SHA256,
|
||||||
|
- RSASignatureAlgorithm.PSS_SHA256,
|
||||||
|
- RSASignatureAlgorithm.PKCS1_5_SHA1]
|
||||||
|
+ RSASignatureAlgorithm.PSS_SHA256]
|
||||||
|
|
||||||
|
for p in param_list:
|
||||||
|
with self.subTest(msg="RSA Signing Roundtrip using algo p", p=p):
|
||||||
|
- if (p == RSASignatureAlgorithm.PKCS1_5_SHA1):
|
||||||
|
- h = Hash.sha1_new()
|
||||||
|
- else:
|
||||||
|
- h = Hash.sha256_new()
|
||||||
|
+ h = Hash.sha256_new()
|
||||||
|
h.update(b'totally original test string')
|
||||||
|
digest = h.digest()
|
||||||
|
|
||||||
|
@@ -257,15 +253,11 @@ class TestCredentials(NativeResourceTest):
|
||||||
|
|
||||||
|
def test_rsa_signing_roundtrip_pkcs8(self):
|
||||||
|
param_list = [RSASignatureAlgorithm.PKCS1_5_SHA256,
|
||||||
|
- RSASignatureAlgorithm.PSS_SHA256,
|
||||||
|
- RSASignatureAlgorithm.PKCS1_5_SHA1]
|
||||||
|
+ RSASignatureAlgorithm.PSS_SHA256]
|
||||||
|
|
||||||
|
for p in param_list:
|
||||||
|
with self.subTest(msg="RSA Signing Roundtrip using algo p", p=p):
|
||||||
|
- if (p == RSASignatureAlgorithm.PKCS1_5_SHA1):
|
||||||
|
- h = Hash.sha1_new()
|
||||||
|
- else:
|
||||||
|
- h = Hash.sha256_new()
|
||||||
|
+ h = Hash.sha256_new()
|
||||||
|
h.update(b'totally original test string')
|
||||||
|
digest = h.digest()
|
||||||
|
|
||||||
|
@@ -275,15 +267,11 @@ class TestCredentials(NativeResourceTest):
|
||||||
|
|
||||||
|
def test_rsa_signing_roundtrip_der(self):
|
||||||
|
param_list = [RSASignatureAlgorithm.PKCS1_5_SHA256,
|
||||||
|
- RSASignatureAlgorithm.PSS_SHA256,
|
||||||
|
- RSASignatureAlgorithm.PKCS1_5_SHA1]
|
||||||
|
+ RSASignatureAlgorithm.PSS_SHA256]
|
||||||
|
|
||||||
|
for p in param_list:
|
||||||
|
with self.subTest(msg="RSA Signing Roundtrip using algo p", p=p):
|
||||||
|
- if (p == RSASignatureAlgorithm.PKCS1_5_SHA1):
|
||||||
|
- h = Hash.sha1_new()
|
||||||
|
- else:
|
||||||
|
- h = Hash.sha256_new()
|
||||||
|
+ h = Hash.sha256_new()
|
||||||
|
h.update(b'totally original test string')
|
||||||
|
digest = h.digest()
|
||||||
|
|
||||||
@ -1,12 +0,0 @@
|
|||||||
diff --git a/test/test_http_client.py b/test/test_http_client.py
|
|
||||||
index 5af87b6..dd2631a 100644
|
|
||||||
--- a/test/test_http_client.py
|
|
||||||
+++ b/test/test_http_client.py
|
|
||||||
@@ -347,6 +347,7 @@ class TestClient(NativeResourceTest):
|
|
||||||
tls_connection_options=tls_conn_opt)
|
|
||||||
return connection_future.result(self.timeout)
|
|
||||||
|
|
||||||
+ @unittest.skip("Requires network")
|
|
||||||
def test_h2_client(self):
|
|
||||||
url = urlparse("https://d1cz66xoahf9cl.cloudfront.net/http_test_doc.txt")
|
|
||||||
connection = self._new_h2_client_connection(url)
|
|
||||||
20
SOURCES/skip-tests-requiring-network.patch
Normal file
20
SOURCES/skip-tests-requiring-network.patch
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
diff --git a/test/test_http_client.py b/test/test_http_client.py
|
||||||
|
index f79f39a..7498a96 100644
|
||||||
|
--- a/test/test_http_client.py
|
||||||
|
+++ b/test/test_http_client.py
|
||||||
|
@@ -353,6 +353,7 @@ class TestClient(NativeResourceTest):
|
||||||
|
tls_connection_options=tls_conn_opt)
|
||||||
|
return connection_future.result(self.timeout)
|
||||||
|
|
||||||
|
+ @unittest.skip("Requires network")
|
||||||
|
def test_h2_client(self):
|
||||||
|
url = urlparse("https://d1cz66xoahf9cl.cloudfront.net/http_test_doc.txt")
|
||||||
|
connection = self._new_h2_client_connection(url)
|
||||||
|
@@ -375,6 +376,7 @@ class TestClient(NativeResourceTest):
|
||||||
|
|
||||||
|
self.assertEqual(None, connection.close().exception(self.timeout))
|
||||||
|
|
||||||
|
+ @unittest.skip("Requires network")
|
||||||
|
def test_h2_manual_write_exception(self):
|
||||||
|
url = urlparse("https://d1cz66xoahf9cl.cloudfront.net/http_test_doc.txt")
|
||||||
|
connection = self._new_h2_client_connection(url)
|
||||||
26
SOURCES/websockets.patch
Normal file
26
SOURCES/websockets.patch
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
diff --git a/test/test_websocket.py b/test/test_websocket.py
|
||||||
|
index fcbcedb..ebebbcb 100644
|
||||||
|
--- a/test/test_websocket.py
|
||||||
|
+++ b/test/test_websocket.py
|
||||||
|
@@ -122,6 +122,7 @@ class WebSocketServer:
|
||||||
|
# that the asyncio server thread has finished startup.
|
||||||
|
self._server_started_event = threading.Event()
|
||||||
|
self._server_thread = threading.Thread(target=self._run_server_thread)
|
||||||
|
+ self._current_connection = None
|
||||||
|
|
||||||
|
def __enter__(self):
|
||||||
|
# main thread is entering the `with` block: start the server...
|
||||||
|
@@ -179,6 +180,13 @@ class WebSocketServer:
|
||||||
|
self._current_connection = None
|
||||||
|
|
||||||
|
def send_async(self, msg):
|
||||||
|
+ # Wait for a connection to be established before trying to send
|
||||||
|
+ max_wait = time() + TIMEOUT
|
||||||
|
+ while self._current_connection is None:
|
||||||
|
+ if time() > max_wait:
|
||||||
|
+ raise RuntimeError("Timeout waiting for WebSocket connection to be established")
|
||||||
|
+ sleep(0.01)
|
||||||
|
+
|
||||||
|
asyncio.run_coroutine_threadsafe(self._current_connection.send(msg), self._server_loop)
|
||||||
|
|
||||||
|
|
||||||
@ -3,8 +3,8 @@ Python bindings for the AWS Common Runtime}
|
|||||||
|
|
||||||
|
|
||||||
Name: python-awscrt
|
Name: python-awscrt
|
||||||
Version: 0.20.2
|
Version: 0.27.2
|
||||||
Release: 3%{dist}
|
Release: 1%{?dist}
|
||||||
|
|
||||||
Summary: Python bindings for the AWS Common Runtime
|
Summary: Python bindings for the AWS Common Runtime
|
||||||
# All files are licensed under Apache-2.0, except:
|
# All files are licensed under Apache-2.0, except:
|
||||||
@ -16,12 +16,14 @@ URL: https://github.com/awslabs/aws-crt-python
|
|||||||
|
|
||||||
Source0: %{pypi_source awscrt}
|
Source0: %{pypi_source awscrt}
|
||||||
|
|
||||||
# Get an open source version of the pkcs11 header file from Simo's repository.
|
# two tests require internet connection, skip them
|
||||||
# https://github.com/latchset/pkcs11-headers
|
Patch0: skip-tests-requiring-network.patch
|
||||||
Source1: https://raw.githubusercontent.com/latchset/pkcs11-headers/main/public-domain/2.40/pkcs11.h
|
# SHA1 is deprecated - remove it from tests
|
||||||
|
Patch1: skip-SHA1-in-test_crypto.patch
|
||||||
# one test requires internet connection, skip it
|
# https://github.com/awslabs/aws-c-cal/pull/225
|
||||||
Patch0: skip-test-requiring-network.patch
|
Patch2: der-c.patch
|
||||||
|
# websockets test fail fix
|
||||||
|
Patch3: websockets.patch
|
||||||
|
|
||||||
BuildRequires: python%{python3_pkgversion}-devel
|
BuildRequires: python%{python3_pkgversion}-devel
|
||||||
|
|
||||||
@ -32,9 +34,6 @@ BuildRequires: openssl-devel
|
|||||||
|
|
||||||
BuildRequires: python%{python3_pkgversion}-websockets
|
BuildRequires: python%{python3_pkgversion}-websockets
|
||||||
|
|
||||||
# https://bugzilla.redhat.com/show_bug.cgi?id=2180988
|
|
||||||
ExcludeArch: s390x
|
|
||||||
|
|
||||||
|
|
||||||
%description
|
%description
|
||||||
%{desc}
|
%{desc}
|
||||||
@ -51,13 +50,14 @@ Summary: %{summary}
|
|||||||
%prep
|
%prep
|
||||||
%autosetup -p1 -n awscrt-%{version}
|
%autosetup -p1 -n awscrt-%{version}
|
||||||
|
|
||||||
# Bring in the pkcs11 header file from Simo's repository.
|
# relax version requirements
|
||||||
rm -fv crt/aws-c-io/source/pkcs11/v2.40/*
|
sed -i -e 's/setuptools>=75\.3\.1/setuptools/' -e 's/wheel>=0\.45\.1/wheel/' pyproject.toml
|
||||||
cp %{SOURCE1} crt/aws-c-io/source/pkcs11/v2.40/
|
|
||||||
|
|
||||||
# Remove the third party license that goes along with
|
# stay compatible with websockets<13
|
||||||
# the removed pkcs11.h header file.
|
sed -i 's/websockets\.asyncio\.server/websockets.server/' test/test_websocket.py
|
||||||
rm -rf crt/aws-c-io/THIRD-PARTY-LICENSES.txt
|
|
||||||
|
# fix for osci.rpmdeplint test - package builds with the name 'unknown'
|
||||||
|
sed -i '/setuptools\.setup(/a\ name="awscrt",' setup.py
|
||||||
|
|
||||||
|
|
||||||
%generate_buildrequires
|
%generate_buildrequires
|
||||||
@ -65,11 +65,6 @@ rm -rf crt/aws-c-io/THIRD-PARTY-LICENSES.txt
|
|||||||
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%ifarch %{ix86}
|
|
||||||
# disable SSE2 instructions to prevent a crash in aws-c-common thread handling
|
|
||||||
# probably caused by a compiler bug
|
|
||||||
export CFLAGS="%{optflags} -mno-sse2"
|
|
||||||
%endif
|
|
||||||
export AWS_CRT_BUILD_USE_SYSTEM_LIBCRYPTO=1
|
export AWS_CRT_BUILD_USE_SYSTEM_LIBCRYPTO=1
|
||||||
%pyproject_wheel
|
%pyproject_wheel
|
||||||
|
|
||||||
@ -88,6 +83,22 @@ PYTHONPATH="%{buildroot}%{python3_sitearch}:%{buildroot}%{python3_sitelib}" %{py
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Fri Sep 05 2025 Kseniia Nivnia <knivnia@redhat.com> - 0.27.2-1
|
||||||
|
- Update to 0.27.2
|
||||||
|
Resolves: RHEL-113230
|
||||||
|
|
||||||
|
* Mon Apr 29 2024 Major Hayden <major@redhat.com> - 0.20.5-3
|
||||||
|
- Removing extra pkcs11 source now that upstream switched to public domain headers
|
||||||
|
|
||||||
|
* Mon Apr 01 2024 Major Hayden <major@redhat.com> - 0.20.5-2
|
||||||
|
- Bump revision for new build
|
||||||
|
|
||||||
|
* Wed Mar 27 2024 Major Hayden <major@redhat.com> - 0.20.5-1
|
||||||
|
- Update to 0.20.5
|
||||||
|
|
||||||
|
* Tue Mar 19 2024 Major Hayden <major@redhat.com> - 0.20.2-4
|
||||||
|
- Bump revision number for new build
|
||||||
|
|
||||||
* Tue Feb 13 2024 Major Hayden <major@redhat.com> - 0.20.2-3
|
* Tue Feb 13 2024 Major Hayden <major@redhat.com> - 0.20.2-3
|
||||||
- Remove the third party license file from excluded pkcs11.h
|
- Remove the third party license file from excluded pkcs11.h
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user