{
if((ret->engine=ENGINE_get_default_RSA()) == NULL)
{
+ RSAerr(RSA_F_RSA_NEW_METHOD,ERR_LIB_ENGINE);
OPENSSL_free(ret);
return NULL;
}
BN_CTX_start(ctx);
A = BN_CTX_get(ctx);
- if (!BN_rand(A,BN_num_bits(rsa->n)-1,1,0)) goto err;
+ if (!BN_rand_range(A,rsa->n)) goto err;
if ((Ai=BN_mod_inverse(NULL,A,rsa->n,ctx)) == NULL) goto err;
if (!ENGINE_get_RSA(rsa->engine)->bn_mod_exp(A,A,