Get rid of more non-ANSI declarations.
authorUlf Möller <ulf@openssl.org>
Mon, 15 May 2000 22:54:43 +0000 (22:54 +0000)
committerUlf Möller <ulf@openssl.org>
Mon, 15 May 2000 22:54:43 +0000 (22:54 +0000)
33 files changed:
CHANGES
apps/ca.c
apps/pkcs12.c
crypto/bio/bf_buff.c
crypto/bio/bf_nbio.c
crypto/bio/bf_null.c
crypto/bio/bio.h
crypto/bio/bio_lib.c
crypto/bio/bss_acpt.c
crypto/bio/bss_bio.c
crypto/bio/bss_conn.c
crypto/bio/bss_file.c
crypto/bio/bss_log.c
crypto/bio/bss_mem.c
crypto/bio/bss_null.c
crypto/bio/bss_sock.c
crypto/evp/bio_b64.c
crypto/evp/bio_enc.c
crypto/evp/bio_md.c
crypto/evp/bio_ok.c
crypto/evp/evp_pbe.c
crypto/evp/evp_pkey.c
crypto/pkcs12/p12_crt.c
crypto/pkcs12/p12_kiss.c
crypto/pkcs12/p12_npas.c
crypto/pkcs7/pk7_mime.c
crypto/pkcs7/pk7_smime.c
crypto/stack/safestack.h
crypto/stack/stack.c
crypto/stack/stack.h
crypto/x509v3/v3_cpols.c
crypto/x509v3/v3_lib.c
ssl/bio_ssl.c

diff --git a/CHANGES b/CHANGES
index 3f55f9cc9dc171f850384c5e3d0475f743336558..ab8f8531fa6fb171ed43f5bf69881173a7ebec88 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -4,6 +4,9 @@
 
  Changes between 0.9.5a and 0.9.6  [xx XXX 2000]
 
 
  Changes between 0.9.5a and 0.9.6  [xx XXX 2000]
 
+  *) Eliminate non-ANSI declarations in crypto.h and stack.h.
+        [Ulf Möller]
+
   *) Fix for SSL server purpose checking. Server checking was
      rejecting certificates which had extended key usage present
      but no ssl client purpose.
   *) Fix for SSL server purpose checking. Server checking was
      rejecting certificates which had extended key usage present
      but no ssl client purpose.
index 73df13fe8e2a68a6cb30810117f0074d2073a5c2..7ab8c3b4f42d8d962bb3bca75e55de0291533cfe 100644 (file)
--- a/apps/ca.c
+++ b/apps/ca.c
@@ -1233,7 +1233,7 @@ err:
        BIO_free(out);
        BIO_free(in);
 
        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);
 
        if (ret) ERR_print_errors(bio_err);
        app_RAND_write_file(randfile, bio_err);
index baf5505ecb4db50217b6097c980341234318274f..0c03801afeb3b6fb3ff6b34adff4d6f6dd526587 100644 (file)
@@ -459,7 +459,7 @@ int MAIN(int argc, char **argv)
        /* Turn certbags into encrypted authsafe */
        authsafe = PKCS12_pack_p7encdata(cert_pbe, cpass, -1, NULL, 0,
                                                                 iter, bags);
        /* Turn certbags into encrypted authsafe */
        authsafe = PKCS12_pack_p7encdata(cert_pbe, cpass, -1, NULL, 0,
                                                                 iter, bags);
-       sk_pop_free(bags, PKCS12_SAFEBAG_free);
+       sk_pop_free(bags, (void(*)(void *)) PKCS12_SAFEBAG_free);
 
        if (!authsafe) {
                ERR_print_errors (bio_err);
 
        if (!authsafe) {
                ERR_print_errors (bio_err);
@@ -481,14 +481,14 @@ int MAIN(int argc, char **argv)
        sk_push (bags, (char *)bag);
        /* Turn it into unencrypted safe bag */
        authsafe = PKCS12_pack_p7data (bags);
        sk_push (bags, (char *)bag);
        /* Turn it into unencrypted safe bag */
        authsafe = PKCS12_pack_p7data (bags);
-       sk_pop_free(bags, PKCS12_SAFEBAG_free);
+       sk_pop_free(bags, (void(*)(void *)) PKCS12_SAFEBAG_free);
        sk_push (safes, (char *)authsafe);
 
        p12 = PKCS12_init (NID_pkcs7_data);
 
        M_PKCS12_pack_authsafes (p12, safes);
 
        sk_push (safes, (char *)authsafe);
 
        p12 = PKCS12_init (NID_pkcs7_data);
 
        M_PKCS12_pack_authsafes (p12, safes);
 
-       sk_pop_free(safes, PKCS7_free);
+       sk_pop_free(safes, (void(*)(void *)) PKCS7_free);
 
        PKCS12_set_mac (p12, mpass, -1, NULL, 0, maciter, NULL);
 
 
        PKCS12_set_mac (p12, mpass, -1, NULL, 0, maciter, NULL);
 
@@ -592,12 +592,12 @@ int dump_certs_keys_p12 (BIO *out, PKCS12 *p12, char *pass,
                if (!bags) return 0;
                if (!dump_certs_pkeys_bags (out, bags, pass, passlen, 
                                                 options, pempass)) {
                if (!bags) return 0;
                if (!dump_certs_pkeys_bags (out, bags, pass, passlen, 
                                                 options, pempass)) {
-                       sk_pop_free (bags, PKCS12_SAFEBAG_free);
+                       sk_pop_free (bags, (void(*)(void *)) PKCS12_SAFEBAG_free);
                        return 0;
                }
                        return 0;
                }
-               sk_pop_free (bags, PKCS12_SAFEBAG_free);
+               sk_pop_free (bags, (void(*)(void *)) PKCS12_SAFEBAG_free);
        }
        }
-       sk_pop_free (asafes, PKCS7_free);
+       sk_pop_free (asafes, (void(*)(void *)) PKCS7_free);
        return 1;
 }
 
        return 1;
 }
 
index ff0c9070ae101422ab094bb36d14e14553777f94..edffe92bce9b0dbf23447fc8918dd1fb45f71ce7 100644 (file)
 #include <openssl/bio.h>
 #include <openssl/evp.h>
 
 #include <openssl/bio.h>
 #include <openssl/evp.h>
 
-static int buffer_write(BIO *h,char *buf,int num);
-static int buffer_read(BIO *h,char *buf,int size);
-static int buffer_puts(BIO *h,char *str);
-static int buffer_gets(BIO *h,char *str,int size);
-static long buffer_ctrl(BIO *h,int cmd,long arg1,char *arg2);
+static int buffer_write(BIO *h, const char *buf,int num);
+static int buffer_read(BIO *h, char *buf, int size);
+static int buffer_puts(BIO *h, const char *str);
+static int buffer_gets(BIO *h, char *str, int size);
+static long buffer_ctrl(BIO *h, int cmd, long arg1, void *arg2);
 static int buffer_new(BIO *h);
 static int buffer_free(BIO *data);
 static int buffer_new(BIO *h);
 static int buffer_free(BIO *data);
-static long buffer_callback_ctrl(BIO *h,int cmd, void (*fp)());
+static long buffer_callback_ctrl(BIO *h, int cmd, void (*fp)());
 #define DEFAULT_BUFFER_SIZE    1024
 
 static BIO_METHOD methods_buffer=
 #define DEFAULT_BUFFER_SIZE    1024
 
 static BIO_METHOD methods_buffer=
@@ -195,7 +195,7 @@ start:
        goto start;
        }
 
        goto start;
        }
 
-static int buffer_write(BIO *b, char *in, int inl)
+static int buffer_write(BIO *b, const char *in, int inl)
        {
        int i,num=0;
        BIO_F_BUFFER_CTX *ctx;
        {
        int i,num=0;
        BIO_F_BUFFER_CTX *ctx;
@@ -268,7 +268,7 @@ start:
        goto start;
        }
 
        goto start;
        }
 
-static long buffer_ctrl(BIO *b, int cmd, long num, char *ptr)
+static long buffer_ctrl(BIO *b, int cmd, long num, void *ptr)
        {
        BIO *dbio;
        BIO_F_BUFFER_CTX *ctx;
        {
        BIO *dbio;
        BIO_F_BUFFER_CTX *ctx;
@@ -504,7 +504,7 @@ static int buffer_gets(BIO *b, char *buf, int size)
                }
        }
 
                }
        }
 
-static int buffer_puts(BIO *b, char *str)
+static int buffer_puts(BIO *b, const char *str)
        {
        return(BIO_write(b,str,strlen(str)));
        }
        {
        return(BIO_write(b,str,strlen(str)));
        }
index 5e574b7231648da8885fa1644f429a45e8a65f06..9b4bcb19d43792e04a1be8bb8b2bf7931c14c791 100644 (file)
 /* BIO_put and BIO_get both add to the digest,
  * BIO_gets returns the digest */
 
 /* BIO_put and BIO_get both add to the digest,
  * BIO_gets returns the digest */
 
-static int nbiof_write(BIO *h,char *buf,int num);
+static int nbiof_write(BIO *h,const char *buf,int num);
 static int nbiof_read(BIO *h,char *buf,int size);
 static int nbiof_read(BIO *h,char *buf,int size);
-static int nbiof_puts(BIO *h,char *str);
+static int nbiof_puts(BIO *h,const char *str);
 static int nbiof_gets(BIO *h,char *str,int size);
 static int nbiof_gets(BIO *h,char *str,int size);
-static long nbiof_ctrl(BIO *h,int cmd,long arg1,char *arg2);
+static long nbiof_ctrl(BIO *h,int cmd,long arg1,void *arg2);
 static int nbiof_new(BIO *h);
 static int nbiof_free(BIO *data);
 static long nbiof_callback_ctrl(BIO *h,int cmd,void (*fp)());
 static int nbiof_new(BIO *h);
 static int nbiof_free(BIO *data);
 static long nbiof_callback_ctrl(BIO *h,int cmd,void (*fp)());
@@ -159,7 +159,7 @@ static int nbiof_read(BIO *b, char *out, int outl)
        return(ret);
        }
 
        return(ret);
        }
 
-static int nbiof_write(BIO *b, char *in, int inl)
+static int nbiof_write(BIO *b, const char *in, int inl)
        {
        NBIO_TEST *nt;
        int ret=0;
        {
        NBIO_TEST *nt;
        int ret=0;
@@ -204,7 +204,7 @@ static int nbiof_write(BIO *b, char *in, int inl)
        return(ret);
        }
 
        return(ret);
        }
 
-static long nbiof_ctrl(BIO *b, int cmd, long num, char *ptr)
+static long nbiof_ctrl(BIO *b, int cmd, long num, void *ptr)
        {
        long ret;
 
        {
        long ret;
 
@@ -247,7 +247,7 @@ static int nbiof_gets(BIO *bp, char *buf, int size)
        }
 
 
        }
 
 
