diff --git a/lib/des/rsa.c b/lib/des/rsa.c index c6b108d4a..aa4bbd6bf 100644 --- a/lib/des/rsa.c +++ b/lib/des/rsa.c @@ -231,7 +231,6 @@ RSA_verify(int type, const unsigned char *from, unsigned int flen, return -1; } - /* * A NULL RSA_METHOD that returns failure for all operations. This is * used as the default RSA method is we don't have any native @@ -243,6 +242,23 @@ static RSAFUNC(null_rsa_public_decrypt, -1) static RSAFUNC(null_rsa_private_encrypt, -1) static RSAFUNC(null_rsa_private_decrypt, -1) +/* + * + */ + +int +RSA_generate_key_ex(RSA *r, int bits, BIGNUM *e, BN_GENCB *cb) +{ + if (r->meth->rsa_keygen) + return (*r->meth->rsa_keygen)(r, bits, e, cb); + return 0; +} + + +/* + * + */ + static int null_rsa_init(RSA *rsa) { diff --git a/lib/des/rsa.h b/lib/des/rsa.h index 56558128b..58f8b8759 100644 --- a/lib/des/rsa.h +++ b/lib/des/rsa.h @@ -59,6 +59,7 @@ #define RSA_private_decrypt hc_RSA_private_decrypt #define RSA_sign hc_RSA_sign #define RSA_verify hc_RSA_verify +#define RSA_generate_key_ex hc_RSA_generate_key_ex #define d2i_RSAPrivateKey hc_d2i_RSAPrivateKey #define i2d_RSAPublicKey hc_i2d_RSAPublicKey @@ -163,6 +164,8 @@ int RSA_sign(int, const unsigned char *, unsigned int, int RSA_verify(int, const unsigned char *, unsigned int, unsigned char *, unsigned int, RSA *); +int RSA_generate_key_ex(RSA *, int, BIGNUM *, BN_GENCB *); + RSA * d2i_RSAPrivateKey(RSA *, const unsigned char **, size_t); int i2d_RSAPublicKey(RSA *, unsigned char **);