summaryrefslogtreecommitdiffstats
path: root/meta-python/recipes-devtools/python/python3-cryptography/0003-correct-buffer-overflows-cause-by-integer-overflow-i.patch
diff options
context:
space:
mode:
authorMartin Jansa <martin.jansa@gmail.com>2022-05-10 18:30:12 +0200
committerArmin Kuster <akuster808@gmail.com>2022-05-25 19:34:39 -0700
commitb99a386cd1398f1272798bbe3e4fc6c1be560e36 (patch)
tree8c126a8d9cb691044ebbee67fc0ab8c3e3b18201 /meta-python/recipes-devtools/python/python3-cryptography/0003-correct-buffer-overflows-cause-by-integer-overflow-i.patch
parentabd7cf838d51900ad445a26e501baeb51b4ef1e8 (diff)
downloadmeta-openembedded-b99a386cd1398f1272798bbe3e4fc6c1be560e36.tar.gz
python3-cryptography: backport 3 changes to fix CVE-2020-36242
* backport the actual code change from https://github.com/pyca/cryptography/pull/5747 without the docs and CI changes (which aren't applicable on old 2.8 version) and backport 2 older changes to make this fix applicable on 2.8. Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Armin Kuster <akuster808@gmail.com>
Diffstat (limited to 'meta-python/recipes-devtools/python/python3-cryptography/0003-correct-buffer-overflows-cause-by-integer-overflow-i.patch')
-rw-r--r--meta-python/recipes-devtools/python/python3-cryptography/0003-correct-buffer-overflows-cause-by-integer-overflow-i.patch37
1 files changed, 37 insertions, 0 deletions
diff --git a/meta-python/recipes-devtools/python/python3-cryptography/0003-correct-buffer-overflows-cause-by-integer-overflow-i.patch b/meta-python/recipes-devtools/python/python3-cryptography/0003-correct-buffer-overflows-cause-by-integer-overflow-i.patch
new file mode 100644
index 0000000000..449dd692e6
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-cryptography/0003-correct-buffer-overflows-cause-by-integer-overflow-i.patch
@@ -0,0 +1,37 @@
1From 6d0a76521abe287f5ddb5cd1cfbc799d35f08cf9 Mon Sep 17 00:00:00 2001
2From: Alex Gaynor <alex.gaynor@gmail.com>
3Date: Sun, 7 Feb 2021 11:36:56 -0500
4Subject: [PATCH] correct buffer overflows cause by integer overflow in openssl
5 (#5747)
6
7* correct buffer overflows cause by integer overflow in openssl
8
9frustratingly, there is no test for this -- that's because testing this
10requires allocating more memory than is available in CI.
11
12fixes #5615.
13
14* backport CI fixes
15
16* another CI backport
17
18Upstream-Status: Backport [https://github.com/pyca/cryptography/commit/82b6ce28389f0a317bc55ba2091a74b346db7cae]
19
20Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
21---
22 src/cryptography/hazmat/backends/openssl/ciphers.py | 2 +-
23 1 file changed, 1 insertion(+), 1 deletion(-)
24
25diff --git a/src/cryptography/hazmat/backends/openssl/ciphers.py b/src/cryptography/hazmat/backends/openssl/ciphers.py
26index 2b7da80c..7ef5f1ea 100644
27--- a/src/cryptography/hazmat/backends/openssl/ciphers.py
28+++ b/src/cryptography/hazmat/backends/openssl/ciphers.py
29@@ -17,7 +17,7 @@ from cryptography.hazmat.primitives.ciphers import modes
30 class _CipherContext(object):
31 _ENCRYPT = 1
32 _DECRYPT = 0
33- _MAX_CHUNK_SIZE = 2 ** 31 - 1
34+ _MAX_CHUNK_SIZE = 2 ** 30 - 1
35
36 def __init__(self, backend, cipher, mode, operation):
37 self._backend = backend