-static int nbiof_puts(BIO *bp, char *str)
+static int nbiof_puts(BIO *bp, const char *str)
        {
        if (bp->next_bio == NULL) return(0);
        return(BIO_puts(bp->next_bio,str));
        {
        if (bp->next_bio == NULL) return(0);
        return(BIO_puts(bp->next_bio,str));
index 0d183a6d9a46796e0b1d2000cb30795a9576144a..a3f0b02a7f2461c6ee1a58fe4e3143bbaf3ff270 100644 (file)
 /* BIO_put and BIO_get both add to the digest,
  * BIO_gets returns the digest */
 
 /* BIO_put and BIO_get both add to the digest,
  * BIO_gets returns the digest */
 
-static int nullf_write(BIO *h,char *buf,int num);
-static int nullf_read(BIO *h,char *buf,int size);
-static int nullf_puts(BIO *h,char *str);
-static int nullf_gets(BIO *h,char *str,int size);
-static long nullf_ctrl(BIO *h,int cmd,long arg1,char *arg2);
+static int nullf_write(BIO *h, const char *buf, int num);
+static int nullf_read(BIO *h, char *buf, int size);
+static int nullf_puts(BIO *h, const char *str);
+static int nullf_gets(BIO *h, char *str, int size);
+static long nullf_ctrl(BIO *h, int cmd, long arg1, void *arg2);
 static int nullf_new(BIO *h);
 static int nullf_free(BIO *data);
 static int nullf_new(BIO *h);
 static int nullf_free(BIO *data);
-static long nullf_callback_ctrl(BIO *h,int cmd,void (*fp)());
+static long nullf_callback_ctrl(BIO *h, int cmd, void (*fp)());
 static BIO_METHOD methods_nullf=
        {
        BIO_TYPE_NULL_FILTER,
 static BIO_METHOD methods_nullf=
        {
        BIO_TYPE_NULL_FILTER,
@@ -121,7 +121,7 @@ static int nullf_read(BIO *b, char *out, int outl)
        return(ret);
        }
 
        return(ret);
        }
 
-static int nullf_write(BIO *b, char *in, int inl)
+static int nullf_write(BIO *b, const char *in, int inl)
        {
        int ret=0;
 
        {
        int ret=0;
 
@@ -133,7 +133,7 @@ static int nullf_write(BIO *b, char *in, int inl)
        return(ret);
        }
 
        return(ret);
        }
 
-static long nullf_ctrl(BIO *b, int cmd, long num, char *ptr)
+static long nullf_ctrl(BIO *b, int cmd, long num, void *ptr)
        {
        long ret;
 
        {
        long ret;
 
@@ -175,7 +175,7 @@ static int nullf_gets(BIO *bp, char *buf, int size)
        }
 
 
        }
 
 
-static int nullf_puts(BIO *bp, char *str)
+static int nullf_puts(BIO *bp, const char *str)
        {
        if (bp->next_bio == NULL) return(0);
        return(BIO_puts(bp->next_bio,str));
        {
        if (bp->next_bio == NULL) return(0);
        return(BIO_puts(bp->next_bio,str));
index 37750726958e57466f9780f76c51db2a7e8be82e..0af44e60709941d8e5d68afd63497efbc2986b68 100644 (file)
@@ -207,19 +207,21 @@ extern "C" {
 #define BIO_method_name(b)             ((b)->method->name)
 #define BIO_method_type(b)             ((b)->method->type)
 
 #define BIO_method_name(b)             ((b)->method->name)
 #define BIO_method_type(b)             ((b)->method->type)
 
+typedef struct bio_st BIO;
+
 #ifndef WIN16
 typedef struct bio_method_st
        {
        int type;
        const char *name;
 #ifndef WIN16
 typedef struct bio_method_st
        {
        int type;
        const char *name;
-       int (*bwrite)();
-       int (*bread)();
-       int (*bputs)();
-       int (*bgets)();
-       long (*ctrl)();
-       int (*create)();
-       int (*destroy)();
-       long (*callback_ctrl)();
+       int (*bwrite)(BIO *, const char *, int);
+       int (*bread)(BIO *, char *, int);
+       int (*bputs)(BIO *, const char *);
+       int (*bgets)(BIO *, char *, int);
+       long (*ctrl)(BIO *, int, long, void *);
+       int (*create)(BIO *);
+       int (*destroy)(BIO *);
+       long (*callback_ctrl)(BIO *, int, void (*)(struct bio_st *, int, const char *, int, long, long));
        } BIO_METHOD;
 #else
 typedef struct bio_method_st
        } BIO_METHOD;
 #else
 typedef struct bio_method_st
@@ -237,7 +239,7 @@ typedef struct bio_method_st
        } BIO_METHOD;
 #endif
 
        } BIO_METHOD;
 #endif
 
-typedef struct bio_st
+struct bio_st
        {
        BIO_METHOD *method;
        /* bio, mode, argp, argi, argl, ret */
        {
        BIO_METHOD *method;
        /* bio, mode, argp, argi, argl, ret */
@@ -257,7 +259,7 @@ typedef struct bio_st
        unsigned long num_write;
 
        CRYPTO_EX_DATA ex_data;
        unsigned long num_write;
 
        CRYPTO_EX_DATA ex_data;
-       } BIO;
+       };
 
 typedef struct bio_f_buffer_ctx_struct
        {
 
 typedef struct bio_f_buffer_ctx_struct
        {
@@ -510,7 +512,7 @@ int BIO_gets(BIO *bp,char *buf, int size);
 int    BIO_write(BIO *b, const void *data, int len);
 int    BIO_puts(BIO *bp,const char *buf);
 long   BIO_ctrl(BIO *bp,int cmd,long larg,void *parg);
 int    BIO_write(BIO *b, const void *data, int len);
 int    BIO_puts(BIO *bp,const char *buf);
 long   BIO_ctrl(BIO *bp,int cmd,long larg,void *parg);
-long   BIO_callback_ctrl(BIO *bp,int cmd,void (*fp)());
+long BIO_callback_ctrl(BIO *b, int cmd, void (*fp)(struct bio_st *, int, const char *, int, long, long));
 char * BIO_ptr_ctrl(BIO *bp,int cmd,long larg);
 long   BIO_int_ctrl(BIO *bp,int cmd,long larg,int iarg);
 BIO *  BIO_push(BIO *b,BIO *append);
 char * BIO_ptr_ctrl(BIO *bp,int cmd,long larg);
 long   BIO_int_ctrl(BIO *bp,int cmd,long larg,int iarg);
 BIO *  BIO_push(BIO *b,BIO *append);
index e88dcc80f3db0df17ef8433ac8529dc37f8bbc23..00163f21bd35ebc72161f4912901b7ad7749c4dd 100644 (file)
@@ -317,7 +317,7 @@ long BIO_ctrl(BIO *b, int cmd, long larg, void *parg)
        return(ret);
        }
 
        return(ret);
        }
 
-long BIO_callback_ctrl(BIO *b, int cmd, void (*fp)())
+long BIO_callback_ctrl(BIO *b, int cmd, void (*fp)(struct bio_st *, int, const char *, int, long, long))
        {
        long ret;
        long (*cb)();
        {
        long ret;
        long (*cb)();
index 9afa6364069d9f7ac78f5cfb2c8a2bb4e657680c..09e8c90b536fac87ae20aa6c597418c2df6a0f78 100644 (file)
@@ -92,10 +92,10 @@ typedef struct bio_accept_st
        BIO *bio_chain;
        } BIO_ACCEPT;
 
        BIO *bio_chain;
        } BIO_ACCEPT;
 
-static int acpt_write(BIO *h,char *buf,int num);
-static int acpt_read(BIO *h,char *buf,int size);
-static int acpt_puts(BIO *h,char *str);
-static long acpt_ctrl(BIO *h,int cmd,long arg1,char *arg2);
+static int acpt_write(BIO *h, const char *buf, int num);
+static int acpt_read(BIO *h, char *buf, int size);
+static int acpt_puts(BIO *h, const char *str);
+static long acpt_ctrl(BIO *h, int cmd, long arg1, void *arg2);
 static int acpt_new(BIO *h);
 static int acpt_free(BIO *data);
 static int acpt_state(BIO *b, BIO_ACCEPT *c);
 static int acpt_new(BIO *h);
 static int acpt_free(BIO *data);
 static int acpt_state(BIO *b, BIO_ACCEPT *c);
@@ -307,7 +307,7 @@ static int acpt_read(BIO *b, char *out, int outl)
        return(ret);
        }
 
        return(ret);
        }
 
-static int acpt_write(BIO *b, char *in, int inl)
+static int acpt_write(BIO *b, const char *in, int inl)
        {
        int ret;
        BIO_ACCEPT *data;
        {
        int ret;
        BIO_ACCEPT *data;
@@ -326,7 +326,7 @@ static int acpt_write(BIO *b, char *in, int inl)
        return(ret);
        }
 
        return(ret);
        }
 
-static long acpt_ctrl(BIO *b, int cmd, long num, char *ptr)
+static long acpt_ctrl(BIO *b, int cmd, long num, void *ptr)
        {
        BIO *dbio;
        int *ip;
        {
        BIO *dbio;
        int *ip;
@@ -440,7 +440,7 @@ static long acpt_ctrl(BIO *b, int cmd, long num, char *ptr)
        return(ret);
        }
 
        return(ret);
        }
 
-static int acpt_puts(BIO *bp, char *str)
+static int acpt_puts(BIO *bp, const char *str)
        {
        int n,ret;
 
        {
        int n,ret;
 
index 1e2d7491f2ca7bbdc355e772196d8f91166212f5..94cc63c9fe6f94fda150ef3e79da746658188bf3 100644 (file)
@@ -30,9 +30,9 @@
 static int bio_new(BIO *bio);
 static int bio_free(BIO *bio);
 static int bio_read(BIO *bio, char *buf, int size);
 static int bio_new(BIO *bio);
 static int bio_free(BIO *bio);
 static int bio_read(BIO *bio, char *buf, int size);
-static int bio_write(BIO *bio, char *buf, int num);
+static int bio_write(BIO *bio, const char *buf, int num);
 static long bio_ctrl(BIO *bio, int cmd, long num, void *ptr);
 static long bio_ctrl(BIO *bio, int cmd, long num, void *ptr);
-static int bio_puts(BIO *bio, char *str);
+static int bio_puts(BIO *bio, const char *str);
 
 static int bio_make_pair(BIO *bio1, BIO *bio2);
 static void bio_destroy_pair(BIO *bio);
 
 static int bio_make_pair(BIO *bio1, BIO *bio2);
 static void bio_destroy_pair(BIO *bio);
@@ -283,7 +283,7 @@ static ssize_t bio_nread(BIO *bio, char **buf, size_t num_)
        }
 
 
        }
 
 
-static int bio_write(BIO *bio, char *buf, int num_)
+static int bio_write(BIO *bio, const char *buf, int num_)
        {
        size_t num = num_;
        size_t rest;
        {
        size_t num = num_;
        size_t rest;
@@ -628,7 +628,7 @@ static long bio_ctrl(BIO *bio, int cmd, long num, void *ptr)
        return ret;
        }
 
        return ret;
        }
 
-static int bio_puts(BIO *bio, char *str)
+static int bio_puts(BIO *bio, const char *str)
        {
        return bio_write(bio, str, strlen(str));
        }
        {
        return bio_write(bio, str, strlen(str));
        }
index 22d00b369ecbc2ec0923b0d1212507e950948e6f..f0466adca3045df42ac67fa254b766ef8e539095 100644 (file)
@@ -98,13 +98,13 @@ typedef struct bio_connect_st
        int (*info_callback)();
        } BIO_CONNECT;
 
        int (*info_callback)();
        } BIO_CONNECT;
 
