diff options
Diffstat (limited to 'src/_cffi_src/openssl/dh.py')
-rw-r--r-- | src/_cffi_src/openssl/dh.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/_cffi_src/openssl/dh.py b/src/_cffi_src/openssl/dh.py index 922f5e9f..42309e40 100644 --- a/src/_cffi_src/openssl/dh.py +++ b/src/_cffi_src/openssl/dh.py @@ -41,6 +41,8 @@ MACROS = """ int DH_generate_parameters_ex(DH *, int, int, BN_GENCB *); DH *d2i_DHparams_bio(BIO *, DH **); int i2d_DHparams_bio(BIO *, DH *); +DH *Cryptography_d2i_DHxparams_bio(BIO *bp, DH **x); +int Cryptography_i2d_DHxparams_bio(BIO *bp, DH *x); """ CUSTOMIZATIONS = """ @@ -227,4 +229,18 @@ int Cryptography_DH_check(const DH *dh, int *ret) { return DH_check(dh, ret); } #endif + +/* These functions were added in OpenSSL 1.1.0f commit d0c50e80a8 */ +/* Define our own to simplify support across all versions. */ +#if defined(EVP_PKEY_DHX) && EVP_PKEY_DHX != -1 +DH *Cryptography_d2i_DHxparams_bio(BIO *bp, DH **x) { + return ASN1_d2i_bio_of(DH, DH_new, d2i_DHxparams, bp, x); +} +int Cryptography_i2d_DHxparams_bio(BIO *bp, DH *x) { + return ASN1_i2d_bio_of_const(DH, i2d_DHxparams, bp, x); +} +#else +DH *(*Cryptography_d2i_DHxparams_bio)(BIO *bp, DH **x) = NULL; +int (*Cryptography_i2d_DHxparams_bio)(BIO *bp, DH *x) = NULL; +#endif """ |