File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
cryptography/hazmat/primitives/asymmetric Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -154,7 +154,8 @@ def parameter_numbers(self) -> DHParameterNumbers:
154154
155155
156156DHParametersWithSerialization = DHParameters
157- DHParameters .register (rust_openssl .dh .DHParameters )
157+ if hasattr (rust_openssl , "dh" ):
158+ DHParameters .register (rust_openssl .dh .DHParameters )
158159
159160
160161class DHPublicKey (metaclass = abc .ABCMeta ):
@@ -195,7 +196,8 @@ def __eq__(self, other: object) -> bool:
195196
196197
197198DHPublicKeyWithSerialization = DHPublicKey
198- DHPublicKey .register (rust_openssl .dh .DHPublicKey )
199+ if hasattr (rust_openssl , "dh" ):
200+ DHPublicKey .register (rust_openssl .dh .DHPublicKey )
199201
200202
201203class DHPrivateKey (metaclass = abc .ABCMeta ):
@@ -244,4 +246,5 @@ def private_bytes(
244246
245247
246248DHPrivateKeyWithSerialization = DHPrivateKey
247- DHPrivateKey .register (rust_openssl .dh .DHPrivateKey )
249+ if hasattr (rust_openssl , "dh" ):
250+ DHPrivateKey .register (rust_openssl .dh .DHPrivateKey )
Original file line number Diff line number Diff line change 22// 2.0, and the BSD License. See the LICENSE file in the root of this repository
33// for complete details.
44
5+ #[ cfg( not( CRYPTOGRAPHY_IS_BORINGSSL ) ) ]
56pub ( crate ) mod dh;
67pub ( crate ) mod dsa;
78#[ cfg( any( not( CRYPTOGRAPHY_IS_LIBRESSL ) , CRYPTOGRAPHY_LIBRESSL_370_OR_GREATER ) ) ]
@@ -19,6 +20,7 @@ pub(crate) mod x25519;
1920pub ( crate ) mod x448;
2021
2122pub ( crate ) fn add_to_module ( module : & pyo3:: prelude:: PyModule ) -> pyo3:: PyResult < ( ) > {
23+ #[ cfg( not( CRYPTOGRAPHY_IS_BORINGSSL ) ) ]
2224 module. add_submodule ( dh:: create_module ( module. py ( ) ) ?) ?;
2325 module. add_submodule ( dsa:: create_module ( module. py ( ) ) ?) ?;
2426
You can’t perform that action at this time.
0 commit comments