-static int conn_write(BIO *h,char *buf,int num);
-static int conn_read(BIO *h,char *buf,int size);
-static int conn_puts(BIO *h,char *str);
-static long conn_ctrl(BIO *h,int cmd,long arg1,char *arg2);
+static int conn_write(BIO *h, const char *buf, int num);
+static int conn_read(BIO *h, char *buf, int size);
+static int conn_puts(BIO *h, const char *str);
+static long conn_ctrl(BIO *h, int cmd, long arg1, void *arg2);
 static int conn_new(BIO *h);
 static int conn_free(BIO *data);
 static int conn_new(BIO *h);
 static int conn_free(BIO *data);
-static long conn_callback_ctrl(BIO *h,int cmd,void *(*fp)());
+static long conn_callback_ctrl(BIO *h, int cmd, void (*fp)());
 
 static int conn_state(BIO *b, BIO_CONNECT *c);
 static void conn_close_socket(BIO *data);
 
 static int conn_state(BIO *b, BIO_CONNECT *c);
 static void conn_close_socket(BIO *data);
@@ -426,7 +426,7 @@ static int conn_read(BIO *b, char *out, int outl)
        return(ret);
        }
 
        return(ret);
        }
 
-static int conn_write(BIO *b, char *in, int inl)
+static int conn_write(BIO *b, const char *in, int inl)
        {
        int ret;
        BIO_CONNECT *data;
        {
        int ret;
        BIO_CONNECT *data;
@@ -449,7 +449,7 @@ static int conn_write(BIO *b, char *in, int inl)
        return(ret);
        }
 
        return(ret);
        }
 
