aboutsummaryrefslogtreecommitdiffstats
path: root/src/cryptography/hazmat/backends/openssl/ec.py
diff options
context:
space:
mode:
authorMarko Kreen <markokr@gmail.com>2020-05-25 21:17:25 +0300
committerGitHub <noreply@github.com>2020-05-25 13:17:25 -0500
commit9470f67a3086e4c003ab27ca6a2209dae9b1a9e6 (patch)
treee4ec2d6259f68c1466ba0eb4706418d8338d6391 /src/cryptography/hazmat/backends/openssl/ec.py
parent27f04412b5874374f00aab388c9a8c37d257f1ef (diff)
downloadcryptography-9470f67a3086e4c003ab27ca6a2209dae9b1a9e6.tar.gz
cryptography-9470f67a3086e4c003ab27ca6a2209dae9b1a9e6.tar.bz2
cryptography-9470f67a3086e4c003ab27ca6a2209dae9b1a9e6.zip
Cleanup serialize (#5149)
* Additional tests for public/private_bytes They expose few places that raise TypeError and AssertionError! before, and ValueError later. * Cleanup of private_bytes() backend Also pass key itself down to backend. * Cleanup of public_bytes() backend * Test handling of unsupported key type
Diffstat (limited to 'src/cryptography/hazmat/backends/openssl/ec.py')
-rw-r--r--src/cryptography/hazmat/backends/openssl/ec.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/cryptography/hazmat/backends/openssl/ec.py b/src/cryptography/hazmat/backends/openssl/ec.py
index 3d8681b4..e70a3410 100644
--- a/src/cryptography/hazmat/backends/openssl/ec.py
+++ b/src/cryptography/hazmat/backends/openssl/ec.py
@@ -225,6 +225,7 @@ class _EllipticCurvePrivateKey(object):
encoding,
format,
encryption_algorithm,
+ self,
self._evp_pkey,
self._ec_key
)
@@ -312,10 +313,6 @@ class _EllipticCurvePublicKey(object):
return self._backend._ffi.buffer(buf)[:]
def public_bytes(self, encoding, format):
- if format is serialization.PublicFormat.PKCS1:
- raise ValueError(
- "EC public keys do not support PKCS1 serialization"
- )
if (
encoding is serialization.Encoding.X962 or