aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2019-01-15 21:52:08 -0600
committerAlex Gaynor <alex.gaynor@gmail.com>2019-01-15 22:52:08 -0500
commit9c2f3d6a05b117247b37323e1f8ed1cf6fa263d1 (patch)
tree13969efb771c6b57556ea8f8206ecd7a54bdaa21 /tests/hazmat
parent2f34994fe909d8862225c03427c7b4525fff4190 (diff)
downloadcryptography-9c2f3d6a05b117247b37323e1f8ed1cf6fa263d1.tar.gz
cryptography-9c2f3d6a05b117247b37323e1f8ed1cf6fa263d1.tar.bz2
cryptography-9c2f3d6a05b117247b37323e1f8ed1cf6fa263d1.zip
support byteslike in X448PrivateKey.from_private_bytes (#4694)
Diffstat (limited to 'tests/hazmat')
-rw-r--r--tests/hazmat/primitives/test_x448.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/hazmat/primitives/test_x448.py b/tests/hazmat/primitives/test_x448.py
index 1833b03d..51be0e10 100644
--- a/tests/hazmat/primitives/test_x448.py
+++ b/tests/hazmat/primitives/test_x448.py
@@ -218,3 +218,15 @@ class TestX448Exchange(object):
serialization.Encoding.PEM,
serialization.PublicFormat.Raw
)
+
+ def test_buffer_protocol(self, backend):
+ private_bytes = binascii.unhexlify(
+ b"9a8f4925d1519f5775cf46b04b5800d4ee9ee8bae8bc5565d498c28d"
+ b"d9c9baf574a9419744897391006382a6f127ab1d9ac2d8c0a598726b"
+ )
+ key = X448PrivateKey.from_private_bytes(bytearray(private_bytes))
+ assert key.private_bytes(
+ serialization.Encoding.Raw,
+ serialization.PrivateFormat.Raw,
+ serialization.NoEncryption()
+ ) == private_bytes