File: update-our-test-to-be-more-robust-wrt-some-changes-f.patch

package info (click to toggle)
python-cryptography 2.6.1-3%2Bdeb10u2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 3,916 kB
  • sloc: python: 44,822; ansic: 656; java: 319; makefile: 158
file content (35 lines) | stat: -rw-r--r-- 1,433 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
From e575e3d482f976c4a1f3203d63ea0f5007a49a2a Mon Sep 17 00:00:00 2001
From: Paul Kehrer <paul.l.kehrer@gmail.com>
Date: Wed, 11 Sep 2019 12:12:30 +0800
Subject: [PATCH] update our test to be more robust wrt some changes from
 upstream (#4993)

---
 tests/hazmat/primitives/test_dh.py | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/tests/hazmat/primitives/test_dh.py b/tests/hazmat/primitives/test_dh.py
index c667cd16e1a6b..43f2ce5c0318b 100644
--- a/tests/hazmat/primitives/test_dh.py
+++ b/tests/hazmat/primitives/test_dh.py
@@ -157,8 +157,15 @@ from ...utils import load_nist_vectors, load_vectors_from_file
             dh.generate_parameters(7, 512, backend)
 
     def test_dh_parameters_supported(self, backend):
-        assert backend.dh_parameters_supported(23, 5)
-        assert not backend.dh_parameters_supported(23, 18)
+        valid_p = int(
+            b"907c7211ae61aaaba1825ff53b6cb71ac6df9f1a424c033f4a0a41ac42fad3a9"
+            b"bcfc7f938a269710ed69e330523e4039029b7900977c740990d46efed79b9bbe"
+            b"73505ae878808944ce4d9c6c52daecc0a87dc889c53499be93db8551ee685f30"
+            b"349bf1b443d4ebaee0d5e8b441a40d4e8178f8f612f657a5eb91e0a8e"
+            b"107755f", 16
+        )
+        assert backend.dh_parameters_supported(valid_p, 5)
+        assert not backend.dh_parameters_supported(23, 22)
 
     @pytest.mark.parametrize(
         "vector",
-- 
2.23.0