]> git.ipfire.org Git - thirdparty/openssl.git/blobdiff - apps/ca.c
ECDSA support
[thirdparty/openssl.git] / apps / ca.c
index 7a168aa9d3bdc0e1ddb3b1618dd230ce587ed585..04246bbe477df1b364bacd3fda36c15261c72cc2 100644 (file)
--- a/apps/ca.c
+++ b/apps/ca.c
@@ -1501,6 +1501,11 @@ bad:
                        if (pkey->type == EVP_PKEY_DSA) 
                                dgst=EVP_dss1();
                        else
+#endif
+#ifndef OPENSSL_NO_ECDSA
+                       if (pkey->type == EVP_PKEY_ECDSA)
+                               dgst=EVP_ecdsa();
+                       else
 #endif
                                dgst=EVP_md5();
                        }
@@ -2270,6 +2275,16 @@ again2:
                EVP_PKEY_copy_parameters(pktmp,pkey);
        EVP_PKEY_free(pktmp);
 #endif
+#ifndef OPENSSL_NO_ECDSA
+       if (pkey->type == EVP_PKEY_ECDSA)
+               dgst = EVP_ecdsa();
+       pktmp = X509_get_pubkey(ret);
+       if (EVP_PKEY_missing_parameters(pktmp) &&
+               !EVP_PKEY_missing_parameters(pkey))
+               EVP_PKEY_copy_parameters(pktmp, pkey);
+       EVP_PKEY_free(pktmp);
+#endif
+
 
        if (!X509_sign(ret,pkey,dgst))
                goto err;