Only use DSA-functions if available.
[openssl.git] / apps / x509.c
index 12888c0486f30c74afbc9bf90c3c97bcc31181e9..dd98eb3b08b319b92b1b8d854fc18d6165eb5d5f 100644 (file)
@@ -245,7 +245,7 @@ int MAIN(int argc, char **argv)
                else if (strcmp(*argv,"-CAkeyform") == 0)
                        {
                        if (--argc < 1) goto bad;
-                       CAformat=str2fmt(*(++argv));
+                       CAkeyformat=str2fmt(*(++argv));
                        }
                else if (strcmp(*argv,"-days") == 0)
                        {
@@ -923,10 +923,14 @@ bad:
 
                                BIO_printf(bio_err,"Generating certificate request\n");
 
+#ifndef OPENSSL_NO_DSA
                                if (pk->type == EVP_PKEY_DSA)
                                        digest=EVP_dss1();
-                               else if (pk->type == EVP_PKEY_ECDSA)
+#endif
+#ifndef OPENSSL_NO_ECDSA
+                               if (pk->type == EVP_PKEY_ECDSA)
                                        digest=EVP_ecdsa();
+#endif
 
                                rq=X509_to_X509_REQ(x,pk,digest);
                                EVP_PKEY_free(pk);