aboutsummaryrefslogtreecommitdiffstats
path: root/src/cryptography
diff options
context:
space:
mode:
Diffstat (limited to 'src/cryptography')
-rw-r--r--src/cryptography/hazmat/backends/openssl/backend.py3
-rw-r--r--src/cryptography/hazmat/bindings/openssl/_conditional.py1
2 files changed, 4 insertions, 0 deletions
diff --git a/src/cryptography/hazmat/backends/openssl/backend.py b/src/cryptography/hazmat/backends/openssl/backend.py
index ca1aafe0..c0b3afe0 100644
--- a/src/cryptography/hazmat/backends/openssl/backend.py
+++ b/src/cryptography/hazmat/backends/openssl/backend.py
@@ -1914,6 +1914,9 @@ class Backend(object):
evp_pkey = backend._lib.d2i_PrivateKey_bio(bio.bio, self._ffi.NULL)
self.openssl_assert(evp_pkey != self._ffi.NULL)
evp_pkey = self._ffi.gc(evp_pkey, self._lib.EVP_PKEY_free)
+ self.openssl_assert(
+ self._lib.EVP_PKEY_id(evp_pkey) == self._lib.EVP_PKEY_X25519
+ )
return _X25519PrivateKey(self, evp_pkey)
def x25519_generate_key(self):
diff --git a/src/cryptography/hazmat/bindings/openssl/_conditional.py b/src/cryptography/hazmat/bindings/openssl/_conditional.py
index 8bc74c97..b87ae906 100644
--- a/src/cryptography/hazmat/bindings/openssl/_conditional.py
+++ b/src/cryptography/hazmat/bindings/openssl/_conditional.py
@@ -232,6 +232,7 @@ def cryptography_has_x509_store_ctx_get_issuer():
def cryptography_has_x25519():
return [
+ "EVP_PKEY_X25519",
"NID_X25519",
]