Skip to content

Commit 41dc136

Browse files
authored
focal time (#929)
* focal time * larger dh params, assert on something * urllib3 fix * actually check an error
1 parent 9a80576 commit 41dc136

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

.travis.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
os: linux
2-
dist: xenial
2+
dist: focal
33
language: python
44

55
cache:
@@ -18,6 +18,8 @@ jobs:
1818
env: TOXENV=py27
1919
- python: "2.7"
2020
env: TOXENV=py27
21+
# we should still test against OpenSSL 1.0.2. Xenial gives us that for now.
22+
dist: xenial
2123
- python: "3.5"
2224
env: TOXENV=py35
2325
- python: "3.6"
@@ -74,6 +76,8 @@ jobs:
7476
env: TOXENV=py37-twistedMaster
7577
- python: "3.5"
7678
env: TOXENV=py35-urllib3Master
79+
# Somehow urllib3 has trouble with newer distributions
80+
dist: xenial
7781

7882

7983
# Meta

src/OpenSSL/SSL.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1080,7 +1080,8 @@ def load_tmp_dh(self, dhfile):
10801080

10811081
dh = _lib.PEM_read_bio_DHparams(bio, _ffi.NULL, _ffi.NULL, _ffi.NULL)
10821082
dh = _ffi.gc(dh, _lib.DH_free)
1083-
_lib.SSL_CTX_set_tmp_dh(self._context, dh)
1083+
res = _lib.SSL_CTX_set_tmp_dh(self._context, dh)
1084+
_openssl_assert(res == 1)
10841085

10851086
def set_tmp_ecdh(self, curve):
10861087
"""

tests/test_ssl.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,15 @@
139139
)
140140

141141

142-
# openssl dhparam 1024 -out dh-1024.pem (note that 1024 is a small number of
143-
# bits to use)
142+
# openssl dhparam 2048 -out dh-2048.pem
144143
dhparam = """\
145144
-----BEGIN DH PARAMETERS-----
146-
MIGHAoGBALdUMvn+C9MM+y5BWZs11mSeH6HHoEq0UVbzVq7UojC1hbsZUuGukQ3a
147-
Qh2/pwqb18BZFykrWB0zv/OkLa0kx4cuUgNrUVq1EFheBiX6YqryJ7t2sO09NQiO
148-
V7H54LmltOT/hEh6QWsJqb6BQgH65bswvV/XkYGja8/T0GzvbaVzAgEC
145+
MIIBCAKCAQEA2F5e976d/GjsaCdKv5RMWL/YV7fq1UUWpPAer5fDXflLMVUuYXxE
146+
3m3ayZob9lbpgEU0jlPAsXHfQPGxpKmvhv+xV26V/DEoukED8JeZUY/z4pigoptl
147+
+8+TYdNNE/rFSZQFXIp+v2D91IEgmHBnZlKFSbKR+p8i0KjExXGjU6ji3S5jkOku
148+
ogikc7df1Ui0hWNJCmTjExq07aXghk97PsdFSxjdawuG3+vos5bnNoUwPLYlFc/z
149+
ITYG0KXySiCLi4UDlXTZTz7u/+OYczPEgqa/JPUddbM/kfvaRAnjY38cfQ7qXf8Y
150+
i5s5yYK7a/0eWxxRr2qraYaUj8RwDpH9CwIBAg==
149151
-----END DH PARAMETERS-----
150152
"""
151153

@@ -1560,7 +1562,6 @@ def _load_tmp_dh_test(self, dhfilename):
15601562
dhfile.write(dhparam)
15611563

15621564
context.load_tmp_dh(dhfilename)
1563-
# XXX What should I assert here? -exarkun
15641565

15651566
def test_load_tmp_dh_bytes(self, tmpfile):
15661567
"""

0 commit comments

Comments
 (0)