Replace the broken SPKAC certification with the correct version.
[oweals/openssl.git] / apps / genrsa.c
index fdc0d4a07dfe159ea8a5f8d38fa0b43ba36a3f2f..5759acbf9bbe078349a430d06803b13c9d54fb21 100644 (file)
@@ -106,9 +106,9 @@ int MAIN(int argc, char **argv)
        char *inrand=NULL;
        BIO *out=NULL;
        BIGNUM *bn = BN_new();
-       RSA *rsa = RSA_new();
+       RSA *rsa = NULL;
 
-       if(!bn || !rsa) goto err;
+       if(!bn) goto err;
 
        apps_startup();
        BN_GENCB_set(&cb, genrsa_cb, bio_err);
@@ -269,6 +269,10 @@ bad:
        BIO_printf(bio_err,"Generating RSA private key, %d bit long modulus\n",
                num);
 
+       rsa = RSA_new();
+       if (!rsa)
+               goto err;
+
        if (use_x931)
                {
                BIGNUM *pubexp;