Get rid of more non-ANSI declarations.
[openssl.git] / apps / ca.c
index 8696b4157147ef54794fa49e09bfeb8d90f4e842..7ab8c3b4f42d8d962bb3bca75e55de0291533cfe 100644 (file)
--- a/apps/ca.c
+++ b/apps/ca.c
@@ -213,6 +213,8 @@ static char *section=NULL;
 static int preserve=0;
 static int msie_hack=0;
 
+int MAIN(int, char **);
+
 int MAIN(int argc, char **argv)
        {
        char *key=NULL;
@@ -531,7 +533,7 @@ bad:
                BIO_printf(bio_err,"trying to load CA private key\n");
                goto err;
                }
-               pkey=PEM_read_bio_PrivateKey(in,NULL,PEM_cb,key);
+               pkey=PEM_read_bio_PrivateKey(in,NULL,NULL,key);
                if(key) memset(key,0,strlen(key));
        if (pkey == NULL)
                {
@@ -585,12 +587,17 @@ bad:
                        BIO_printf(bio_err,"there needs to be defined a directory for new certificate to be placed in\n");
                        goto err;
                        }
-#ifdef VMS
-               /* For technical reasons, VMS misbehaves with X_OK */
-               if (access(outdir,R_OK|W_OK) != 0)
-#else
+#ifndef VMS /* outdir is a directory spec, but access() for VMS demands a
+              filename.  In any case, stat(), below, will catch the problem
+              if outdir is not a directory spec, and the fopen() or open()
+              will catch an error if there is no write access.
+
+              Presumably, this problem could also be solved by using the DEC
+              C routines to convert the directory syntax to Unixly, and give
+              that to access().  However, time's too short to do that just
+              now.
+            */
                if (access(outdir,R_OK|W_OK|X_OK) != 0)
-#endif
                        {
                        BIO_printf(bio_err,"I am unable to access the %s directory\n",outdir);
                        perror(outdir);
@@ -610,6 +617,7 @@ bad:
                        perror(outdir);
                        goto err;
                        }
+#endif
 #endif
                }
 
@@ -1225,7 +1233,7 @@ err:
        BIO_free(out);
        BIO_free(in);
 
-       sk_pop_free(cert_sk,X509_free);
+       sk_pop_free(cert_sk, (void(*)(void *)) X509_free);
 
        if (ret) ERR_print_errors(bio_err);
        app_RAND_write_file(randfile, bio_err);
@@ -1654,7 +1662,7 @@ again2:
                                        }
                                if (j < 0)
                                        {
-                                       BIO_printf(bio_err,"The %s field needed to be the same in the\nCA certificate (%s) and the request (%s)\n",cv->name,((str == NULL)?"NULL":(char *)str->data),((str2 == NULL)?"NULL":(char *)str2->data));
+                                       BIO_printf(bio_err,"The %s field needed to be the same in the\nCA certificate (%s) and the request (%s)\n",cv->name,((str2 == NULL)?"NULL":(char *)str2->data),((str == NULL)?"NULL":(char *)str->data));
                                        goto err;
                                        }
                                }