don't dump core
[openssl.git] / apps / req.c
index 292bc5910f3bf5d1c28f792ca5f61e53fe0c1a23..b518e47370299cba85f95dd0554a11c7b6c3a60e 100644 (file)
@@ -770,16 +770,15 @@ loop:
 
        if (newreq || x509)
                {
 
        if (newreq || x509)
                {
-#ifndef NO_DSA
-               if (pkey->type == EVP_PKEY_DSA)
-                       digest=EVP_dss1();
-#endif
-
                if (pkey == NULL)
                        {
                        BIO_printf(bio_err,"you need to specify a private key\n");
                        goto end;
                        }
                if (pkey == NULL)
                        {
                        BIO_printf(bio_err,"you need to specify a private key\n");
                        goto end;
                        }
+#ifndef NO_DSA
+               if (pkey->type == EVP_PKEY_DSA)
+                       digest=EVP_dss1();
+#endif
                if (req == NULL)
                        {
                        req=X509_REQ_new();
                if (req == NULL)
                        {
                        req=X509_REQ_new();