-static long conn_ctrl(BIO *b, int cmd, long num, char *ptr)
+static long conn_ctrl(BIO *b, int cmd, long num, void *ptr)
        {
        BIO *dbio;
        int *ip;
        {
        BIO *dbio;
        int *ip;
@@ -519,9 +519,10 @@ static long conn_ctrl(BIO *b, int cmd, long num, char *ptr)
                        else if (num == 2)
                                {
                                char buf[16];
                        else if (num == 2)
                                {
                                char buf[16];
+                               char *p = ptr;
 
                                sprintf(buf,"%d.%d.%d.%d",
 
                                sprintf(buf,"%d.%d.%d.%d",
-                                       ptr[0],ptr[1],ptr[2],ptr[3]);
+                                       p[0],p[1],p[2],p[3]);
                                if (data->param_hostname != NULL)
                                        Free(data->param_hostname);
                                data->param_hostname=BUF_strdup(buf);
                                if (data->param_hostname != NULL)
                                        Free(data->param_hostname);
                                data->param_hostname=BUF_strdup(buf);
@@ -601,7 +602,7 @@ static long conn_ctrl(BIO *b, int cmd, long num, char *ptr)
        return(ret);
        }
 
        return(ret);
        }
 
-static long conn_callback_ctrl(BIO *b, int cmd, void *(*fp)())
+static long conn_callback_ctrl(BIO *b, int cmd, void (*fp)())
        {
        long ret=1;
        BIO_CONNECT *data;
        {
        long ret=1;
        BIO_CONNECT *data;
@@ -622,7 +623,7 @@ static long conn_callback_ctrl(BIO *b, int cmd, void *(*fp)())
        return(ret);
        }
 
        return(ret);
        }
 
-static int conn_puts(BIO *bp, char *str)
+static int conn_puts(BIO *bp, const char *str)
        {
        int n,ret;
 
        {
        int n,ret;
 
index 0d44dc388968975751f5d535277118b92be62b18..1f770b390f8f5f08efe710b30f9a329b7d9331ec 100644 (file)
 
 #if !defined(NO_STDIO)
 
 
 #if !defined(NO_STDIO)
 
-static int MS_CALLBACK file_write(BIO *h,char *buf,int num);
-static int MS_CALLBACK file_read(BIO *h,char *buf,int size);
-static int MS_CALLBACK file_puts(BIO *h,char *str);
-static int MS_CALLBACK file_gets(BIO *h,char *str,int size);
-static long MS_CALLBACK file_ctrl(BIO *h,int cmd,long arg1,char *arg2);
+static int MS_CALLBACK file_write(BIO *h, const char *buf, int num);
+static int MS_CALLBACK file_read(BIO *h, char *buf, int size);
+static int MS_CALLBACK file_puts(BIO *h, const char *str);
+static int MS_CALLBACK file_gets(BIO *h, char *str, int size);
+static long MS_CALLBACK file_ctrl(BIO *h, int cmd, long arg1, void *arg2);
 static int MS_CALLBACK file_new(BIO *h);
 static int MS_CALLBACK file_free(BIO *data);
 static BIO_METHOD methods_filep=
 static int MS_CALLBACK file_new(BIO *h);
 static int MS_CALLBACK file_free(BIO *data);
 static BIO_METHOD methods_filep=
@@ -163,7 +163,7 @@ static int MS_CALLBACK file_read(BIO *b, char *out, int outl)
        return(ret);
        }
 
        return(ret);
        }
 
-static int MS_CALLBACK file_write(BIO *b, char *in, int inl)
+static int MS_CALLBACK file_write(BIO *b, const char *in, int inl)
        {
        int ret=0;
 
        {
        int ret=0;
 
@@ -179,7 +179,7 @@ static int MS_CALLBACK file_write(BIO *b, char *in, int inl)
        return(ret);
        }
 
        return(ret);
        }
 
-static long MS_CALLBACK file_ctrl(BIO *b, int cmd, long num, char *ptr)
+static long MS_CALLBACK file_ctrl(BIO *b, int cmd, long num, void *ptr)
        {
        long ret=1;
        FILE *fp=(FILE *)b->ptr;
        {
        long ret=1;
        FILE *fp=(FILE *)b->ptr;
@@ -294,7 +294,7 @@ static int MS_CALLBACK file_gets(BIO *bp, char *buf, int size)
        return(ret);
        }
 
        return(ret);
        }
 
-static int MS_CALLBACK file_puts(BIO *bp, char *str)
+static int MS_CALLBACK file_puts(BIO *bp, const char *str)
        {
        int n,ret;
 
        {
        int n,ret;
 
index 497eb1af72bccd9acb4bd1961a9289ac387635ce..a8e01a0f930100f8b6d38d40db0b77bd5868f801 100644 (file)
 #define LOG_DAEMON     OPC$M_NM_NTWORK
 #endif
 
 #define LOG_DAEMON     OPC$M_NM_NTWORK
 #endif
 
-static int MS_CALLBACK slg_write(BIO *h,char *buf,int num);
-static int MS_CALLBACK slg_puts(BIO *h,char *str);
-static long MS_CALLBACK slg_ctrl(BIO *h,int cmd,long arg1,char *arg2);
+static int MS_CALLBACK slg_write(BIO *h, const char *buf, int num);
+static int MS_CALLBACK slg_puts(BIO *h, const char *str);
+static long MS_CALLBACK slg_ctrl(BIO *h, int cmd, long arg1, void *arg2);
 static int MS_CALLBACK slg_new(BIO *h);
 static int MS_CALLBACK slg_free(BIO *data);
 static void xopenlog(BIO* bp, const char* name, int level);
 static int MS_CALLBACK slg_new(BIO *h);
 static int MS_CALLBACK slg_free(BIO *data);
 static void xopenlog(BIO* bp, const char* name, int level);
@@ -153,10 +153,10 @@ static int MS_CALLBACK slg_free(BIO *a)
        return(1);
        }
        
        return(1);
        }
        
-static int MS_CALLBACK slg_write(BIO *b, char *in, int inl)
+static int MS_CALLBACK slg_write(BIO *b, const char *in, int inl)
        {
        int ret= inl;
        {
        int ret= inl;
-       char* buf= in;
+       char* buf;
        char* pp;
        int priority;
 
        char* pp;
        int priority;
 
@@ -186,7 +186,7 @@ static int MS_CALLBACK slg_write(BIO *b, char *in, int inl)
        return(ret);
        }
 
        return(ret);
        }
 
-static long MS_CALLBACK slg_ctrl(BIO *b, int cmd, long num, char *ptr)
+static long MS_CALLBACK slg_ctrl(BIO *b, int cmd, long num, void *ptr)
        {
        switch (cmd)
                {
        {
        switch (cmd)
                {
@@ -200,7 +200,7 @@ static long MS_CALLBACK slg_ctrl(BIO *b, int cmd, long num, char *ptr)
        return(0);
        }
 
        return(0);
        }
 
-static int MS_CALLBACK slg_puts(BIO *bp, char *str)
+static int MS_CALLBACK slg_puts(BIO *bp, const char *str)
        {
        int n,ret;
 
        {
        int n,ret;
 
index 41eab92415e2cbb38bf2db852490b162179cd2f7..f8c144accde22534537f985d23bc6b02d2cf20d7 100644 (file)
 #include "cryptlib.h"
 #include <openssl/bio.h>
 
 #include "cryptlib.h"
 #include <openssl/bio.h>
 
-static int mem_write(BIO *h,char *buf,int num);
-static int mem_read(BIO *h,char *buf,int size);
-static int mem_puts(BIO *h,char *str);
-static int mem_gets(BIO *h,char *str,int size);
-static long mem_ctrl(BIO *h,int cmd,long arg1,char *arg2);
+static int mem_write(BIO *h, const char *buf, int num);
+static int mem_read(BIO *h, char *buf, int size);
+static int mem_puts(BIO *h, const char *str);
+static int mem_gets(BIO *h, char *str, int size);
+static long mem_ctrl(BIO *h, int cmd, long arg1, void *arg2);
 static int mem_new(BIO *h);
 static int mem_free(BIO *data);
 static BIO_METHOD mem_method=
 static int mem_new(BIO *h);
 static int mem_free(BIO *data);
 static BIO_METHOD mem_method=
@@ -170,7 +170,7 @@ static int mem_read(BIO *b, char *out, int outl)
        return(ret);
        }
 
        return(ret);
        }
 
-static int mem_write(BIO *b, char *in, int inl)
+static int mem_write(BIO *b, const char *in, int inl)
        {
        int ret= -1;
        int blen;
        {
        int ret= -1;
        int blen;
@@ -198,7 +198,7 @@ end:
        return(ret);
        }
 
        return(ret);
        }
 
-static long mem_ctrl(BIO *b, int cmd, long num, char *ptr)
+static long mem_ctrl(BIO *b, int cmd, long num, void *ptr)
        {
        long ret=1;
        char **pptr;
        {
        long ret=1;
        char **pptr;
@@ -300,7 +300,7 @@ static int mem_gets(BIO *bp, char *buf, int size)
        return(ret);
        }
 
        return(ret);
        }
 
-static int mem_puts(BIO *bp, char *str)
+static int mem_puts(BIO *bp, const char *str)
        {
        int n,ret;
 
        {
        int n,ret;
 
index aee18e3ada46f50d8739e9da5f40124928e87ac8..46b73339dff8f5aebe6ea2ff6fe8553cdb82eb2a 100644 (file)
 #include "cryptlib.h"
 #include <openssl/bio.h>
 
 #include "cryptlib.h"
 #include <openssl/bio.h>
 
-static int null_write(BIO *h,char *buf,int num);
-static int null_read(BIO *h,char *buf,int size);
-static int null_puts(BIO *h,char *str);
-static int null_gets(BIO *h,char *str,int size);
-static long null_ctrl(BIO *h,int cmd,long arg1,char *arg2);
+static int null_write(BIO *h, const char *buf, int num);
+static int null_read(BIO *h, char *buf, int size);
+static int null_puts(BIO *h, const char *str);
+static int null_gets(BIO *h, char *str, int size);
+static long null_ctrl(BIO *h, int cmd, long arg1, void *arg2);
 static int null_new(BIO *h);
 static int null_free(BIO *data);
 static BIO_METHOD null_method=
 static int null_new(BIO *h);
 static int null_free(BIO *data);
 static BIO_METHOD null_method=
@@ -106,12 +106,12 @@ static int null_read(BIO *b, char *out, int outl)
        return(0);
        }
 
        return(0);
        }
 
-static int null_write(BIO *b, char *in, int inl)
+static int null_write(BIO *b, const char *in, int inl)
        {
        return(inl);
        }
 
        {
        return(inl);
        }
 
-static long null_ctrl(BIO *b, int cmd, long num, char *ptr)
+static long null_ctrl(BIO *b, int cmd, long num, void *ptr)
        {
        long ret=1;
 
        {
        long ret=1;
 
@@ -142,7 +142,7 @@ static int null_gets(BIO *bp, char *buf, int size)
        return(0);
        }
 
        return(0);
        }
 
-static int null_puts(BIO *bp, char *str)
+static int null_puts(BIO *bp, const char *str)
        {
        if (str == NULL) return(0);
        return(strlen(str));
        {
        if (str == NULL) return(0);
        return(strlen(str));
index 8ce80ef68d2b0ffa31acf20d307b4b8c46f56094..50c6744c0607a213fde9d0c07e0126486df14ecb 100644 (file)
 #include <openssl/bio.h>
 
 #ifndef BIO_FD
 #include <openssl/bio.h>
 
 #ifndef BIO_FD
-static int sock_write(BIO *h,char *buf,int num);
-static int sock_read(BIO *h,char *buf,int size);
-static int sock_puts(BIO *h,char *str);
-static long sock_ctrl(BIO *h,int cmd,long arg1,char *arg2);
+static int sock_write(BIO *h, const char *buf, int num);
+static int sock_read(BIO *h, char *buf, int size);
+static int sock_puts(BIO *h, const char *str);
+static long sock_ctrl(BIO *h, int cmd, long arg1, void *arg2);
 static int sock_new(BIO *h);
 static int sock_free(BIO *data);
 int BIO_sock_should_retry(int s);
 #else
 
 static int sock_new(BIO *h);
 static int sock_free(BIO *data);
 int BIO_sock_should_retry(int s);
 #else
 
-static int fd_write(BIO *h,char *buf,int num);
-static int fd_read(BIO *h,char *buf,int size);
-static int fd_puts(BIO *h,char *str);
-static long fd_ctrl(BIO *h,int cmd,long arg1,char *arg2);
+static int fd_write(BIO *h, const char *buf, int num);
+static int fd_read(BIO *h, char *buf, int size);
+static int fd_puts(BIO *h, const char *str);
+static long fd_ctrl(BIO *h, int cmd, long arg1, void *arg2);
 static int fd_new(BIO *h);
 static int fd_free(BIO *data);
 int BIO_fd_should_retry(int s);
 static int fd_new(BIO *h);
 static int fd_free(BIO *data);
 int BIO_fd_should_retry(int s);
@@ -209,9 +209,9 @@ static int fd_read(BIO *b, char *out,int outl)
        }
 
 #ifndef BIO_FD
        }
 
 #ifndef BIO_FD
-static int sock_write(BIO *b, char *in, int inl)
+static int sock_write(BIO *b, const char *in, int inl)
 #else
 #else
-static int fd_write(BIO *b, char *in, int inl)
+static int fd_write(BIO *b, const char *in, int inl)
 #endif
        {
        int ret;
 #endif
        {
        int ret;
@@ -237,9 +237,9 @@ static int fd_write(BIO *b, char *in, int inl)
        }
 
 #ifndef BIO_FD
        }
 
 #ifndef BIO_FD
-static long sock_ctrl(BIO *b, int cmd, long num, char *ptr)
+static long sock_ctrl(BIO *b, int cmd, long num, void *ptr)
 #else
 #else
-static long fd_ctrl(BIO *b, int cmd, long num, char *ptr)
+static long fd_ctrl(BIO *b, int cmd, long num, void *ptr)
 #endif
        {
        long ret=1;
 #endif
        {
        long ret=1;
@@ -313,9 +313,9 @@ static int sock_gets(BIO *bp, char *buf,int size)
 #endif
 
 #ifndef BIO_FD
 #endif
 
 #ifndef BIO_FD
-static int sock_puts(BIO *bp, char *str)
+static int sock_puts(BIO *bp, const char *str)
 #else
 #else
-static int fd_puts(BIO *bp, char *str)
+static int fd_puts(BIO *bp, const char *str)
 #endif
        {
        int n,ret;
 #endif
        {
        int n,ret;
index bd5e24f993985a966582fcf430a76dc4a6b5fa9f..e76387eaece4d5f453b4554b152762d3a275d2db 100644 (file)
 #include <openssl/buffer.h>
 #include <openssl/evp.h>
 
 #include <openssl/buffer.h>
 #include <openssl/evp.h>
 
-static int b64_write(BIO *h,char *buf,int num);
-static int b64_read(BIO *h,char *buf,int size);
-/*static int b64_puts(BIO *h,char *str); */
-/*static int b64_gets(BIO *h,char *str,int size); */
-static long b64_ctrl(BIO *h,int cmd,long arg1,char *arg2);
+static int b64_write(BIO *h, const char *buf, int num);
+static int b64_read(BIO *h, char *buf, int size);
+/*static int b64_puts(BIO *h, const char *str); */
+/*static int b64_gets(BIO *h, char *str, int size); */
+static long b64_ctrl(BIO *h, int cmd, long arg1, void *arg2);
 static int b64_new(BIO *h);
 static int b64_free(BIO *data);
 static long b64_callback_ctrl(BIO *h,int cmd,void (*fp)());
 static int b64_new(BIO *h);
 static int b64_free(BIO *data);
 static long b64_callback_ctrl(BIO *h,int cmd,void (*fp)());
@@ -340,7 +340,7 @@ static int b64_read(BIO *b, char *out, int outl)
        return((ret == 0)?ret_code:ret);
        }
 
        return((ret == 0)?ret_code:ret);
        }
 
-static int b64_write(BIO *b, char *in, int inl)
+static int b64_write(BIO *b, const char *in, int inl)
        {
        int ret=inl,n,i;
        BIO_B64_CTX *ctx;
        {
        int ret=inl,n,i;
        BIO_B64_CTX *ctx;
@@ -434,7 +434,7 @@ static int b64_write(BIO *b, char *in, int inl)
        return(ret);
        }
 
        return(ret);
        }
 
-static long b64_ctrl(BIO *b, int cmd, long num, char *ptr)
+static long b64_ctrl(BIO *b, int cmd, long num, void *ptr)
        {
        BIO_B64_CTX *ctx;
        long ret=1;
        {
        BIO_B64_CTX *ctx;
        long ret=1;
index 629bf4b95d9675db4d2e0fb21a548af3ccc3a0bc..1b7a21010c62329054795266481d56eb80922903 100644 (file)
 #include <openssl/buffer.h>
 #include <openssl/evp.h>
 
 #include <openssl/buffer.h>
 #include <openssl/evp.h>
 
-static int enc_write(BIO *h,char *buf,int num);
-static int enc_read(BIO *h,char *buf,int size);
-/*static int enc_puts(BIO *h,char *str); */
-/*static int enc_gets(BIO *h,char *str,int size); */
-static long enc_ctrl(BIO *h,int cmd,long arg1,char *arg2);
+static int enc_write(BIO *h, const char *buf, int num);
+static int enc_read(BIO *h, char *buf, int size);
+/*static int enc_puts(BIO *h, const char *str); */
+/*static int enc_gets(BIO *h, char *str, int size); */
+static long enc_ctrl(BIO *h, int cmd, long arg1, void *arg2);
 static int enc_new(BIO *h);
 static int enc_free(BIO *data);
 static int enc_new(BIO *h);
 static int enc_free(BIO *data);
-static long enc_callback_ctrl(BIO *h,int cmd,void (*fp)());
+static long enc_callback_ctrl(BIO *h, int cmd, void (*fp)());
 #define ENC_BLOCK_SIZE (1024*4)
 
 typedef struct enc_struct
 #define ENC_BLOCK_SIZE (1024*4)
 
 typedef struct enc_struct
@@ -224,7 +224,7 @@ static int enc_read(BIO *b, char *out, int outl)
        return((ret == 0)?ctx->cont:ret);
        }
 
        return((ret == 0)?ctx->cont:ret);
        }
 
-static int enc_write(BIO *b, char *in, int inl)
+static int enc_write(BIO *b, const char *in, int inl)
        {
        int ret=0,n,i;
        BIO_ENC_CTX *ctx;
        {
        int ret=0,n,i;
        BIO_ENC_CTX *ctx;
@@ -279,7 +279,7 @@ static int enc_write(BIO *b, char *in, int inl)
        return(ret);
        }
 
        return(ret);
        }
 
-static long enc_ctrl(BIO *b, int cmd, long num, char *ptr)
+static long enc_ctrl(BIO *b, int cmd, long num, void *ptr)
        {
        BIO *dbio;
        BIO_ENC_CTX *ctx,*dctx;
        {
        BIO *dbio;
        BIO_ENC_CTX *ctx,*dctx;
index aef928dd8fb2ee123fc9d547af28af79b0bfbc8d..f21319c04edf7544af3b3a51d89492860dc5e8aa 100644 (file)
 /* BIO_put and BIO_get both add to the digest,
  * BIO_gets returns the digest */
 
 /* BIO_put and BIO_get both add to the digest,
  * BIO_gets returns the digest */
 
-static int md_write(BIO *h,char *buf,int num);
-static int md_read(BIO *h,char *buf,int size);
-/*static int md_puts(BIO *h,char *str); */
-static int md_gets(BIO *h,char *str,int size);
-static long md_ctrl(BIO *h,int cmd,long arg1,char *arg2);
+static int md_write(BIO *h, char const *buf, int num);
+static int md_read(BIO *h, char *buf, int size);
+/*static int md_puts(BIO *h, const char *str); */
+static int md_gets(BIO *h, char *str, int size);
+static long md_ctrl(BIO *h, int cmd, long arg1, void *arg2);
 static int md_new(BIO *h);
 static int md_free(BIO *data);
 static long md_callback_ctrl(BIO *h,int cmd,void (*fp)());
 static int md_new(BIO *h);
 static int md_free(BIO *data);
 static long md_callback_ctrl(BIO *h,int cmd,void (*fp)());
@@ -139,7 +139,7 @@ static int md_read(BIO *b, char *out, int outl)
        return(ret);
        }
 
        return(ret);
        }
 
-static int md_write(BIO *b, char *in, int inl)
+static int md_write(BIO *b, const char *in, int inl)
        {
        int ret=0;
        EVP_MD_CTX *ctx;
        {
        int ret=0;
        EVP_MD_CTX *ctx;
@@ -162,7 +162,7 @@ static int md_write(BIO *b, char *in, int inl)
        return(ret);
        }
 
        return(ret);
        }
 
-static long md_ctrl(BIO *b, int cmd, long num, char *ptr)
+static long md_ctrl(BIO *b, int cmd, long num, void *ptr)
        {
        EVP_MD_CTX *ctx,*dctx,**pctx;
        const EVP_MD **ppmd;
        {
        EVP_MD_CTX *ctx,*dctx,**pctx;
        const EVP_MD **ppmd;
index e6ff5f2cdb6b2c4015088e7cb2c35031f00c5c33..4f9b703a36a65ff4404f91ac69a009feb9be8b83 100644 (file)
 #include <openssl/evp.h>
 #include <openssl/rand.h>
 
 #include <openssl/evp.h>
 #include <openssl/rand.h>
 
-static int ok_write(BIO *h,char *buf,int num);
-static int ok_read(BIO *h,char *buf,int size);
-static long ok_ctrl(BIO *h,int cmd,long arg1,char *arg2);
+static int ok_write(BIO *h, const char *buf, int num);
+static int ok_read(BIO *h, char *buf, int size);
+static long ok_ctrl(BIO *h, int cmd, long arg1, void *arg2);
 static int ok_new(BIO *h);
 static int ok_free(BIO *data);
 static int ok_new(BIO *h);
 static int ok_free(BIO *data);
-static long ok_callback_ctrl(BIO *h,int cmd,void (*fp)());
+static long ok_callback_ctrl(BIO *h, int cmd, void (*fp)());
 
 static void sig_out(BIO* b);
 static void sig_in(BIO* b);
 
 static void sig_out(BIO* b);
 static void sig_in(BIO* b);
@@ -287,7 +287,7 @@ static int ok_read(BIO *b, char *out, int outl)
        return(ret);
        }
 
        return(ret);
        }
 
-static int ok_write(BIO *b, char *in, int inl)
+static int ok_write(BIO *b, const char *in, int inl)
        {
        int ret=0,n,i;
        BIO_OK_CTX *ctx;
        {
        int ret=0,n,i;
        BIO_OK_CTX *ctx;
@@ -345,7 +345,7 @@ static int ok_write(BIO *b, char *in, int inl)
        return(ret);
        }
 
        return(ret);
        }
 
-static long ok_ctrl(BIO *b, int cmd, long num, char *ptr)
+static long ok_ctrl(BIO *b, int cmd, long num, void *ptr)
        {
        BIO_OK_CTX *ctx;
        EVP_MD *md;
        {
        BIO_OK_CTX *ctx;
        EVP_MD *md;
index 486b8880ce060a128e22d12990e69c23f9ffe466..187521eb58d34db0735bb689ba55a490df16f112 100644 (file)
@@ -115,7 +115,7 @@ int EVP_PBE_alg_add (int nid, EVP_CIPHER *cipher, EVP_MD *md,
             EVP_PBE_KEYGEN *keygen)
 {
        EVP_PBE_CTL *pbe_tmp;
             EVP_PBE_KEYGEN *keygen)
 {
        EVP_PBE_CTL *pbe_tmp;
-       if (!pbe_algs) pbe_algs = sk_new (pbe_cmp);
+       if (!pbe_algs) pbe_algs = sk_new ((int (*)())pbe_cmp);
        if (!(pbe_tmp = (EVP_PBE_CTL*) Malloc (sizeof(EVP_PBE_CTL)))) {
                EVPerr(EVP_F_EVP_PBE_ALG_ADD,ERR_R_MALLOC_FAILURE);
                return 0;
        if (!(pbe_tmp = (EVP_PBE_CTL*) Malloc (sizeof(EVP_PBE_CTL)))) {
                EVPerr(EVP_F_EVP_PBE_ALG_ADD,ERR_R_MALLOC_FAILURE);
                return 0;
index 4ab091fa564dece54c371763825bca5f7b8e6788..aada99f7472a5655edb621b6364b18218b352a8e 100644 (file)
@@ -193,12 +193,12 @@ EVP_PKEY *EVP_PKCS82PKEY (PKCS8_PRIV_KEY_INFO *p8)
 
                EVP_PKEY_assign_DSA(pkey, dsa);
                BN_CTX_free (ctx);
 
                EVP_PKEY_assign_DSA(pkey, dsa);
                BN_CTX_free (ctx);
-               if(ndsa) sk_pop_free(ndsa, ASN1_TYPE_free);
+               if(ndsa) sk_pop_free(ndsa, (void(*)(void *)) ASN1_TYPE_free);
                else ASN1_INTEGER_free(privkey);
                break;
                dsaerr:
                BN_CTX_free (ctx);
                else ASN1_INTEGER_free(privkey);
                break;
                dsaerr:
                BN_CTX_free (ctx);
-               sk_pop_free(ndsa, ASN1_TYPE_free);
+               sk_pop_free(ndsa, (void(*)(void *)) ASN1_TYPE_free);
                DSA_free(dsa);
                EVP_PKEY_free(pkey);
                return NULL;
                DSA_free(dsa);
                EVP_PKEY_free(pkey);
                return NULL;
@@ -367,11 +367,11 @@ static int dsa_pkey2pkcs8(PKCS8_PRIV_KEY_INFO *p8, EVP_PKEY *pkey)
                                         &p8->pkey->value.octet_string->length)) {
 
                        EVPerr(EVP_F_EVP_PKEY2PKCS8,ERR_R_MALLOC_FAILURE);
                                         &p8->pkey->value.octet_string->length)) {
 
                        EVPerr(EVP_F_EVP_PKEY2PKCS8,ERR_R_MALLOC_FAILURE);
-                       sk_pop_free(ndsa, ASN1_TYPE_free);
+                       sk_pop_free(ndsa, (void(*)(void *)) ASN1_TYPE_free);
                        M_ASN1_INTEGER_free(prkey);
                        return 0;
                }
                        M_ASN1_INTEGER_free(prkey);
                        return 0;
                }
-               sk_pop_free(ndsa, ASN1_TYPE_free);
+               sk_pop_free(ndsa, (void(*)(void *)) ASN1_TYPE_free);
                break;
 
                case PKCS8_EMBEDDED_PARAM:
                break;
 
                case PKCS8_EMBEDDED_PARAM:
@@ -395,11 +395,11 @@ static int dsa_pkey2pkcs8(PKCS8_PRIV_KEY_INFO *p8, EVP_PKEY *pkey)
                                         &p8->pkey->value.octet_string->length)) {
 
                        EVPerr(EVP_F_EVP_PKEY2PKCS8,ERR_R_MALLOC_FAILURE);
                                         &p8->pkey->value.octet_string->length)) {
 
                        EVPerr(EVP_F_EVP_PKEY2PKCS8,ERR_R_MALLOC_FAILURE);
-                       sk_pop_free(ndsa, ASN1_TYPE_free);
+                       sk_pop_free(ndsa, (void(*)(void *)) ASN1_TYPE_free);
                        M_ASN1_INTEGER_free (prkey);
                        return 0;
                }
                        M_ASN1_INTEGER_free (prkey);
                        return 0;
                }
-               sk_pop_free(ndsa, ASN1_TYPE_free);
+               sk_pop_free(ndsa, (void(*)(void *)) ASN1_TYPE_free);
                break;
        }
        return 1;
                break;
        }
        return 1;
index ee8aed54c77e1cfbf48308fc940c3ed3efef32d9..a60b128a3bde260a6b09a314504898fb5942f1fa 100644 (file)
@@ -116,7 +116,7 @@ PKCS12 *PKCS12_create(char *pass, char *name, EVP_PKEY *pkey, X509 *cert,
        /* Turn certbags into encrypted authsafe */
        authsafe = PKCS12_pack_p7encdata (nid_cert, pass, -1, NULL, 0,
                                          iter, bags);
        /* Turn certbags into encrypted authsafe */
        authsafe = PKCS12_pack_p7encdata (nid_cert, pass, -1, NULL, 0,
                                          iter, bags);
-       sk_pop_free(bags, PKCS12_SAFEBAG_free);
+       sk_pop_free(bags, (void(*)(void *)) PKCS12_SAFEBAG_free);
 
        if (!authsafe) return NULL;
 
 
        if (!authsafe) return NULL;
 
@@ -139,7 +139,7 @@ PKCS12 *PKCS12_create(char *pass, char *name, EVP_PKEY *pkey, X509 *cert,
        }
        /* Turn it into unencrypted safe bag */
        if(!(authsafe = PKCS12_pack_p7data (bags))) return NULL;
        }
        /* Turn it into unencrypted safe bag */
        if(!(authsafe = PKCS12_pack_p7data (bags))) return NULL;
-       sk_pop_free(bags, PKCS12_SAFEBAG_free);
+       sk_pop_free(bags, (void(*)(void *)) PKCS12_SAFEBAG_free);
        if(!sk_push(safes, (char *)authsafe)) {
                PKCS12err(PKCS12_F_PKCS12_CREATE,ERR_R_MALLOC_FAILURE);
                return NULL;
        if(!sk_push(safes, (char *)authsafe)) {
                PKCS12err(PKCS12_F_PKCS12_CREATE,ERR_R_MALLOC_FAILURE);
                return NULL;
@@ -149,7 +149,7 @@ PKCS12 *PKCS12_create(char *pass, char *name, EVP_PKEY *pkey, X509 *cert,
 
        if(!M_PKCS12_pack_authsafes (p12, safes)) return NULL;
 
 
        if(!M_PKCS12_pack_authsafes (p12, safes)) return NULL;
 
-       sk_pop_free(safes, PKCS7_free);
+       sk_pop_free(safes, (void(*)(void *)) PKCS7_free);
 
        if(!PKCS12_set_mac (p12, pass, -1, NULL, 0, mac_iter, NULL))
            return NULL;
 
        if(!PKCS12_set_mac (p12, pass, -1, NULL, 0, mac_iter, NULL))
            return NULL;
index 61c865b9348b7879cb852a3021a8bbd74e4fb807..2ebaecf79f9d05bf546d7dfa8d56ed16c7184038 100644 (file)
@@ -161,18 +161,18 @@ static int parse_pk12 (PKCS12 *p12, const char *pass, int passlen,
                        bags = M_PKCS12_unpack_p7encdata (p7, pass, passlen);
                } else continue;
                if (!bags) {
                        bags = M_PKCS12_unpack_p7encdata (p7, pass, passlen);
                } else continue;
                if (!bags) {
-                       sk_pop_free (asafes, PKCS7_free);
+                       sk_pop_free (asafes, (void(*)(void *)) PKCS7_free);
                        return 0;
                }
                if (!parse_bags(bags, pass, passlen, pkey, cert, ca,
                                                         &keyid, &keymatch)) {
                        return 0;
                }
                if (!parse_bags(bags, pass, passlen, pkey, cert, ca,
                                                         &keyid, &keymatch)) {
-                       sk_pop_free(bags, PKCS12_SAFEBAG_free);
-                       sk_pop_free(asafes, PKCS7_free);
+                       sk_pop_free(bags, (void(*)(void *)) PKCS12_SAFEBAG_free);
+                       sk_pop_free(asafes, (void(*)(void *)) PKCS7_free);
                        return 0;
                }
                        return 0;
                }
-               sk_pop_free(bags, PKCS12_SAFEBAG_free);
+               sk_pop_free(bags, (void(*)(void *)) PKCS12_SAFEBAG_free);
        }
        }
-       sk_pop_free(asafes, PKCS7_free);
+       sk_pop_free(asafes, (void(*)(void *)) PKCS7_free);
        if (keyid) M_ASN1_OCTET_STRING_free(keyid);
        return 1;
 }
        if (keyid) M_ASN1_OCTET_STRING_free(keyid);
        return 1;
 }
