DJGPP changes. Contributed by Doug Kaufman <dkaufman@rahul.net>
[oweals/openssl.git] / apps / apps.c
index e08c4bdebaa78c0a0c709c828af1627ef45a1819..fb9f72fbea8ab779417c329f730dce43eb277da0 100644 (file)
 #undef NON_MAIN
 
 typedef struct {
-       char *name;
+       const char *name;
        unsigned long flag;
        unsigned long mask;
 } NAME_EX_TBL;
@@ -700,7 +700,7 @@ static int load_pkcs12(BIO *err, BIO *in, const char *desc,
        if (p12 == NULL)
                {
                BIO_printf(err, "Error loading PKCS12 file for %s\n", desc);    
-               goto err;
+               goto die;
                }
        /* See if an empty password will do */
        if (PKCS12_verify_mac(p12, "", 0) || PKCS12_verify_mac(p12, NULL, 0))
@@ -714,7 +714,7 @@ static int load_pkcs12(BIO *err, BIO *in, const char *desc,
                        {
                        BIO_printf(err, "Passpharse callback error for %s\n",
                                        desc);
-                       goto err;
+                       goto die;
                        }
                if (len < PEM_BUFSIZE)
                        tpass[len] = 0;
@@ -722,12 +722,12 @@ static int load_pkcs12(BIO *err, BIO *in, const char *desc,
                        {
                        BIO_printf(err,
        "Mac verify error (wrong password?) in PKCS12 file for %s\n", desc);    
-                       goto err;
+                       goto die;
                        }
                pass = tpass;
                }
        ret = PKCS12_parse(p12, pass, pkey, cert, ca);
-       err:
+       die:
        if (p12)
                PKCS12_free(p12);
        return ret;
@@ -1269,7 +1269,7 @@ static int set_table_opts(unsigned long *flags, const char *arg, const NAME_EX_T
        return 0;
 }
 
-void print_name(BIO *out, char *title, X509_NAME *nm, unsigned long lflags)
+void print_name(BIO *out, const char *title, X509_NAME *nm, unsigned long lflags)
 {
        char *buf;
        char mline = 0;
@@ -1774,7 +1774,7 @@ int index_index(CA_DB *db)
        return 1;
        }
 
-int save_index(char *dbfile, char *suffix, CA_DB *db)
+int save_index(const char *dbfile, const char *suffix, CA_DB *db)
        {
        char buf[3][BSIZE];
        BIO *out = BIO_new(BIO_s_file());
@@ -1841,7 +1841,7 @@ int save_index(char *dbfile, char *suffix, CA_DB *db)
        return 0;
        }
 
-int rotate_index(char *dbfile, char *new_suffix, char *old_suffix)
+int rotate_index(const char *dbfile, const char *new_suffix, const char *old_suffix)
        {
        char buf[5][BSIZE];
        int i,j;
@@ -1979,7 +1979,7 @@ void free_index(CA_DB *db)
                }
        }
 
-int parse_yesno(char *str, int def)
+int parse_yesno(const char *str, int def)
        {
        int ret = def;
        if (str)
@@ -2146,7 +2146,7 @@ error:
 
 /* This code MUST COME AFTER anything that uses rename() */
 #ifdef OPENSSL_SYS_WIN32
-int WIN32_rename(char *from, char *to)
+int WIN32_rename(const char *from, const char *to)
        {
 #ifndef OPENSSL_SYS_WINCE
        /* Windows rename gives an error if 'to' exists, so delete it
@@ -2281,7 +2281,8 @@ int args_verify(char ***pargs, int *pargc,
 
        }
 
-static void nodes_print(BIO *out, char *name, STACK_OF(X509_POLICY_NODE) *nodes)
+static void nodes_print(BIO *out, const char *name,
+       STACK_OF(X509_POLICY_NODE) *nodes)
        {
        X509_POLICY_NODE *node;
        int i;