aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2019-05-18 09:04:37 -0400
committerAlex Gaynor <alex.gaynor@gmail.com>2019-05-18 09:04:37 -0400
commit97af501780534065739a251dc6bafd74b6bf7f19 (patch)
treeb1c1c0bca5c43c3f88b16d239ad489abef51be12 /tests
parent857d401f3c5d158e5c53ec891d73849bf114c89b (diff)
downloadcryptography-97af501780534065739a251dc6bafd74b6bf7f19.tar.gz
cryptography-97af501780534065739a251dc6bafd74b6bf7f19.tar.bz2
cryptography-97af501780534065739a251dc6bafd74b6bf7f19.zip
use a random key for these tests (#4887)
Using an all 0 key causes failures in OpenSSL master (and Fedora has cherry-picked the commit that causes it). The change requires that the key/tweak for XTS mode not be the same value, so let's just use a random key.
Diffstat (limited to 'tests')
-rw-r--r--tests/hazmat/primitives/test_aes.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/hazmat/primitives/test_aes.py b/tests/hazmat/primitives/test_aes.py
index f083f319..565cc11d 100644
--- a/tests/hazmat/primitives/test_aes.py
+++ b/tests/hazmat/primitives/test_aes.py
@@ -490,7 +490,7 @@ class TestAESModeGCM(object):
def test_buffer_protocol_alternate_modes(mode, backend):
data = bytearray(b"sixteen_byte_msg")
cipher = base.Cipher(
- algorithms.AES(bytearray(b"\x00" * 32)), mode, backend
+ algorithms.AES(bytearray(os.urandom(32))), mode, backend
)
enc = cipher.encryptor()
ct = enc.update(data) + enc.finalize()