index ee71707e2c1105fcad40ca69d0d3d38de5638443..4fb0cf74ab6c558fe1619e523307bd1d02bae503 100644 (file)
@@ -123,26 +123,26 @@ static int newpass_p12(PKCS12 *p12, char *oldpass, char *newpass)
                                &pbe_nid, &pbe_iter, &pbe_saltlen);
                } else continue;
                if (!bags) {
                                &pbe_nid, &pbe_iter, &pbe_saltlen);
                } else continue;
                if (!bags) {
-                       sk_pop_free(asafes, PKCS7_free);
+                       sk_pop_free(asafes, (void(*)(void *)) PKCS7_free);
                        return 0;
                }
                if (!newpass_bags(bags, oldpass, newpass)) {
                        return 0;
                }
                if (!newpass_bags(bags, oldpass, newpass)) {
-                       sk_pop_free(bags, PKCS12_SAFEBAG_free);
-                       sk_pop_free(asafes, PKCS7_free);
+                       sk_pop_free(bags, (void(*)(void *)) PKCS12_SAFEBAG_free);
+                       sk_pop_free(asafes, (void(*)(void *)) PKCS7_free);
                        return 0;
                }
                /* Repack bag in same form with new password */
                if (bagnid == NID_pkcs7_data) p7new = PKCS12_pack_p7data(bags);
                else p7new = PKCS12_pack_p7encdata(pbe_nid, newpass, -1, NULL,
                                                 pbe_saltlen, pbe_iter, bags);
                        return 0;
                }
                /* Repack bag in same form with new password */
                if (bagnid == NID_pkcs7_data) p7new = PKCS12_pack_p7data(bags);
                else p7new = PKCS12_pack_p7encdata(pbe_nid, newpass, -1, NULL,
                                                 pbe_saltlen, pbe_iter, bags);
