diff options
author | Matěj Cepl <mcepl@cepl.eu> | 2017-09-19 11:50:10 +0200 |
---|---|---|
committer | Matěj Cepl <mcepl@cepl.eu> | 2017-09-20 17:14:13 +0200 |
commit | db5bd9a8b495f57117791a160a5662001ff96e22 (patch) | |
tree | 47e2281383c3764b2ef3bc25a312f7dd890c5420 | |
parent | 0549645846814f3d0c052f84aa03006f2e53bf7f (diff) | |
download | m2crypto-db5bd9a8b495f57117791a160a5662001ff96e22.tar.gz |
Add missing BN_GENCB_new and BN_GENCB_free.
-rw-r--r-- | SWIG/_lib11_compat.i | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/SWIG/_lib11_compat.i b/SWIG/_lib11_compat.i index e8a8dae..ad9e700 100644 --- a/SWIG/_lib11_compat.i +++ b/SWIG/_lib11_compat.i @@ -24,6 +24,32 @@ static void *CRYPTO_zalloc(size_t num, const char *file, int line) return ret; } +#include <openssl/bn.h> + +#ifndef BN_F_BN_GENCB_NEW +# define BN_F_BN_GENCB_NEW 143 +#endif + +BN_GENCB *BN_GENCB_new(void) +{ + BN_GENCB *ret; + + if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL) { + BNerr(BN_F_BN_GENCB_NEW, ERR_R_MALLOC_FAILURE); + return (NULL); + } + + return ret; +} + +void BN_GENCB_free(BN_GENCB *cb) +{ + if (cb == NULL) + return; + OPENSSL_free(cb); +} + + int RSA_set0_key(RSA *r, BIGNUM *n, BIGNUM *e, BIGNUM *d) { /* If the fields n and e in r are NULL, the corresponding input |