diff options
author | Ross Burton <ross.burton@intel.com> | 2018-09-10 14:31:20 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-09-13 07:42:28 +0100 |
commit | e0fb62596f1704a9656ff46231b9fac896ad13b2 (patch) | |
tree | 77d2463bbf3faaa605bce5dcaf46c047e4dc5a07 /meta | |
parent | a8948584c1bfec41611596fa24a984ae503e9375 (diff) | |
download | poky-e0fb62596f1704a9656ff46231b9fac896ad13b2.tar.gz |
python3: fix ftplib with TLS 1.3
With OpenSSL 1.1.x TLS 1.3 can be used, so backport a patch from Python 3.6 to
fix the ftplib unit test.
(From OE-Core rev: a31047bec6b7c368674d4620e70e526ac211b936)
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/recipes-devtools/python/python3/ftplib.patch | 57 | ||||
-rw-r--r-- | meta/recipes-devtools/python/python3_3.5.5.bb | 1 |
2 files changed, 58 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python3/ftplib.patch b/meta/recipes-devtools/python/python3/ftplib.patch new file mode 100644 index 0000000000..8bb3cd0219 --- /dev/null +++ b/meta/recipes-devtools/python/python3/ftplib.patch | |||
@@ -0,0 +1,57 @@ | |||
1 | From cabe916dc694997d4892b58986e73a713d5a2f8d Mon Sep 17 00:00:00 2001 | ||
2 | From: "Miss Islington (bot)" | ||
3 | <31488909+miss-islington@users.noreply.github.com> | ||
4 | Date: Thu, 16 Aug 2018 15:38:03 -0400 | ||
5 | Subject: [PATCH] [3.6] bpo-34391: Fix ftplib test for TLS 1.3 (GH-8787) | ||
6 | (#8790) | ||
7 | |||
8 | Read from data socket to avoid "[SSL] shutdown while in init" exception | ||
9 | during shutdown of the dummy server. | ||
10 | |||
11 | Signed-off-by: Christian Heimes <christian@python.org> | ||
12 | |||
13 | |||
14 | <!-- issue-number: [bpo-34391](https://www.bugs.python.org/issue34391) --> | ||
15 | https://bugs.python.org/issue34391 | ||
16 | <!-- /issue-number --> | ||
17 | (cherry picked from commit 1590c393360df059160145e7475754427bfc6680) | ||
18 | |||
19 | |||
20 | Co-authored-by: Christian Heimes <christian@python.org> | ||
21 | --- | ||
22 | Lib/test/test_ftplib.py | 5 +++++ | ||
23 | Misc/NEWS.d/next/Tests/2018-08-16-18-48-47.bpo-34391.ouNfxC.rst | 1 + | ||
24 | 2 files changed, 6 insertions(+) | ||
25 | create mode 100644 Misc/NEWS.d/next/Tests/2018-08-16-18-48-47.bpo-34391.ouNfxC.rst | ||
26 | |||
27 | diff --git a/Lib/test/test_ftplib.py b/Lib/test/test_ftplib.py | ||
28 | index 44dd73aeca..4ff2f71afb 100644 | ||
29 | --- a/Lib/test/test_ftplib.py | ||
30 | +++ b/Lib/test/test_ftplib.py | ||
31 | @@ -876,18 +876,23 @@ class TestTLS_FTPClass(TestCase): | ||
32 | # clear text | ||
33 | with self.client.transfercmd('list') as sock: | ||
34 | self.assertNotIsInstance(sock, ssl.SSLSocket) | ||
35 | + self.assertEqual(sock.recv(1024), LIST_DATA.encode('ascii')) | ||
36 | self.assertEqual(self.client.voidresp(), "226 transfer complete") | ||
37 | |||
38 | # secured, after PROT P | ||
39 | self.client.prot_p() | ||
40 | with self.client.transfercmd('list') as sock: | ||
41 | self.assertIsInstance(sock, ssl.SSLSocket) | ||
42 | + # consume from SSL socket to finalize handshake and avoid | ||
43 | + # "SSLError [SSL] shutdown while in init" | ||
44 | + self.assertEqual(sock.recv(1024), LIST_DATA.encode('ascii')) | ||
45 | self.assertEqual(self.client.voidresp(), "226 transfer complete") | ||
46 | |||
47 | # PROT C is issued, the connection must be in cleartext again | ||
48 | self.client.prot_c() | ||
49 | with self.client.transfercmd('list') as sock: | ||
50 | self.assertNotIsInstance(sock, ssl.SSLSocket) | ||
51 | + self.assertEqual(sock.recv(1024), LIST_DATA.encode('ascii')) | ||
52 | self.assertEqual(self.client.voidresp(), "226 transfer complete") | ||
53 | |||
54 | def test_login(self): | ||
55 | -- | ||
56 | 2.11.0 | ||
57 | |||
diff --git a/meta/recipes-devtools/python/python3_3.5.5.bb b/meta/recipes-devtools/python/python3_3.5.5.bb index 40896dbc08..93878e4e45 100644 --- a/meta/recipes-devtools/python/python3_3.5.5.bb +++ b/meta/recipes-devtools/python/python3_3.5.5.bb | |||
@@ -42,6 +42,7 @@ SRC_URI += "\ | |||
42 | file://Use-correct-CFLAGS-for-extensions-when-cross-compili.patch \ | 42 | file://Use-correct-CFLAGS-for-extensions-when-cross-compili.patch \ |
43 | file://0002-Makefile-add-target-to-split-profile-generation.patch \ | 43 | file://0002-Makefile-add-target-to-split-profile-generation.patch \ |
44 | file://float-endian.patch \ | 44 | file://float-endian.patch \ |
45 | file://ftplib.patch \ | ||
45 | " | 46 | " |
46 | SRC_URI[md5sum] = "f3763edf9824d5d3a15f5f646083b6e0" | 47 | SRC_URI[md5sum] = "f3763edf9824d5d3a15f5f646083b6e0" |
47 | SRC_URI[sha256sum] = "063d2c3b0402d6191b90731e0f735c64830e7522348aeb7ed382a83165d45009" | 48 | SRC_URI[sha256sum] = "063d2c3b0402d6191b90731e0f735c64830e7522348aeb7ed382a83165d45009" |