-               sk_pop_free(bags, PKCS12_SAFEBAG_free);
+               sk_pop_free(bags, (void(*)(void *)) PKCS12_SAFEBAG_free);
                if(!p7new) {
                if(!p7new) {
-                       sk_pop_free(asafes, PKCS7_free);
+                       sk_pop_free(asafes, (void(*)(void *)) PKCS7_free);
                        return 0;
                }
                sk_push(newsafes, (char *)p7new);
        }
                        return 0;
                }
                sk_push(newsafes, (char *)p7new);
        }
-       sk_pop_free(asafes, PKCS7_free);
+       sk_pop_free(asafes, (void(*)(void *)) PKCS7_free);
 
        /* Repack safe: save old safe in case of error */
 
 
        /* Repack safe: save old safe in case of error */
 
index 734643be2874f5e013356505c9dba5407c8c9fb4..8981f9f2136cf5ec204b04a6ec279a79463cc8c4 100644 (file)
@@ -211,7 +211,7 @@ PKCS7 *SMIME_read_PKCS7(BIO *bio, BIO **bcont)
        }
 
        if(!(hdr = mime_hdr_find(headers, "content-type")) || !hdr->value) {
        }
 
        if(!(hdr = mime_hdr_find(headers, "content-type")) || !hdr->value) {
-               sk_pop_free(headers, mime_hdr_free);
+               sk_pop_free(headers, (void(*)(void *)) mime_hdr_free);
                PKCS7err(PKCS7_F_SMIME_READ_PKCS7, PKCS7_R_NO_CONTENT_TYPE);
                return NULL;
        }
                PKCS7err(PKCS7_F_SMIME_READ_PKCS7, PKCS7_R_NO_CONTENT_TYPE);
                return NULL;
        }
@@ -222,15 +222,15 @@ PKCS7 *SMIME_read_PKCS7(BIO *bio, BIO **bcont)
                /* Split into two parts */
                prm = mime_param_find(hdr, "boundary");
                if(!prm || !prm->param_value) {
                /* Split into two parts */
                prm = mime_param_find(hdr, "boundary");
                if(!prm || !prm->param_value) {
-                       sk_pop_free(headers, mime_hdr_free);
+                       sk_pop_free(headers, (void(*)(void *)) mime_hdr_free);
                        PKCS7err(PKCS7_F_SMIME_READ_PKCS7, PKCS7_R_NO_MULTIPART_BOUNDARY);
                        return NULL;
                }
                ret = multi_split(bio, prm->param_value, &parts);
                        PKCS7err(PKCS7_F_SMIME_READ_PKCS7, PKCS7_R_NO_MULTIPART_BOUNDARY);
                        return NULL;
                }
                ret = multi_split(bio, prm->param_value, &parts);
-               sk_pop_free(headers, mime_hdr_free);
+               sk_pop_free(headers, (void(*)(void *)) mime_hdr_free);
                if(!ret || (sk_num(parts) != 2) ) {
                        PKCS7err(PKCS7_F_SMIME_READ_PKCS7, PKCS7_R_NO_MULTIPART_BODY_FAILURE);
                if(!ret || (sk_num(parts) != 2) ) {
                        PKCS7err(PKCS7_F_SMIME_READ_PKCS7, PKCS7_R_NO_MULTIPART_BODY_FAILURE);
-                       sk_pop_free(parts, (stkfree)BIO_free);
+                       sk_pop_free(parts, (void(*)(void *)) BIO_free);
                        return NULL;
                }
 
                        return NULL;
                }
 
@@ -239,7 +239,7 @@ PKCS7 *SMIME_read_PKCS7(BIO *bio, BIO **bcont)
 
                if (!(headers = mime_parse_hdr(p7in))) {
                        PKCS7err(PKCS7_F_SMIME_READ_PKCS7,PKCS7_R_MIME_SIG_PARSE_ERROR);
 
                if (!(headers = mime_parse_hdr(p7in))) {
                        PKCS7err(PKCS7_F_SMIME_READ_PKCS7,PKCS7_R_MIME_SIG_PARSE_ERROR);
-                       sk_pop_free(parts, (stkfree)BIO_free);
+                       sk_pop_free(parts, (void(*)(void *)) BIO_free);
                        return NULL;
                }
 
                        return NULL;
                }
 
@@ -247,24 +247,24 @@ PKCS7 *SMIME_read_PKCS7(BIO *bio, BIO **bcont)
 
                if(!(hdr = mime_hdr_find(headers, "content-type")) ||
                                                                 !hdr->value) {
 
                if(!(hdr = mime_hdr_find(headers, "content-type")) ||
                                                                 !hdr->value) {
-                       sk_pop_free(headers, mime_hdr_free);
+                       sk_pop_free(headers, (void(*)(void *)) mime_hdr_free);
                        PKCS7err(PKCS7_F_SMIME_READ_PKCS7, PKCS7_R_NO_SIG_CONTENT_TYPE);
                        return NULL;
                }
 
                if(strcmp(hdr->value, "application/x-pkcs7-signature") &&
                        strcmp(hdr->value, "application/pkcs7-signature")) {
                        PKCS7err(PKCS7_F_SMIME_READ_PKCS7, PKCS7_R_NO_SIG_CONTENT_TYPE);
                        return NULL;
                }
 
                if(strcmp(hdr->value, "application/x-pkcs7-signature") &&
                        strcmp(hdr->value, "application/pkcs7-signature")) {
-                       sk_pop_free(headers, mime_hdr_free);
+                       sk_pop_free(headers, (void(*)(void *)) mime_hdr_free);
                        PKCS7err(PKCS7_F_SMIME_READ_PKCS7,PKCS7_R_SIG_INVALID_MIME_TYPE);
                        ERR_add_error_data(2, "type: ", hdr->value);
                        PKCS7err(PKCS7_F_SMIME_READ_PKCS7,PKCS7_R_SIG_INVALID_MIME_TYPE);
                        ERR_add_error_data(2, "type: ", hdr->value);
-                       sk_pop_free(parts, (stkfree)BIO_free);
+                       sk_pop_free(parts, (void(*)(void *))BIO_free);
                        return NULL;
                }
                        return NULL;
                }
