From 0b7ab2c6ba34d09bbcc25b7fb417e74e4de2d7b6 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Wed, 31 May 2023 17:42:44 -0400 Subject: [PATCH] Added tests for NUL bytes in PKCS8 passphrases --- tests/hazmat/primitives/test_ed25519.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/hazmat/primitives/test_ed25519.py b/tests/hazmat/primitives/test_ed25519.py index 4b47e0a1657f..2501f1cf1bb1 100644 --- a/tests/hazmat/primitives/test_ed25519.py +++ b/tests/hazmat/primitives/test_ed25519.py @@ -245,6 +245,13 @@ def test_invalid_public_bytes(self, backend): None, serialization.load_der_private_key, ), + ( + serialization.Encoding.DER, + serialization.PrivateFormat.PKCS8, + serialization.BestAvailableEncryption(b"\x00"), + b"\x00", + serialization.load_der_private_key, + ), ], ) def test_round_trip_private_serialization(