From 7a13085afce1415c0524a5dc5b94c98e3d6d7b7d Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Thu, 9 Feb 2017 05:55:34 +0800 Subject: enforce password must be bytes when loading PEM/DER asymmetric keys (#3383) * enforce password must be bytes when loading PEM/DER asymmetric keys Previously we were using an ffi.buffer on the Python string, which was allowing text implicitly, but our documentation explicitly requires bytes. * add changelog entry --- tests/hazmat/backends/test_openssl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/hazmat/backends') diff --git a/tests/hazmat/backends/test_openssl.py b/tests/hazmat/backends/test_openssl.py index 8fa64bc8..a8198317 100644 --- a/tests/hazmat/backends/test_openssl.py +++ b/tests/hazmat/backends/test_openssl.py @@ -523,7 +523,7 @@ class TestOpenSSLSerializationWithOpenSSL(object): backend._evp_pkey_to_public_key(key) def test_very_long_pem_serialization_password(self): - password = "x" * 1024 + password = b"x" * 1024 with pytest.raises(ValueError): load_vectors_from_file( -- cgit v1.2.3