-               sk_pop_free(headers, mime_hdr_free);
+               sk_pop_free(headers, (void(*)(void *)) mime_hdr_free);
                /* Read in PKCS#7 */
                if(!(p7 = B64_read_PKCS7(p7in))) {
                        PKCS7err(PKCS7_F_SMIME_READ_PKCS7,PKCS7_R_PKCS7_SIG_PARSE_ERROR);
                /* Read in PKCS#7 */
                if(!(p7 = B64_read_PKCS7(p7in))) {
                        PKCS7err(PKCS7_F_SMIME_READ_PKCS7,PKCS7_R_PKCS7_SIG_PARSE_ERROR);
-                       sk_pop_free(parts, (stkfree)BIO_free);
+                       sk_pop_free(parts, (void(*)(void *))BIO_free);
                        return NULL;
                }
 
                        return NULL;
                }
 
@@ -282,11 +282,11 @@ PKCS7 *SMIME_read_PKCS7(BIO *bio, BIO **bcont)
            strcmp (hdr->value, "application/pkcs7-mime")) {
                PKCS7err(PKCS7_F_SMIME_READ_PKCS7,PKCS7_R_INVALID_MIME_TYPE);
                ERR_add_error_data(2, "type: ", hdr->value);
            strcmp (hdr->value, "application/pkcs7-mime")) {
                PKCS7err(PKCS7_F_SMIME_READ_PKCS7,PKCS7_R_INVALID_MIME_TYPE);
                ERR_add_error_data(2, "type: ", hdr->value);
-               sk_pop_free(headers, mime_hdr_free);
+               sk_pop_free(headers, (void(*)(void *)) mime_hdr_free);
                return NULL;
        }
 
                return NULL;
        }
 
-       sk_pop_free(headers, mime_hdr_free);
+       sk_pop_free(headers, (void(*)(void *)) mime_hdr_free);
        
        if(!(p7 = B64_read_PKCS7(bio))) {
                PKCS7err(PKCS7_F_SMIME_READ_PKCS7, PKCS7_R_PKCS7_PARSE_ERROR);
        
        if(!(p7 = B64_read_PKCS7(bio))) {
                PKCS7err(PKCS7_F_SMIME_READ_PKCS7, PKCS7_R_PKCS7_PARSE_ERROR);
@@ -333,16 +333,16 @@ int SMIME_text(BIO *in, BIO *out)
        }
        if(!(hdr = mime_hdr_find(headers, "content-type")) || !hdr->value) {
                PKCS7err(PKCS7_F_SMIME_TEXT,PKCS7_R_MIME_NO_CONTENT_TYPE);
        }
        if(!(hdr = mime_hdr_find(headers, "content-type")) || !hdr->value) {
                PKCS7err(PKCS7_F_SMIME_TEXT,PKCS7_R_MIME_NO_CONTENT_TYPE);
-               sk_pop_free(headers, mime_hdr_free);
+               sk_pop_free(headers, (void(*)(void *)) mime_hdr_free);
                return 0;
        }
        if (strcmp (hdr->value, "text/plain")) {
                PKCS7err(PKCS7_F_SMIME_TEXT,PKCS7_R_INVALID_MIME_TYPE);
                ERR_add_error_data(2, "type: ", hdr->value);
                return 0;
        }
        if (strcmp (hdr->value, "text/plain")) {
                PKCS7err(PKCS7_F_SMIME_TEXT,PKCS7_R_INVALID_MIME_TYPE);
                ERR_add_error_data(2, "type: ", hdr->value);
-               sk_pop_free(headers, mime_hdr_free);
+               sk_pop_free(headers, (void(*)(void *)) mime_hdr_free);
                return 0;
        }
                return 0;
        }
-       sk_pop_free(headers, mime_hdr_free);
+       sk_pop_free(headers, (void(*)(void *)) mime_hdr_free);
        while ((len = BIO_read(in, iobuf, sizeof(iobuf))) > 0)
                                                BIO_write(out, iobuf, len);
        return 1;
        while ((len = BIO_read(in, iobuf, sizeof(iobuf))) > 0)
                                                BIO_write(out, iobuf, len);
        return 1;
@@ -413,7 +413,7 @@ static STACK *mime_parse_hdr(BIO *bio)
        MIME_HEADER *mhdr = NULL;
        STACK *headers;
        int len, state, save_state = 0;
        MIME_HEADER *mhdr = NULL;
        STACK *headers;
        int len, state, save_state = 0;
-       headers = sk_new(mime_hdr_cmp);
+       headers = sk_new((int (*)(const void *, const void *))mime_hdr_cmp);
        while ((len = BIO_gets(bio, linebuf, MAX_SMLEN)) > 0) {
        /* If whitespace at line start then continuation line */
        if(mhdr && isspace((unsigned char)linebuf[0])) state = MIME_NAME;
        while ((len = BIO_gets(bio, linebuf, MAX_SMLEN)) > 0) {
        /* If whitespace at line start then continuation line */
        if(mhdr && isspace((unsigned char)linebuf[0])) state = MIME_NAME;
@@ -573,7 +573,7 @@ static MIME_HEADER *mime_hdr_new(char *name, char *value)
        if(!mhdr) return NULL;
        mhdr->name = tmpname;
        mhdr->value = tmpval;
        if(!mhdr) return NULL;
        mhdr->name = tmpname;
        mhdr->value = tmpval;
-       if(!(mhdr->params = sk_new(mime_param_cmp))) return NULL;
+       if(!(mhdr->params = sk_new((int (*)(const void *, const void *)) mime_param_cmp))) return NULL;
        return mhdr;
 }
                
        return mhdr;
 }
                
@@ -642,7 +642,7 @@ static void mime_hdr_free(MIME_HEADER *hdr)
 {
        if(hdr->name) Free(hdr->name);
        if(hdr->value) Free(hdr->value);
 {
        if(hdr->name) Free(hdr->name);
        if(hdr->value) Free(hdr->value);
-       if(hdr->params) sk_pop_free(hdr->params, mime_param_free);
+       if(hdr->params) sk_pop_free(hdr->params, (void(*)(void *)) mime_param_free);
        Free(hdr);
 }
 
        Free(hdr);
 }
 
index b41f42ed04467216821c62a4e257d18eeaaf26ab..0a9f5a86ae74b158276533b63f127362d32022f8 100644 (file)
@@ -127,7 +127,7 @@ PKCS7 *PKCS7_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs,
                PKCS7_simple_smimecap (smcap, NID_rc2_cbc, 40);
 #endif
                PKCS7_add_attrib_smimecap (si, smcap);
                PKCS7_simple_smimecap (smcap, NID_rc2_cbc, 40);
 #endif
                PKCS7_add_attrib_smimecap (si, smcap);
-               sk_pop_free(smcap, X509_ALGOR_free);
+               sk_pop_free(smcap, (void(*)(void *)) X509_ALGOR_free);
        }
 
        if(flags & PKCS7_DETACHED)PKCS7_set_detached(p7, 1);
        }
 
        if(flags & PKCS7_DETACHED)PKCS7_set_detached(p7, 1);
index 38934981e3f431fe5527f4b36cbc7e045637f2ee..c3b2dd799dd3bde22fb06e9554d317d924b19f2c 100644 (file)
@@ -87,7 +87,7 @@ void sk_##type##_sort(STACK_OF(type) *sk);
 
 #define IMPLEMENT_STACK_OF(type) \
 STACK_OF(type) *sk_##type##_new(int (*cmp)(type **,type **)) \
 
 #define IMPLEMENT_STACK_OF(type) \
 STACK_OF(type) *sk_##type##_new(int (*cmp)(type **,type **)) \
-    { return (STACK_OF(type) *)sk_new(cmp); } \
+    { return (STACK_OF(type) *)sk_new((int (*)())cmp); } \
 STACK_OF(type) *sk_##type##_new_null() \
     { return (STACK_OF(type) *)sk_new_null(); } \
 void sk_##type##_free(STACK_OF(type) *sk) \
 STACK_OF(type) *sk_##type##_new_null() \
     { return (STACK_OF(type) *)sk_new_null(); } \
 void sk_##type##_free(STACK_OF(type) *sk) \
@@ -114,11 +114,11 @@ int sk_##type##_insert(STACK_OF(type) *sk,type *v,int n) \
     { return sk_insert((STACK *)sk,(char *)v,n); } \
 int (*sk_##type##_set_cmp_func(STACK_OF(type) *sk, \
                               int (*cmp)(type **,type **)))(type **,type **) \
     { return sk_insert((STACK *)sk,(char *)v,n); } \
 int (*sk_##type##_set_cmp_func(STACK_OF(type) *sk, \
                               int (*cmp)(type **,type **)))(type **,type **) \
-    { return (int (*)(type **,type **))sk_set_cmp_func((STACK *)sk,cmp); } \
+    { return (int (*)(type **,type **))sk_set_cmp_func((STACK *)sk,(int(*)(const void *, const void *))cmp); } \
 STACK_OF(type) *sk_##type##_dup(STACK_OF(type) *sk) \
     { return (STACK_OF(type) *)sk_dup((STACK *)sk); } \
 void sk_##type##_pop_free(STACK_OF(type) *sk,void (*func)(type *)) \
 STACK_OF(type) *sk_##type##_dup(STACK_OF(type) *sk) \
     { return (STACK_OF(type) *)sk_dup((STACK *)sk); } \
 void sk_##type##_pop_free(STACK_OF(type) *sk,void (*func)(type *)) \
-    { sk_pop_free((STACK *)sk,func); } \
+    { sk_pop_free((STACK *)sk,(void (*)(void *))func); } \
 type *sk_##type##_shift(STACK_OF(type) *sk) \
     { return (type *)sk_shift((STACK *)sk); } \
 type *sk_##type##_pop(STACK_OF(type) *sk) \
 type *sk_##type##_shift(STACK_OF(type) *sk) \
     { return (type *)sk_shift((STACK *)sk); } \
 type *sk_##type##_pop(STACK_OF(type) *sk) \
index 58e9126339b6fef47cf135d2e52a5327c8ad929d..3e2f4d8786329f996bac473ad35620368a07980a 100644 (file)
 
 const char *STACK_version="Stack" OPENSSL_VERSION_PTEXT;
 
 
 const char *STACK_version="Stack" OPENSSL_VERSION_PTEXT;
 
-#define        FP_ICC  (int (*)(const void *,const void *))
 #include <errno.h>
 
 #include <errno.h>
 
