From 919a5b2af627a18c0298db8a4ac11d8b2b6da7b9 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Sat, 14 Mar 2015 13:15:17 -0500 Subject: DER serialization of DSA private keys --- src/cryptography/hazmat/backends/openssl/backend.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/cryptography/hazmat/backends/openssl/backend.py b/src/cryptography/hazmat/backends/openssl/backend.py index 13699558..59503bd9 100644 --- a/src/cryptography/hazmat/backends/openssl/backend.py +++ b/src/cryptography/hazmat/backends/openssl/backend.py @@ -1210,10 +1210,8 @@ class Backend(object): elif (self._lib.Cryptography_HAS_EC == 1 and type == self._lib.EVP_PKEY_EC): write_bio = self._lib.i2d_ECPrivateKey_bio - else: - raise TypeError( - "Only RSA & EC keys are supported for DER serialization" - ) + elif type == self._lib.EVP_PKEY_DSA: + write_bio = self._lib.i2d_DSAPrivateKey_bio bio = self._create_mem_bio() res = write_bio(bio, cdata) -- cgit v1.2.3