summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Möller <ulf@openssl.org>2000-05-15 22:54:43 +0000
committerUlf Möller <ulf@openssl.org>2000-05-15 22:54:43 +0000
commit0e1c06128adbfd2d88dc304db2262140bad045fd (patch)
tree11e9bdbd479a92c1cddc1b583543890bc95adb03
parent0c109ea2cbf3f2ba027fb45c744fb52f7a3f0009 (diff)
Get rid of more non-ANSI declarations.
-rw-r--r--CHANGES3
-rw-r--r--apps/ca.c2
-rw-r--r--apps/pkcs12.c12
-rw-r--r--crypto/bio/bf_buff.c18
-rw-r--r--crypto/bio/bf_nbio.c12
-rw-r--r--crypto/bio/bf_null.c18
-rw-r--r--crypto/bio/bio.h24
-rw-r--r--crypto/bio/bio_lib.c2
-rw-r--r--crypto/bio/bss_acpt.c14
-rw-r--r--crypto/bio/bss_bio.c8
-rw-r--r--crypto/bio/bss_conn.c21
-rw-r--r--crypto/bio/bss_file.c16
-rw-r--r--crypto/bio/bss_log.c14
-rw-r--r--crypto/bio/bss_mem.c16
-rw-r--r--crypto/bio/bss_null.c16
-rw-r--r--crypto/bio/bss_sock.c28
-rw-r--r--crypto/evp/bio_b64.c14
-rw-r--r--crypto/evp/bio_enc.c16
-rw-r--r--crypto/evp/bio_md.c14
-rw-r--r--crypto/evp/bio_ok.c12
-rw-r--r--crypto/evp/evp_pbe.c2
-rw-r--r--crypto/evp/evp_pkey.c12
-rw-r--r--crypto/pkcs12/p12_crt.c6
-rw-r--r--crypto/pkcs12/p12_kiss.c10
-rw-r--r--crypto/pkcs12/p12_npas.c12
-rw-r--r--crypto/pkcs7/pk7_mime.c36
-rw-r--r--crypto/pkcs7/pk7_smime.c2
-rw-r--r--crypto/stack/safestack.h6
-rw-r--r--crypto/stack/stack.c21
-rw-r--r--crypto/stack/stack.h8
-rw-r--r--crypto/x509v3/v3_cpols.c4
-rw-r--r--crypto/x509v3/v3_lib.c6
-rw-r--r--ssl/bio_ssl.c16
33 files changed, 213 insertions, 208 deletions
diff --git a/CHANGES b/CHANGES
index 3f55f9cc9d..ab8f8531fa 100644
--- a/CHANGES
+++ b/CHANGES
@@ -4,6 +4,9 @@
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.
diff --git a/apps/ca.c b/apps/ca.c
index 73df13fe8e..7ab8c3b4f4 100644
--- a/apps/ca.c
+++ b/apps/ca.c
@@ -1233,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);
diff --git a/apps/pkcs12.c b/apps/pkcs12.c
index baf5505ecb..0c03801afe 100644
--- a/apps/pkcs12.c
+++ b/apps/pkcs12.c
@@ -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);
- sk_pop_free(bags, PKCS12_SAFEBAG_free);
+ sk_pop_free(bags, (void(*)(void *)) PKCS12_SAFEBAG_free);
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_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_pop_free(safes, PKCS7_free);
+ sk_pop_free(safes, (void(*)(void *)) PKCS7_free);
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)) {
- sk_pop_free (bags, PKCS12_SAFEBAG_free);
+ sk_pop_free (bags, (void(*)(void *)) PKCS12_SAFEBAG_free);
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;
}
diff --git a/crypto/bio/bf_buff.c b/crypto/bio/bf_buff.c
index ff0c9070ae..edffe92bce 100644
--- a/crypto/bio/bf_buff.c
+++ b/crypto/bio/bf_buff.c
@@ -62,14 +62,14 @@
#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 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=
@@ -195,7 +195,7 @@ 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;
@@ -268,7 +268,7 @@ 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;
@@ -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)));
}
diff --git a/crypto/bio/bf_nbio.c b/crypto/bio/bf_nbio.c
index 5e574b7231..9b4bcb19d4 100644
--- a/crypto/bio/bf_nbio.c
+++ b/crypto/bio/bf_nbio.c
@@ -66,11 +66,11 @@
/* 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_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 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)());
@@ -159,7 +159,7 @@ static int nbiof_read(BIO *b, char *out, int outl)
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;
@@ -204,7 +204,7 @@ static int nbiof_write(BIO *b, char *in, int inl)
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;
@@ -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));
diff --git a/crypto/bio/bf_null.c b/crypto/bio/bf_null.c
index 0d183a6d9a..a3f0b02a7f 100644
--- a/crypto/bio/bf_null.c
+++ b/crypto/bio/bf_null.c
@@ -65,14 +65,14 @@
/* 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 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,
@@ -121,7 +121,7 @@ static int nullf_read(BIO *b, char *out, int outl)
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;
@@ -133,7 +133,7 @@ static int nullf_write(BIO *b, char *in, int inl)
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;
@@ -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));
diff --git a/crypto/bio/bio.h b/crypto/bio/bio.h
index 3775072695..0af44e6070 100644
--- a/crypto/bio/bio.h
+++ b/crypto/bio/bio.h
@@ -207,19 +207,21 @@ extern "C" {
#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;
- 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
@@ -237,7 +239,7 @@ typedef struct bio_method_st
} BIO_METHOD;
#endif
-typedef struct bio_st
+struct bio_st
{
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;
- } BIO;
+ };
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);
-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);
diff --git a/crypto/bio/bio_lib.c b/crypto/bio/bio_lib.c
index e88dcc80f3..00163f21bd 100644
--- a/crypto/bio/bio_lib.c
+++ b/crypto/bio/bio_lib.c
@@ -317,7 +317,7 @@ long BIO_ctrl(BIO *b, int cmd, long larg, void *parg)
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)();
diff --git a/crypto/bio/bss_acpt.c b/crypto/bio/bss_acpt.c
index 9afa636406..09e8c90b53 100644
--- a/crypto/bio/bss_acpt.c
+++ b/crypto/bio/bss_acpt.c
@@ -92,10 +92,10 @@ typedef struct bio_accept_st
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);
@@ -307,7 +307,7 @@ static int acpt_read(BIO *b, char *out, int outl)
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;
@@ -326,7 +326,7 @@ static int acpt_write(BIO *b, char *in, int inl)
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;
@@ -440,7 +440,7 @@ static long acpt_ctrl(BIO *b, int cmd, long num, char *ptr)
return(ret);
}
-static int acpt_puts(BIO *bp, char *str)
+static int acpt_puts(BIO *bp, const char *str)
{
int n,ret;
diff --git a/crypto/bio/bss_bio.c b/crypto/bio/bss_bio.c
index 1e2d7491f2..94cc63c9fe 100644
--- a/crypto/bio/bss_bio.c
+++ b/crypto/bio/bss_bio.c
@@ -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_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 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);
@@ -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;
@@ -628,7 +628,7 @@ static long bio_ctrl(BIO *bio, int cmd, long num, void *ptr)
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));
}
diff --git a/crypto/bio/bss_conn.c b/crypto/bio/bss_conn.c
index 22d00b369e..f0466adca3 100644
--- a/crypto/bio/bss_conn.c
+++ b/crypto/bio/bss_conn.c
@@ -98,13 +98,13 @@ typedef struct bio_connect_st
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 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);
@@ -426,7 +426,7 @@ static int conn_read(BIO *b, char *out, int outl)
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;
@@ -449,7 +449,7 @@ static int conn_write(BIO *b, char *in, int inl)
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;
@@ -519,9 +519,10 @@ static long conn_ctrl(BIO *b, int cmd, long num, char *ptr)
else if (num == 2)
{
char buf[16];
+ char *p = ptr;
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);
@@ -601,7 +602,7 @@ static long conn_ctrl(BIO *b, int cmd, long num, char *ptr)
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;
@@ -622,7 +623,7 @@ static long conn_callback_ctrl(BIO *b, int cmd, void *(*fp)())
return(ret);
}
-static int conn_puts(BIO *bp, char *str)
+static int conn_puts(BIO *bp, const char *str)
{
int n,ret;
diff --git a/crypto/bio/bss_file.c b/crypto/bio/bss_file.c
index 0d44dc3889..1f770b390f 100644
--- a/crypto/bio/bss_file.c
+++ b/crypto/bio/bss_file.c
@@ -73,11 +73,11 @@
#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=
@@ -163,7 +163,7 @@ static int MS_CALLBACK file_read(BIO *b, char *out, int outl)
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;
@@ -179,7 +179,7 @@ static int MS_CALLBACK file_write(BIO *b, char *in, int inl)
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;
@@ -294,7 +294,7 @@ static int MS_CALLBACK file_gets(BIO *bp, char *buf, int size)
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;
diff --git a/crypto/bio/bss_log.c b/crypto/bio/bss_log.c
index 497eb1af72..a8e01a0f93 100644
--- a/crypto/bio/bss_log.c
+++ b/crypto/bio/bss_log.c
@@ -110,9 +110,9 @@
#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);
@@ -153,10 +153,10 @@ static int MS_CALLBACK slg_free(BIO *a)
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;
- char* buf= in;
+ char* buf;
char* pp;
int priority;
@@ -186,7 +186,7 @@ static int MS_CALLBACK slg_write(BIO *b, char *in, int inl)
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)
{
@@ -200,7 +200,7 @@ static long MS_CALLBACK slg_ctrl(BIO *b, int cmd, long num, char *ptr)
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;
diff --git a/crypto/bio/bss_mem.c b/crypto/bio/bss_mem.c
index 41eab92415..f8c144accd 100644
--- a/crypto/bio/bss_mem.c
+++ b/crypto/bio/bss_mem.c
@@ -61,11 +61,11 @@
#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=
@@ -170,7 +170,7 @@ static int mem_read(BIO *b, char *out, int outl)
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;
@@ -198,7 +198,7 @@ end:
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;
@@ -300,7 +300,7 @@ static int mem_gets(BIO *bp, char *buf, int size)
return(ret);
}
-static int mem_puts(BIO *bp, char *str)
+static int mem_puts(BIO *bp, const char *str)
{
int n,ret;
diff --git a/crypto/bio/bss_null.c b/crypto/bio/bss_null.c
index aee18e3ada..46b73339df 100644
--- a/crypto/bio/bss_null.c
+++ b/crypto/bio/bss_null.c
@@ -61,11 +61,11 @@
#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=
@@ -106,12 +106,12 @@ static int null_read(BIO *b, char *out, int outl)
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);
}
-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;
@@ -142,7 +142,7 @@ static int null_gets(BIO *bp, char *buf, int size)
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));
diff --git a/crypto/bio/bss_sock.c b/crypto/bio/bss_sock.c
index 8ce80ef68d..50c6744c06 100644
--- a/crypto/bio/bss_sock.c
+++ b/crypto/bio/bss_sock.c
@@ -65,19 +65,19 @@
#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 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);
@@ -209,9 +209,9 @@ static int fd_read(BIO *b, char *out,int outl)
}
#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
-static int fd_write(BIO *b, char *in, int inl)
+static int fd_write(BIO *b, const char *in, int inl)
#endif
{
int ret;
@@ -237,9 +237,9 @@ static int fd_write(BIO *b, char *in, int inl)
}
#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
-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;
@@ -313,9 +313,9 @@ static int sock_gets(BIO *bp, char *buf,int size)
#endif
#ifndef BIO_FD
-static int sock_puts(BIO *bp, char *str)
+static int sock_puts(BIO *bp, const char *str)
#else
-static int fd_puts(BIO *bp, char *str)
+static int fd_puts(BIO *bp, const char *str)
#endif
{
int n,ret;
diff --git a/crypto/evp/bio_b64.c b/crypto/evp/bio_b64.c
index bd5e24f993..e76387eaec 100644
--- a/crypto/evp/bio_b64.c
+++ b/crypto/evp/bio_b64.c
@@ -62,11 +62,11 @@
#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)());
@@ -340,7 +340,7 @@ static int b64_read(BIO *b, char *out, int outl)
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;
@@ -434,7 +434,7 @@ static int b64_write(BIO *b, char *in, int inl)
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;
diff --git a/crypto/evp/bio_enc.c b/crypto/evp/bio_enc.c
index 629bf4b95d..1b7a21010c 100644
--- a/crypto/evp/bio_enc.c
+++ b/crypto/evp/bio_enc.c
@@ -62,14 +62,14 @@
#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); */
-/*s