-int (*sk_set_cmp_func(STACK *sk, int (*c)()))(void)
+int (*sk_set_cmp_func(STACK *sk, int (*c)(const void *,const void *)))(const void *, const void *)
        {
        {
-       int (*old)()=sk->comp;
+       int (*old)(const void *,const void *)=sk->comp;
 
        if (sk->comp != c)
                sk->sorted=0;
 
        if (sk->comp != c)
                sk->sorted=0;
@@ -109,7 +108,7 @@ err:
        return(NULL);
        }
 
        return(NULL);
        }
 
-STACK *sk_new(int (*c)())
+STACK *sk_new(int (*c)(const void *, const void *))
        {
        STACK *ret;
        int i;
        {
        STACK *ret;
        int i;
@@ -207,7 +206,7 @@ int sk_find(STACK *st, char *data)
        {
        char **r;
        int i;
        {
        char **r;
        int i;
-       int (*comp_func)();
+       int (*comp_func)(const void *,const void *);
        if(st == NULL) return -1;
 
        if (st->comp == NULL)
        if(st == NULL) return -1;
 
        if (st->comp == NULL)
@@ -219,9 +218,9 @@ int sk_find(STACK *st, char *data)
                }
        sk_sort(st);
        if (data == NULL) return(-1);
                }
        sk_sort(st);
        if (data == NULL) return(-1);
-       comp_func=(int (*)())st->comp;
+       comp_func=st->comp;
        r=(char **)bsearch(&data,(char *)st->data,
        r=(char **)bsearch(&data,(char *)st->data,
-               st->num,sizeof(char *),FP_ICC comp_func);
+               st->num,sizeof(char *), comp_func);
        if (r == NULL) return(-1);
        i=(int)(r-st->data);
        for ( ; i>0; i--)
        if (r == NULL) return(-1);
        i=(int)(r-st->data);
        for ( ; i>0; i--)
@@ -262,7 +261,7 @@ void sk_zero(STACK *st)
        st->num=0;
        }
 
        st->num=0;
        }
 
-void sk_pop_free(STACK *st, void (*func)())
+void sk_pop_free(STACK *st, void (*func)(void *))
        {
        int i;
 
        {
        int i;
 
@@ -302,10 +301,10 @@ void sk_sort(STACK *st)
     {
     if (!st->sorted)
        {
     {
     if (!st->sorted)
        {
-       int (*comp_func)();
+       int (*comp_func)(const void *,const void *);
 
 
-       comp_func=(int (*)())st->comp;
-       qsort(st->data,st->num,sizeof(char *),FP_ICC comp_func);
+       comp_func=st->comp;
+       qsort(st->data,st->num,sizeof(char *), comp_func);
        st->sorted=1;
        }
     }
        st->sorted=1;
        }
     }
index a615d9b4c9471d617235f3befac4c6f9ead16ca5..a6665f3b30f20b76beb5c7b4bc7337ab08530b9d 100644 (file)
@@ -70,7 +70,7 @@ typedef struct stack_st
        int sorted;
 
        int num_alloc;
        int sorted;
 
        int num_alloc;
-       int (*comp)();
+       int (*comp)(const void *, const void *);
        } STACK;
 
 
        } STACK;
 
 
@@ -84,9 +84,9 @@ char *sk_value(STACK *, int);
 
 char *sk_set(STACK *, int, char *);
 
 
 char *sk_set(STACK *, int, char *);
 
-STACK *sk_new(int (*cmp)());
+STACK *sk_new(int (*cmp)(const void *, const void *));
 void sk_free(STACK *);
 void sk_free(STACK *);
-void sk_pop_free(STACK *st, void (*func)());
+void sk_pop_free(STACK *st, void (*func)(void *));
 int sk_insert(STACK *sk,char *data,int where);
 char *sk_delete(STACK *st,int loc);
 char *sk_delete_ptr(STACK *st, char *p);
 int sk_insert(STACK *sk,char *data,int where);
 char *sk_delete(STACK *st,int loc);
 char *sk_delete_ptr(STACK *st, char *p);
@@ -96,7 +96,7 @@ int sk_unshift(STACK *st,char *data);
 char *sk_shift(STACK *st);
 char *sk_pop(STACK *st);
 void sk_zero(STACK *st);
 char *sk_shift(STACK *st);
 char *sk_pop(STACK *st);
 void sk_zero(STACK *st);
-int (*sk_set_cmp_func(STACK *sk, int (*c)()))();
+int (*sk_set_cmp_func(STACK *sk, int (*c)(const void *,const void *)))(const void *, const void *);
 STACK *sk_dup(STACK *st);
 void sk_sort(STACK *st);
 
 STACK *sk_dup(STACK *st);
 void sk_sort(STACK *st);
 
index 466713b50d91340be3e11fa385b73b8d600e3fa2..5c09d4ce85a816001ed76616ddcde7e8ff7e2f9a 100644 (file)
@@ -303,7 +303,7 @@ static STACK *nref_nos(STACK_OF(CONF_VALUE) *nos)
        X509V3err(X509V3_F_NOTICE_SECTION,ERR_R_MALLOC_FAILURE);
 
        err:
        X509V3err(X509V3_F_NOTICE_SECTION,ERR_R_MALLOC_FAILURE);
 
        err:
-       sk_pop_free(nnums, ASN1_STRING_free);
+       sk_pop_free(nnums, (void(*)(void *))ASN1_STRING_free);
        return NULL;
 }
 
        return NULL;
 }
 
@@ -647,7 +647,7 @@ void NOTICEREF_free(NOTICEREF *a)
 {
        if (a == NULL) return;
        M_DISPLAYTEXT_free(a->organization);
 {
        if (a == NULL) return;
        M_DISPLAYTEXT_free(a->organization);
-       sk_pop_free(a->noticenos, ASN1_STRING_free);
+       sk_pop_free(a->noticenos, (void(*)(void *)) ASN1_STRING_free);
        Free (a);
 }
 
        Free (a);
 }
 
index 4242d130a2c515a17605877fbfbaf973138e3182..289bce6e0d04722fc6aca18abbf2a03ebd18868d 100644 (file)
@@ -71,7 +71,7 @@ static void ext_list_free(X509V3_EXT_METHOD *ext);
 
 int X509V3_EXT_add(X509V3_EXT_METHOD *ext)
 {
 
 int X509V3_EXT_add(X509V3_EXT_METHOD *ext)
 {
-       if(!ext_list && !(ext_list = sk_new(ext_cmp))) {
+       if(!ext_list && !(ext_list = sk_new((int (*)(const void *, const void *))ext_cmp))) {
                X509V3err(X509V3_F_X509V3_EXT_ADD,ERR_R_MALLOC_FAILURE);
                return 0;
        }
                X509V3err(X509V3_F_X509V3_EXT_ADD,ERR_R_MALLOC_FAILURE);
                return 0;
        }
@@ -95,7 +95,7 @@ X509V3_EXT_METHOD *X509V3_EXT_get_nid(int nid)
        tmp.ext_nid = nid;
        ret = (X509V3_EXT_METHOD **) OBJ_bsearch((char *)&t,
                        (char *)standard_exts, STANDARD_EXTENSION_COUNT,
        tmp.ext_nid = nid;
        ret = (X509V3_EXT_METHOD **) OBJ_bsearch((char *)&t,
                        (char *)standard_exts, STANDARD_EXTENSION_COUNT,
-                       sizeof(X509V3_EXT_METHOD *), (int (*)())ext_cmp);
+                       sizeof(X509V3_EXT_METHOD *), (int (*)(const void *, const void *))ext_cmp);
        if(ret) return *ret;
        if(!ext_list) return NULL;
        idx = sk_find(ext_list, (char *)&tmp);
        if(ret) return *ret;
        if(!ext_list) return NULL;
        idx = sk_find(ext_list, (char *)&tmp);
@@ -137,7 +137,7 @@ int X509V3_EXT_add_alias(int nid_to, int nid_from)
 
 void X509V3_EXT_cleanup(void)
 {
 
 void X509V3_EXT_cleanup(void)
 {
-       sk_pop_free(ext_list, ext_list_free);
+       sk_pop_free(ext_list, (void(*)(void *)) ext_list_free);
        ext_list = NULL;
 }
 
        ext_list = NULL;
 }
 
index d73c41adcdc219597b49f14bed480cd286fa89dd..ae99a6aceb0ab888ddba9b637feddb8abb697c6b 100644 (file)
 #include <openssl/err.h>
 #include <openssl/ssl.h>
 
 #include <openssl/err.h>
 #include <openssl/ssl.h>
 
-static int ssl_write(BIO *h,char *buf,int num);
-static int ssl_read(BIO *h,char *buf,int size);
-static int ssl_puts(BIO *h,char *str);
-static long ssl_ctrl(BIO *h,int cmd,long arg1,char *arg2);
+static int ssl_write(BIO *h, const char *buf, int num);
+static int ssl_read(BIO *h, char *buf, int size);
+static int ssl_puts(BIO *h, const char *str);
+static long ssl_ctrl(BIO *h, int cmd, long arg1, void *arg2);
 static int ssl_new(BIO *h);
 static int ssl_free(BIO *data);
 static int ssl_new(BIO *h);
 static int ssl_free(BIO *data);
-static long ssl_callback_ctrl(BIO *h,int cmd,void (*fp)());
+static long ssl_callback_ctrl(BIO *h, int cmd, void (*fp)());
 typedef struct bio_ssl_st
        {
        SSL *ssl; /* The ssl handle :-) */
 typedef struct bio_ssl_st
        {
        SSL *ssl; /* The ssl handle :-) */
@@ -221,7 +221,7 @@ static int ssl_read(BIO *b, char *out, int outl)
        return(ret);
        }
 
        return(ret);
        }
 
-static int ssl_write(BIO *b, char *out, int outl)
+static int ssl_write(BIO *b, const char *out, int outl)
        {
        int ret,r=0;
        int retry_reason=0;
        {
        int ret,r=0;
        int retry_reason=0;
@@ -289,7 +289,7 @@ static int ssl_write(BIO *b, char *out, int outl)
        return(ret);
        }
 
        return(ret);
        }
 
-static long ssl_ctrl(BIO *b, int cmd, long num, char *ptr)
+static long ssl_ctrl(BIO *b, int cmd, long num, void *ptr)
        {
        SSL **sslp,*ssl;
        BIO_SSL *bs;
        {
        SSL **sslp,*ssl;
        BIO_SSL *bs;
@@ -492,7 +492,7 @@ static long ssl_callback_ctrl(BIO *b, int cmd, void (*fp)())
        return(ret);
        }
 
        return(ret);
        }
 
-static int ssl_puts(BIO *bp, char *str)
+static int ssl_puts(BIO *bp, const char *str)
        {
        int n,ret;
 
        {
        int n,ret;