diff --git a/libretroshare/src/gxs/gxssecurity.cc b/libretroshare/src/gxs/gxssecurity.cc index a1de27d89..eb5f38219 100644 --- a/libretroshare/src/gxs/gxssecurity.cc +++ b/libretroshare/src/gxs/gxssecurity.cc @@ -243,7 +243,10 @@ bool GxsSecurity::checkPublicKey(const RsTlvPublicRSAKey &key) bool GxsSecurity::generateKeyPair(RsTlvPublicRSAKey& public_key,RsTlvPrivateRSAKey& private_key) { // admin keys - RSA *rsa = RSA_generate_key(2048, 65537, NULL, NULL); + BIGNUM *ebn = BN_new(); + BN_set_word(ebn, 65537); + RSA *rsa = RSA_new(); + RSA_generate_key_ex(rsa, 2048, ebn, NULL); RSA *rsa_pub = RSAPublicKey_dup(rsa); public_key.keyFlags = RSTLV_KEY_TYPE_PUBLIC_ONLY ; diff --git a/libretroshare/src/pqi/sslfns.cc b/libretroshare/src/pqi/sslfns.cc index 9e5813b75..07ec804a2 100644 --- a/libretroshare/src/pqi/sslfns.cc +++ b/libretroshare/src/pqi/sslfns.cc @@ -105,11 +105,15 @@ X509_REQ *GenerateX509Req( fprintf(stderr,"GenerateX509Req: reverting to %d\n", nbits); } - rsa = RSA_generate_key(nbits, e, NULL, NULL); + rsa = RSA_new(); if ((rsa == NULL) || !EVP_PKEY_assign_RSA(pkey, rsa)) throw std::runtime_error("Couldn't generate RSA Key"); + BIGNUM *ebn = BN_new(); + BN_set_word(ebn, e); + RSA_generate_key_ex(rsa, nbits, ebn, NULL); + // open the file. FILE *out; if (NULL == (out = RsDirUtil::rs_fopen(pkey_file.c_str(), "w")))