Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14618)
|| !BN_set_word(gctx->pub_exp, RSA_F4)) {
BN_free(gctx->pub_exp);
OPENSSL_free(gctx);
- gctx = NULL;
- } else {
- gctx->nbits = 2048;
- gctx->primes = RSA_DEFAULT_PRIME_NUM;
- gctx->rsa_type = rsa_type;
+ return NULL;
}
+ gctx->nbits = 2048;
+ gctx->primes = RSA_DEFAULT_PRIME_NUM;
+ gctx->rsa_type = rsa_type;
}
if (!rsa_gen_set_params(gctx, params)) {
OPENSSL_free(gctx);
- gctx = NULL;
+ return NULL;
}
return gctx;
}