This commit was manufactured by cvs2svn to create branch
[oweals/openssl.git] / apps / ca.c
index 42738deb3a5378de24da617dbc001d30390914df..177797dfda91cd2f6b9d69b1028a52c1a6fd4884 100644 (file)
--- a/apps/ca.c
+++ b/apps/ca.c
@@ -1532,11 +1532,6 @@ bad:
                        if (pkey->type == EVP_PKEY_DSA) 
                                dgst=EVP_dss1();
                        else
-#endif
-#ifndef OPENSSL_NO_ECDSA
-                       if (pkey->type == EVP_PKEY_EC)
-                               dgst=EVP_ecdsa();
-                       else
 #endif
                                dgst=EVP_md5();
                        }
@@ -1601,6 +1596,10 @@ bad:
                                }
                        j=TXT_DB_write(out,db);
                        if (j <= 0) goto err;
+                       BIO_free_all(out);
+                       out = NULL;
+                       BIO_free_all(in);
+                       in = NULL;
                        strncpy(buf[1],dbfile,BSIZE-4);
                        buf[1][BSIZE-4]='\0';
 #ifndef OPENSSL_SYS_VMS
@@ -1608,10 +1607,6 @@ bad:
 #else
                        strcat(buf[1],"-old");
 #endif
-                       BIO_free(in);
-                       in = NULL;
-                       BIO_free(out);
-                       out = NULL;
                        if (rename(dbfile,buf[1]) < 0)
                                {
                                BIO_printf(bio_err,"unable to rename %s to %s\n", dbfile, buf[1]);
@@ -2321,16 +2316,6 @@ again2:
                EVP_PKEY_copy_parameters(pktmp,pkey);
        EVP_PKEY_free(pktmp);
 #endif
-#ifndef OPENSSL_NO_ECDSA
-       if (pkey->type == EVP_PKEY_EC)
-               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;
@@ -3076,16 +3061,16 @@ X509_NAME *do_subject(char *subject, long chtype)
        int nid;
 
        if (!buf || !ne_types || !ne_values)
-               {
+       {
                BIO_printf(bio_err, "malloc error\n");
                goto error;
-               }       
+       }
 
        if (*subject != '/')
-               {
+       {
                BIO_printf(bio_err, "Subject does not start with '/'.\n");
                goto error;
-               }
+       }
        sp++; /* skip leading / */
 
        while (*sp)
@@ -3098,12 +3083,12 @@ X509_NAME *do_subject(char *subject, long chtype)
                                {
                                if (*++sp)
                                        *bp++ = *sp++;
-                               else    
+                               else
                                        {
                                        BIO_printf(bio_err, "escape character at end of string\n");
                                        goto error;
                                        }
-                               }       
+                               }
                        else if (*sp == '=')
                                {
                                sp++;
@@ -3141,7 +3126,7 @@ X509_NAME *do_subject(char *subject, long chtype)
                        }
                *bp++ = '\0';
                ne_num++;
-               }       
+               }
 
        if (!(n = X509_NAME_new()))
                goto error;