aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorUlf Möller <ulf@openssl.org>1999-04-19 21:31:43 +0000
committerUlf Möller <ulf@openssl.org>1999-04-19 21:31:43 +0000
commit6b691a5c85ddc4e407e32781841fee5c029506cd (patch)
tree436f1127406e1cacfe83dfcbfff824d89c47d834 /apps
parent3edd7ed15de229230f74c79c3d71e7c9c674cf4f (diff)
downloadopenssl-6b691a5c85ddc4e407e32781841fee5c029506cd.tar.gz
Change functions to ANSI C.
Diffstat (limited to 'apps')
-rw-r--r--apps/apps.c31
-rw-r--r--apps/asn1pars.c4
-rw-r--r--apps/ca.c136
-rw-r--r--apps/ciphers.c4
-rw-r--r--apps/crl.c8
-rw-r--r--apps/crl2p7.c8
-rw-r--r--apps/dgst.c9
-rw-r--r--apps/dh.c4
-rw-r--r--apps/dsa.c4
-rw-r--r--apps/dsaparam.c9
-rw-r--r--apps/enc.c9
-rw-r--r--apps/errstr.c4
-rw-r--r--apps/gendh.c12
-rw-r--r--apps/gendsa.c7
-rw-r--r--apps/genrsa.c12
-rw-r--r--apps/nseq.c8
-rw-r--r--apps/openssl.c20
-rw-r--r--apps/pem_mail.c4
-rw-r--r--apps/pkcs12.c54
-rw-r--r--apps/pkcs7.c4
-rw-r--r--apps/req.c46
-rw-r--r--apps/rsa.c4
-rw-r--r--apps/s_cb.c23
-rw-r--r--apps/s_client.c11
-rw-r--r--apps/s_server.c40
-rw-r--r--apps/s_socket.c73
-rw-r--r--apps/s_time.c20
-rw-r--r--apps/sc.c6
-rw-r--r--apps/sess_id.c8
-rw-r--r--apps/speed.c23
-rw-r--r--apps/verify.c12
-rw-r--r--apps/version.c4
-rw-r--r--apps/x509.c35
33 files changed, 162 insertions, 494 deletions
diff --git a/apps/apps.c b/apps/apps.c
index 5f0c8fa539..ba07016e83 100644
--- a/apps/apps.c
+++ b/apps/apps.c
@@ -76,10 +76,7 @@ int app_init();
#endif
#ifdef undef /* never finished - probably never will be :-) */
-int args_from_file(file,argc,argv)
-char *file;
-int *argc;
-char **argv[];
+int args_from_file(char *file, int *argc, char **argv[])
{
FILE *fp;
int num,i;
@@ -157,8 +154,7 @@ char **argv[];
}
#endif
-int str2fmt(s)
-char *s;
+int str2fmt(char *s)
{
if ((*s == 'D') || (*s == 'd'))
return(FORMAT_ASN1);
@@ -173,10 +169,7 @@ char *s;
}
#if defined(MSDOS) || defined(WIN32) || defined(WIN16)
-void program_name(in,out,size)
-char *in;
-char *out;
-int size;
+void program_name(char *in, char *out, int size)
{
int i,n;
char *p=NULL;
@@ -213,10 +206,7 @@ int size;
out[n]='\0';
}
#else
-void program_name(in,out,size)
-char *in;
-char *out;
-int size;
+void program_name(char *in, char *out, int size)
{
char *p;
@@ -231,9 +221,7 @@ int size;
#endif
#ifdef WIN32
-int WIN32_rename(from,to)
-char *from;
-char *to;
+int WIN32_rename(char *from, char *to)
{
int ret;
@@ -242,11 +230,7 @@ char *to;
}
#endif
-int chopup_args(arg,buf,argc,argv)
-ARGS *arg;
-char *buf;
-int *argc;
-char **argv[];
+int chopup_args(ARGS *arg, char *buf, int *argc, char **argv[])
{
int num,len,i;
char *p;
@@ -312,8 +296,7 @@ char **argv[];
}
#ifndef APP_INIT
-int app_init(mesgwin)
-long mesgwin;
+int app_init(long mesgwin)
{
return(1);
}
diff --git a/apps/asn1pars.c b/apps/asn1pars.c
index cf9a3bf2bc..39e97887af 100644
--- a/apps/asn1pars.c
+++ b/apps/asn1pars.c
@@ -80,9 +80,7 @@
#undef PROG
#define PROG asn1parse_main
-int MAIN(argc, argv)
-int argc;
-char **argv;
+int MAIN(int argc, char **argv)
{
int i,badops=0,offset=0,ret=1,j;
unsigned int length=0;
diff --git a/apps/ca.c b/apps/ca.c
index 467188079a..7cdf14d7ca 100644
--- a/apps/ca.c
+++ b/apps/ca.c
@@ -215,9 +215,7 @@ static char *section=NULL;
static int preserve=0;
static int msie_hack=0;
-int MAIN(argc, argv)
-int argc;
-char **argv;
+int MAIN(int argc, char **argv)
{
int total=0;
int total_done=0;
@@ -1179,16 +1177,12 @@ err:
EXIT(ret);
}
-static void lookup_fail(name,tag)
-char *name;
-char *tag;
+static void lookup_fail(char *name, char *tag)
{
BIO_printf(bio_err,"variable lookup failed for %s::%s\n",name,tag);
}
-static int MS_CALLBACK key_callback(buf,len,verify)
-char *buf;
-int len,verify;
+static int MS_CALLBACK key_callback(char *buf, int len, int verify)
{
int i;
@@ -1199,8 +1193,7 @@ int len,verify;
return(i);
}
-static unsigned long index_serial_hash(a)
-char **a;
+static unsigned long index_serial_hash(char **a)
{
char *n;
@@ -1209,9 +1202,7 @@ char **a;
return(lh_strhash(n));
}
-static int index_serial_cmp(a,b)
-char **a;
-char **b;
+static int index_serial_cmp(char **a, char **b)
{
char *aa,*bb;
@@ -1220,21 +1211,17 @@ char **b;
return(strcmp(aa,bb));
}
-static unsigned long index_name_hash(a)
-char **a;
+static unsigned long index_name_hash(char **a)
{ return(lh_strhash(a[DB_name])); }
-static int index_name_qual(a)
-char **a;
+static int index_name_qual(char **a)
{ return(a[0][0] == 'V'); }
-static int index_name_cmp(a,b)
-char **a;
-char **b;
- { return(strcmp(a[DB_name],b[DB_name])); }
+static int index_name_cmp(char **a, char **b)
+ { return(strcmp(a[DB_name],
+ b[DB_name])); }
-static BIGNUM *load_serial(serialfile)
-char *serialfile;
+static BIGNUM *load_serial(char *serialfile)
{
BIO *in=NULL;
BIGNUM *ret=NULL;
@@ -1272,9 +1259,7 @@ err:
return(ret);
}
-static int save_serial(serialfile,serial)
-char *serialfile;
-BIGNUM *serial;
+static int save_serial(char *serialfile, BIGNUM *serial)
{
BIO *out;
int ret=0;
@@ -1306,22 +1291,10 @@ err:
return(ret);
}
-static int certify(xret,infile,pkey,x509,dgst,policy,db,serial,startdate,days,
- batch,ext_sect,lconf,verbose)
-X509 **xret;
-char *infile;
-EVP_PKEY *pkey;
-X509 *x509;
-const EVP_MD *dgst;
-STACK *policy;
-TXT_DB *db;
-BIGNUM *serial;
-char *startdate;
-int days;
-int batch;
-char *ext_sect;
-LHASH *lconf;
-int verbose;
+static int certify(X509 **xret, char *infile, EVP_PKEY *pkey, X509 *x509,
+ const EVP_MD *dgst, STACK *policy, TXT_DB *db, BIGNUM *serial,
+ char *startdate, int days, int batch, char *ext_sect, LHASH *lconf,
+ int verbose)
{
X509_REQ *req=NULL;
BIO *in=NULL;
@@ -1377,22 +1350,11 @@ err:
return(ok);
}
-static int certify_cert(xret,infile,pkey,x509,dgst,policy,db,serial,startdate,
- days,batch,ext_sect,lconf,verbose)
-X509 **xret;
-char *infile;
-EVP_PKEY *pkey;
-X509 *x509;
-const EVP_MD *dgst;
-STACK *policy;
-TXT_DB *db;
-BIGNUM *serial;
-char *startdate;
-int days;
-int batch;
-char *ext_sect;
-LHASH *lconf;
-int verbose;
+static int certify_cert(X509 **xret, char *infile, EVP_PKEY *pkey, X509 *x509,
+ const EVP_MD *dgst, STACK *policy, TXT_DB *db, BIGNUM *serial,
+ char *startdate, int days, int batch, char *ext_sect, LHASH *lconf,
+ int verbose)
+
{
X509 *req=NULL;
X509_REQ *rreq=NULL;
@@ -1452,22 +1414,9 @@ err:
return(ok);
}
-static int do_body(xret,pkey,x509,dgst,policy,db,serial,startdate,days,
- batch,verbose,req,ext_sect,lconf)
-X509 **xret;
-EVP_PKEY *pkey;
-X509 *x509;
-const EVP_MD *dgst;
-STACK *policy;
-TXT_DB *db;
-BIGNUM *serial;
-char *startdate;
-int days;
-int batch;
-int verbose;
-X509_REQ *req;
-char *ext_sect;
-LHASH *lconf;
+static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509, const EVP_MD *dgst,
+ STACK *policy, TXT_DB *db, BIGNUM *serial, char *startdate, int days,
+ int batch, int verbose, X509_REQ *req, char *ext_sect, LHASH *lconf)
{
X509_NAME *name=NULL,*CAname=NULL,*subject=NULL;
ASN1_UTCTIME *tm,*tmptm;
@@ -1895,10 +1844,7 @@ err:
return(ok);
}
-static void write_new_certificate(bp,x, output_der)
-BIO *bp;
-X509 *x;
-int output_der;
+static void write_new_certificate(BIO *bp, X509 *x, int output_der)
{
char *f;
char buf[256];
@@ -1924,21 +1870,9 @@ int output_der;
BIO_puts(bp,"\n");
}
-static int certify_spkac(xret,infile,pkey,x509,dgst,policy,db,serial,
- startdate,days,ext_sect,lconf,verbose)
-X509 **xret;
-char *infile;
-EVP_PKEY *pkey;
-X509 *x509;
-const EVP_MD *dgst;
-STACK *policy;
-TXT_DB *db;
-BIGNUM *serial;
-char *startdate;
-int days;
-char *ext_sect;
-LHASH *lconf;
-int verbose;
+static int certify_spkac(X509 **xret, char *infile, EVP_PKEY *pkey, X509 *x509,
+ const EVP_MD *dgst, STACK *policy, TXT_DB *db, BIGNUM *serial,
+ char *startdate, int days, char *ext_sect, LHASH *lconf, int verbose)
{
STACK *sk=NULL;
LHASH *parms=NULL;
@@ -2094,9 +2028,7 @@ err:
return(ok);
}
-static int fix_data(nid,type)
-int nid;
-int *type;
+static int fix_data(int nid, int *type)
{
if (nid == NID_pkcs9_emailAddress)
*type=V_ASN1_IA5STRING;
@@ -2111,8 +2043,7 @@ int *type;
return(1);
}
-static int check_time_format(str)
-char *str;
+static int check_time_format(char *str)
{
ASN1_UTCTIME tm;
@@ -2122,8 +2053,7 @@ char *str;
return(ASN1_UTCTIME_check(&tm));
}
-static int add_oid_section(hconf)
-LHASH *hconf;
+static int add_oid_section(LHASH *hconf)
{
char *p;
STACK *sktmp;
@@ -2145,9 +2075,7 @@ LHASH *hconf;
return 1;
}
-static int do_revoke(x509,db)
-X509 *x509;
-TXT_DB *db;
+static int do_revoke(X509 *x509, TXT_DB *db)
{
ASN1_UTCTIME *tm=NULL;
char *row[DB_NUMBER],**rrow,**irow;
diff --git a/apps/ciphers.c b/apps/ciphers.c
index 146527790e..b02b64b5df 100644
--- a/apps/ciphers.c
+++ b/apps/ciphers.c
@@ -77,9 +77,7 @@ static char *ciphers_usage[]={
NULL
};
-int MAIN(argc, argv)
-int argc;
-char **argv;
+int MAIN(int argc, char **argv)
{
int ret=1,i;
int verbose=0;
diff --git a/apps/crl.c b/apps/crl.c
index 3bb7aae11e..0c03f5fb6c 100644
--- a/apps/crl.c
+++ b/apps/crl.c
@@ -96,9 +96,7 @@ static X509_CRL *load_crl();
static BIO *bio_out=NULL;
-int MAIN(argc, argv)
-int argc;
-char **argv;
+int MAIN(int argc, char **argv)
{
X509_CRL *x=NULL;
int ret=1,i,num,badops=0;
@@ -262,9 +260,7 @@ end:
EXIT(ret);
}
-static X509_CRL *load_crl(infile, format)
-char *infile;
-int format;
+static X509_CRL *load_crl(char *infile, int format)
{
X509_CRL *x=NULL;
BIO *in=NULL;
diff --git a/apps/crl2p7.c b/apps/crl2p7.c
index beadc96caf..aa407b7098 100644
--- a/apps/crl2p7.c
+++ b/apps/crl2p7.c
@@ -87,9 +87,7 @@ static int add_certs_from_file();
* -out arg - output file - default stdout
*/
-int MAIN(argc, argv)
-int argc;
-char **argv;
+int MAIN(int argc, char **argv)
{
int i,badops=0;
BIO *in=NULL,*out=NULL;
@@ -288,9 +286,7 @@ end:
* number of certs added if successful, -1 if not.
*----------------------------------------------------------------------
*/
-static int add_certs_from_file(stack,certfile)
-STACK_OF(X509) *stack;
-char *certfile;
+static int add_certs_from_file(STACK_OF(X509) *stack, char *certfile)
{
struct stat st;
BIO *in=NULL;
diff --git a/apps/dgst.c b/apps/dgst.c
index eb7462d0b1..2926e5514f 100644
--- a/apps/dgst.c
+++ b/apps/dgst.c
@@ -79,9 +79,7 @@ void do_fp(unsigned char *buf,BIO *f,int sep);
void do_fp();
#endif
-int MAIN(argc,argv)
-int argc;
-char **argv;
+int MAIN(int argc, char **argv)
{
unsigned char *buf=NULL;
int i,err=0;
@@ -203,10 +201,7 @@ end:
EXIT(err);
}
-void do_fp(buf,bp,sep)
-unsigned char *buf;
-BIO *bp;
-int sep;
+void do_fp(unsigned char *buf, BIO *bp, int sep)
{
int len;
int i;
diff --git a/apps/dh.c b/apps/dh.c
index 462570c1ba..0b548ef570 100644
--- a/apps/dh.c
+++ b/apps/dh.c
@@ -81,9 +81,7 @@
* -C
*/
-int MAIN(argc, argv)
-int argc;
-char **argv;
+int MAIN(int argc, char **argv)
{
DH *dh=NULL;
int i,badops=0,text=0;
diff --git a/apps/dsa.c b/apps/dsa.c
index 1f57c46005..312ed31798 100644
--- a/apps/dsa.c
+++ b/apps/dsa.c
@@ -82,9 +82,7 @@
* -modulus - print the DSA public key
*/
-int MAIN(argc, argv)
-int argc;
-char **argv;
+int MAIN(int argc, char **argv)
{
int ret=1;
DSA *dsa=NULL;
diff --git a/apps/dsaparam.c b/apps/dsaparam.c
index e01f939748..085e4845c1 100644
--- a/apps/dsaparam.c
+++ b/apps/dsaparam.c
@@ -89,9 +89,7 @@ static void MS_CALLBACK dsa_cb(int p, int n, char *arg);
static void MS_CALLBACK dsa_cb();
#endif
-int MAIN(argc, argv)
-int argc;
-char **argv;
+int MAIN(int argc, char **argv)
{
DSA *dsa=NULL;
int i,badops=0,text=0;
@@ -342,10 +340,7 @@ end:
EXIT(ret);
}
-static void MS_CALLBACK dsa_cb(p, n, arg)
-int p;
-int n;
-char *arg;
+static void MS_CALLBACK dsa_cb(int p, int n, char *arg)
{
char c='*';
diff --git a/apps/enc.c b/apps/enc.c
index 00cc336177..b561326733 100644
--- a/apps/enc.c
+++ b/apps/enc.c
@@ -84,9 +84,7 @@ int set_hex();
#define BSIZE (8*1024)
#define PROG enc_main
-int MAIN(argc,argv)
-int argc;
-char **argv;
+int MAIN(int argc, char **argv)
{
char *strbuf=NULL;
unsigned char *buff=NULL,*bufsize=NULL;
@@ -521,10 +519,7 @@ end:
EXIT(ret);
}
-int set_hex(in,out,size)
-char *in;
-unsigned char *out;
-int size;
+int set_hex(char *in, unsigned char *out, int size)
{
int i,n;
unsigned char j;
diff --git a/apps/errstr.c b/apps/errstr.c
index d2b2b3fcea..ee51abaf34 100644
--- a/apps/errstr.c
+++ b/apps/errstr.c
@@ -68,9 +68,7 @@
#undef PROG
#define PROG errstr_main
-int MAIN(argc, argv)
-int argc;
-char **argv;
+int MAIN(int argc, char **argv)
{
int i,ret=0;
char buf[256];
diff --git a/apps/gendh.c b/apps/gendh.c
index 2790f179fd..8900b4f1af 100644
--- a/apps/gendh.c
+++ b/apps/gendh.c
@@ -81,9 +81,7 @@ static void MS_CALLBACK dh_cb();
static long dh_load_rand();
#endif
-int MAIN(argc, argv)
-int argc;
-char **argv;
+int MAIN(int argc, char **argv)
{
char buffer[200];
DH *dh=NULL;
@@ -191,10 +189,7 @@ end:
EXIT(ret);
}
-static void MS_CALLBACK dh_cb(p,n,arg)
-int p;
-int n;
-char *arg;
+static void MS_CALLBACK dh_cb(int p, int n, char *arg)
{
char c='*';
@@ -209,8 +204,7 @@ char *arg;
#endif
}
-static long dh_load_rand(name)
-char *name;
+static long dh_load_rand(char *name)
{
char *p,*n;
int last;
diff --git a/apps/gendsa.c b/apps/gendsa.c
index 311d95020b..3e198a24f9 100644
--- a/apps/gendsa.c
+++ b/apps/gendsa.c
@@ -79,9 +79,7 @@ static long dsa_load_rand(char *names);
static long dsa_load_rand();
#endif
-int MAIN(argc, argv)
-int argc;
-char **argv;
+int MAIN(int argc, char **argv)
{
char buffer[200];
DSA *dsa=NULL;
@@ -214,8 +212,7 @@ end:
EXIT(ret);
}
-static long dsa_load_rand(name)
-char *name;
+static long dsa_load_rand(char *name)
{
char *p,*n;
int last;
diff --git a/apps/genrsa.c b/apps/genrsa.c
index cdba6189ad..f83bafc7f1 100644
--- a/apps/genrsa.c
+++ b/apps/genrsa.c
@@ -82,9 +82,7 @@ static void MS_CALLBACK genrsa_cb();
static long gr_load_rand();
#endif
-int MAIN(argc, argv)
-int argc;
-char **argv;
+int MAIN(int argc, char **argv)
{
int ret=1;
char buffer[200];
@@ -234,10 +232,7 @@ err:
EXIT(ret);
}
-static void MS_CALLBACK genrsa_cb(p, n, arg)
-int p;
-int n;
-char *arg;
+static void MS_CALLBACK genrsa_cb(int p, int n, char *arg)
{
char c='*';
@@ -252,8 +247,7 @@ char *arg;
#endif
}
-static long gr_load_rand(name)
-char *name;
+static long gr_load_rand(char *name)
{
char *p,*n;
int last;
diff --git a/apps/nseq.c b/apps/nseq.c
index e87c6c77a7..3c70e4d2be 100644
--- a/apps/nseq.c
+++ b/apps/nseq.c
@@ -70,9 +70,7 @@ static int dump_cert_text(BIO *out, X509 *x);
static int dump_cert_text();
#endif
-int MAIN(argc, argv)
-int argc;
-char **argv;
+int MAIN(int argc, char **argv)
{
char **args, *infile = NULL, *outfile = NULL;
BIO *in = NULL, *out = NULL;
@@ -163,9 +161,7 @@ end:
EXIT(ret);
}
-static int dump_cert_text(out, x)
-BIO *out;
-X509 *x;
+static int dump_cert_text(BIO *out, X509 *x)
{
char buf[256];
X509_NAME_oneline(X509_get_subject_name(x),buf,256);
diff --git a/apps/openssl.c b/apps/openssl.c
index dd22aa78af..21724201d6 100644
--- a/apps/openssl.c
+++ b/apps/openssl.c
@@ -99,8 +99,7 @@ LHASH *config=NULL;
char *default_config_file=NULL;
#ifdef DEBUG
-static void sig_stop(i)
-int i;
+static void sig_stop(int i)
{
char *a=NULL;
@@ -113,9 +112,7 @@ int i;
BIO *bio_err=NULL;
#endif
-int main(Argc,Argv)
-int Argc;
-char *Argv[];
+int main(int Argc, char *Argv[])
{
ARGS arg;
#define PROG_NAME_SIZE 16
@@ -258,10 +255,7 @@ end:
#define LIST_MESSAGE_DIGEST_COMMANDS "list-message-digest-commands"
#define LIST_CIPHER_COMMANDS "list-cipher-commands"
-static int do_cmd(prog,argc,argv)
-LHASH *prog;
-int argc;
-char *argv[];
+static int do_cmd(LHASH *prog, int argc, char *argv[])
{
FUNCTION f,*fp;
int i,ret=1,tp,nl;
@@ -354,7 +348,7 @@ static int SortFnByName(const void *_f1,const void *_f2)
return strcmp(f1->name,f2->name);
}
-static LHASH *prog_init()
+static LHASH *prog_init(void)
{
LHASH *ret;
FUNCTION *f;
@@ -372,14 +366,12 @@ static LHASH *prog_init()
return(ret);
}
-static int MS_CALLBACK cmp(a,b)
-FUNCTION *a,*b;
+static int MS_CALLBACK cmp(FUNCTION *a, FUNCTION *b)
{
return(strncmp(a->name,b->name,8));
}
-static unsigned long MS_CALLBACK hash(a)
-FUNCTION *a;
+static unsigned long MS_CALLBACK hash(FUNCTION *a)
{
return(lh_strhash(a->name));
}
diff --git a/apps/pem_mail.c b/apps/pem_mail.c
index 64e04acb52..acbf7bd9a0 100644
--- a/apps/pem_mail.c
+++ b/apps/pem_mail.c
@@ -87,9 +87,7 @@ typedef struct lines_St
struct lines_st *next;
} LINES;
-int main(argc, argv)
-int argc;
-char **argv;
+int main(int argc, char **argv)
{
FILE *in;
RSA *rsa=NULL;
diff --git a/apps/pkcs12.c b/apps/pkcs12.c
index 96e0379fad..266bfa89ab 100644
--- a/apps/pkcs12.c
+++ b/apps/pkcs12.c
@@ -96,9 +96,7 @@ int alg_print();
int cert_load();
#endif
-int MAIN(argc, argv)
-int argc;
-char **argv;
+int MAIN(int argc, char **argv)
{
char *infile=NULL, *outfile=NULL, *keyname = NULL;
char *certfile=NULL;
@@ -440,9 +438,7 @@ if (export_cert) {
EXIT(ret);
}
-int dump_cert_text (out, x)
-BIO *out;
-X509 *x;
+int dump_cert_text (BIO *out, X509 *x)
{
char buf[256];
X509_NAME_oneline(X509_get_subject_name(x),buf,256);
@@ -456,12 +452,8 @@ X509 *x;
return 0;
}
-int dump_certs_keys_p12 (out, p12, pass, passlen, options)
-BIO *out;
-PKCS12 *p12;
-unsigned char *pass;
-int passlen;
-int options;
+int dump_certs_keys_p12 (BIO *out, PKCS12 *p12, unsigned char *pass,
+ int passlen, int options)
{
STACK *asafes, *bags;
int i, bagnid;
@@ -493,12 +485,8 @@ int options;
return 1;
}
-int dump_certs_pkeys_bags (out, bags, pass, passlen, options)
-BIO *out;
-STACK *bags;
-unsigned char *pass;
-int passlen;
-int options;
+int dump_certs_pkeys_bags (BIO *out, STACK *bags, unsigned char *pass,
+ int passlen, int options)
{
int i;
for (i = 0; i < sk_num (bags); i++) {
@@ -509,12 +497,8 @@ int options;
return 1;
}
-int dump_certs_pkeys_bag (out, bag, pass, passlen, options)
-BIO *out;
-PKCS12_SAFEBAG *bag;
-unsigned char *pass;
-int passlen;
-int options;
+int dump_certs_pkeys_bag (BIO *out, PKCS12_SAFEBAG *bag, unsigned char *pass,
+ int passlen, int options)
{
EVP_PKEY *pkey;
PKCS8_PRIV_KEY_INFO *p8;
@@ -584,9 +568,7 @@ int options;
/* Hope this is OK .... */
-int get_cert_chain (cert, chain)
-X509 *cert;
-STACK **chain;
+int get_cert_chain (X509 *cert, STACK **chain)
{
X509_STORE *store;
X509_STORE_CTX store_ctx;
@@ -614,9 +596,7 @@ err:
return i;
}
-int alg_print (x, alg)
-BIO *x;
-X509_ALGOR *alg;
+int alg_print (BIO *x, X509_ALGOR *alg)
{
PBEPARAM *pbe;
unsigned char *p;
@@ -630,9 +610,7 @@ X509_ALGOR *alg;
/* Load all certificates from a given file */
-int cert_load(in, sk)
-BIO *in;
-STACK *sk;
+int cert_load(BIO *in, STACK *sk)
{
int ret;
X509 *cert;
@@ -647,10 +625,7 @@ STACK *sk;
/* Generalised attribute print: handle PKCS#8 and bag attributes */
-int print_attribs (out, attrlst, name)
-BIO *out;
-STACK *attrlst;
-char *name;
+int print_attribs (BIO *out, STACK *attrlst, char *name)
{
X509_ATTRIBUTE *attr;
ASN1_TYPE *av;
@@ -705,10 +680,7 @@ char *name;
return 1;
}
-void hex_prin(out, buf, len)
-BIO *out;
-unsigned char *buf;
-int len;
+void hex_prin(BIO *out, unsigned char *buf, int len)
{
int i;
for (i = 0; i < len; i++) BIO_printf (out, "%02X ", buf[i]);
diff --git a/apps/pkcs7.c b/apps/pkcs7.c
index cac75f48b2..ece2cd7d68 100644
--- a/apps/pkcs7.c
+++ b/apps/pkcs7.c
@@ -81,9 +81,7 @@
* -print_certs
*/
-int MAIN(argc, argv)
-int argc;
-char **argv;
+int MAIN(int argc, char **argv)
{
PKCS7 *p7=NULL;
int i,badops=0;
diff --git a/apps/req.c b/apps/req.c
index bb3a65a5bc..ce7e318777 100644
--- a/apps/req.c
+++ b/apps/req.c
@@ -137,9 +137,7 @@ static LHASH *req_conf=NULL;
#define TYPE_DSA 2
#define TYPE_DH 3
-int MAIN(argc, argv)
-int argc;
-char **argv;
+int MAIN(int argc, char **argv)
{
#ifndef NO_DSA
DSA *dsa_params=NULL;
@@ -825,10 +823,7 @@ end:
EXIT(ex);
}
-static int make_REQ(req,pkey,attribs)
-X509_REQ *req;
-EVP_PKEY *pkey;
-int attribs;
+static int make_REQ(X509_REQ *req, EVP_PKEY *pkey, int attribs)
{
int ret=0,i;
unsigned char *p,*q;
@@ -984,14 +979,8 @@ err:
return(ret);
}
-static int add_DN_object(n,text,def,value,nid,min,max)
-X509_NAME *n;
-char *text;
-char *def;
-char *value;
-int nid;
-int min;
-int max;
+static int add_DN_object(X509_NAME *n, char *text, char *def, char *value,
+ int nid, int min, int max)
{
int i,j,ret=0;
X509_NAME_ENTRY *ne=NULL;
@@ -1044,14 +1033,8 @@ err:
return(ret);
}
-static int add_attribute_object(n,text,def,value,nid,min,max)
-STACK *n;
-char *text;
-char *def;
-char *value;
-int nid;
-int min;
-int max;
+static int add_attribute_object(STACK *n, char *text, char *def, char *value,
+ int nid, int min, int max)
{
int i,z;
X509_ATTRIBUTE *xa=NULL;
@@ -1135,10 +1118,7 @@ err:
return(0);
}
-static void MS_CALLBACK req_cb(p,n,arg)
-int p;
-int n;
-char *arg;
+static void MS_CALLBACK req_cb(int p, int n, char *arg)
{
char c='*';
@@ -1153,10 +1133,7 @@ char *arg;
#endif
}
-static int req_fix_data(nid,type,len,min,max)
-int nid;
-int *type;
-int len,min,max;
+static int req_fix_data(int nid, int *type, int len, int min, int max)
{
if (nid == NID_pkcs9_emailAddress)
*type=V_ASN1_IA5STRING;
@@ -1189,9 +1166,7 @@ int len,min,max;
}
/* Check if the end of a string matches 'end' */
-static int check_end(str, end)
-char *str;
-char *end;
+static int check_end(char *str, char *end)
{
int elen, slen;
char *tmp;
@@ -1202,8 +1177,7 @@ char *end;
return strcmp(tmp, end);
}
-static int add_oid_section(conf)
-LHASH *conf;
+static int add_oid_section(LHASH *conf)
{
char *p;
STACK *sktmp;
diff --git a/apps/rsa.c b/apps/rsa.c
index c8473d9558..e09eeda16e 100644
--- a/apps/rsa.c
+++ b/apps/rsa.c
@@ -82,9 +82,7 @@
* -modulus - print the RSA key modulus
*/
-int MAIN(argc, argv)
-int argc;
-char **argv;
+int MAIN(int argc, char **argv)
{
int ret=1;
RSA *rsa=NULL;
diff --git a/apps/s_cb.c b/apps/s_cb.c
index c18ecc3a18..ad5bc26e31 100644
--- a/apps/s_cb.c
+++ b/apps/s_cb.c
@@ -71,9 +71,7 @@
int verify_depth=0;
int verify_error=X509_V_OK;
-int MS_CALLBACK verify_callback(ok, ctx)
-int ok;
-X509_STORE_CTX *ctx;
+int MS_CALLBACK verify_callback(int ok, X509_STORE_CTX *ctx)
{
char buf[256];
X509 *err_cert;
@@ -123,10 +121,7 @@ X509_STORE_CTX *ctx;
return(ok);
}
-int set_cert_stuff(ctx, cert_file, key_file)
-SSL_CTX *ctx;
-char *cert_file;
-char *key_file;
+int set_cert_stuff(SSL_CTX *ctx, char *cert_file, char *key_file)
{
if (cert_file != NULL)
{
@@ -181,13 +176,8 @@ char *key_file;
return(1);
}
-long MS_CALLBACK bio_dump_cb(bio,cmd,argp,argi,argl,ret)
-BIO *bio;
-int cmd;
-const char *argp;
-int argi;
-long argl;
-long ret;
+long MS_CALLBACK bio_dump_cb(BIO *bio, int cmd, const char *argp, int argi,
+ long argl, long ret)
{
BIO *out;
@@ -210,10 +200,7 @@ long ret;
return(ret);
}
-void MS_CALLBACK apps_ssl_info_callback(s,where,ret)
-SSL *s;
-int where;
-int ret;
+void MS_CALLBACK apps_ssl_info_callback(SSL *s, int where, int ret)
{
char *str;
int w;
diff --git a/apps/s_client.c b/apps/s_client.c
index ffe2d70d88..20e581ec20 100644
--- a/apps/s_client.c
+++ b/apps/s_client.c
@@ -103,7 +103,7 @@ static void print_stuff();
static BIO *bio_c_out=NULL;
static int c_quiet=0;
-static void sc_usage()
+static void sc_usage(void)
{
BIO_printf(bio_err,"usage: s_client args\n");
BIO_printf(bio_err,"\n");
@@ -137,9 +137,7 @@ static void sc_usage()
}
-int MAIN(argc, argv)
-int argc;
-char **argv;
+int MAIN(int argc, char **argv)
{
int off=0;
SSL *con=NULL,*con2=NULL;
@@ -657,10 +655,7 @@ end:
}
-static void print_stuff(bio,s,full)
-BIO *bio;
-SSL *s;
-int full;
+static void print_stuff(BIO *bio, SSL *s, int full)
{
X509 *peer=NULL;
char *p;
diff --git a/apps/s_server.c b/apps/s_server.c
index 8edd8e79bf..1257ac527e 100644
--- a/apps/s_server.c
+++ b/apps/s_server.c
@@ -120,7 +120,7 @@ static unsigned char dh512_g[]={
0x02,
};
-static DH *get_dh512()
+static DH *get_dh512(void)
{
DH *dh=NULL;
@@ -164,7 +164,7 @@ static int s_debug=0;
static int s_quiet=0;
#if 0
-static void s_server_init()
+static void s_server_init(void)
{
cipher=NULL;
s_server_verify=SSL_VERIFY_NONE;
@@ -185,7 +185,7 @@ static void s_server_init()
}
#endif
-static void sv_usage()
+static void sv_usage(void)
{
BIO_printf(bio_err,"usage: s_server [args ...]\n");
BIO_printf(bio_err,"\n");
@@ -226,9 +226,7 @@ static int local_argc=0;
static char **local_argv;
static int hack=0;
-int MAIN(argc, argv)
-int argc;
-char *argv[];
+int MAIN(int argc, char *argv[])
{
short port=PORT;
char *CApath=NULL,*CAfile=NULL;
@@ -533,9 +531,7 @@ end:
EXIT(ret);
}
-static void print_stats(bio,ssl_ctx)
-BIO *bio;
-SSL_CTX *ssl_ctx;
+static void print_stats(BIO *bio, SSL_CTX *ssl_ctx)
{
BIO_printf(bio,"%4ld items in the session cache\n",
SSL_CTX_sess_number(ssl_ctx));
@@ -560,10 +556,7 @@ SSL_CTX *ssl_ctx;
SSL_CTX_sess_get_cache_size(ssl_ctx));
}
-static int sv_body(hostname, s, context)
-char *hostname;
-int s;
-char *context;
+static int sv_body(char *hostname, int s, char *context)
{
char *buf=NULL;
fd_set readfds;
@@ -779,7 +772,7 @@ err:
return(ret);
}
-static void close_accept_socket()
+static void close_accept_socket(void)
{
BIO_printf(bio_err,"shutdown accept socket\n");
if (accept_socket >= 0)
@@ -788,8 +781,7 @@ static void close_accept_socket()
}
}
-static int init_ssl_connection(con)
-SSL *con;
+static int init_ssl_connection(SSL *con)
{
int i;
const char *str;
@@ -844,7 +836,7 @@ SSL *con;
}
#ifndef NO_DH
-static DH *load_dh_param()
+static DH *load_dh_param(void)
{
DH *ret=NULL;
BIO *bio;
@@ -859,9 +851,7 @@ err:
#endif
#if 0
-static int load_CA(ctx,file)
-SSL_CTX *ctx;
-char *file;
+static int load_CA(SSL_CTX *ctx, char *file)
{
FILE *in;
X509 *x=NULL;
@@ -881,10 +871,7 @@ char *file;
}
#endif
-static int www_body(hostname, s, context)
-char *hostname;
-int s;
-char *context;
+static int www_body(char *hostname, int s, char *context)
{
char *buf=NULL;
int ret=1;
@@ -1226,10 +1213,7 @@ err:
return(ret);
}
-static RSA MS_CALLBACK *tmp_rsa_cb(s,export,keylength)
-SSL *s;
-int export;
-int keylength;
+static RSA MS_CALLBACK *tmp_rsa_cb(SSL *s, int export, int keylength)
{
static RSA *rsa_tmp=NULL;
diff --git a/apps/s_socket.c b/apps/s_socket.c
index 158014094f..19b9abbba6 100644
--- a/apps/s_socket.c
+++ b/apps/s_socket.c
@@ -93,11 +93,8 @@ static FARPROC lpTopWndProc=NULL;
static FARPROC lpTopHookProc=NULL;
extern HINSTANCE _hInstance; /* nice global CRT provides */
-static LONG FAR PASCAL topHookProc(hwnd,message,wParam,lParam)
-HWND hwnd;
-UINT message;
-WPARAM wParam;
-LPARAM lParam;
+static LONG FAR PASCAL topHookProc(HWND hwnd, UINT message, WPARAM wParam,
+ LPARAM lParam)
{
if (hwnd == topWnd)
{
@@ -122,7 +119,7 @@ static BOOL CALLBACK enumproc(HWND hwnd,LPARAM lParam)
#endif /* WIN32 */
#endif /* WINDOWS */
-void sock_cleanup()
+void sock_cleanup(void)
{
#ifdef WINDOWS
if (wsa_init_done)
@@ -134,7 +131,7 @@ void sock_cleanup()
#endif
}
-int sock_init()
+int sock_init(void)
{
#ifdef WINDOWS
if (!wsa_init_done)
@@ -165,10 +162,7 @@ int sock_init()
return(1);
}
-int init_client(sock, host, port)
-int *sock;
-char *host;
-int port;
+int init_client(int *sock, char *host, int port)
{
unsigned char ip[4];
short p=0;
@@ -181,10 +175,7 @@ int port;
return(init_client_ip(sock,ip,port));
}
-int init_client_ip(sock, ip, port)
-int *sock;
-unsigned char ip[4];
-int port;
+int init_client_ip(int *sock, unsigned char ip[4], int port)
{
unsigned long addr;
struct sockaddr_in them;
@@ -215,8 +206,7 @@ int port;
return(1);
}
-int nbio_sock_error(sock)
-int sock;
+int nbio_sock_error(int sock)
{
int j,i,size;
@@ -228,10 +218,7 @@ int sock;
return(j);
}
-int nbio_init_client_ip(sock, ip, port)
-int *sock;
-unsigned char ip[4];
-int port;
+int nbio_init_client_ip(int *sock, unsigned char ip[4], int port)
{
unsigned long addr;
struct sockaddr_in them;
@@ -280,11 +267,7 @@ int port;
return(1);
}
-int do_server(port, ret, cb, context)
-int port;
-int *ret;
-int (*cb)();
-char *context;
+int do_server(int port, int *ret, int (*cb)(), char *context)
{
int sock;
char *name;
@@ -316,10 +299,7 @@ char *context;
}
}
-int init_server_long(sock, port, ip)
-int *sock;
-int port;
-char *ip;
+int init_server_long(int *sock, int port, char *ip)
{
int ret=0;
struct sockaddr_in server;
@@ -369,17 +349,12 @@ err:
return(ret);
}
-int init_server(sock,port)
-int *sock;
-int port;
+int init_server(int *sock, int port)
{
return(init_server_long(sock, port, NULL));
}
-int do_accept(acc_sock, sock, host)
-int acc_sock;
-int *sock;
-char **host;
+int do_accept(int acc_sock, int *sock, char **host)
{
int ret,i;
struct hostent *h1,*h2;
@@ -465,11 +440,8 @@ end:
return(1);
}
-int extract_host_port(str,host_ptr,ip,port_ptr)
-char *str;
-char **host_ptr;
-unsigned char *ip;
-short *port_ptr;
+int extract_host_port(char *str, char **host_ptr, unsigned char *ip,
+ short *port_ptr)
{
char *h,*p;
@@ -493,9 +465,7 @@ err:
return(0);
}
-int host_ip(str,ip)
-char *str;
-unsigned char ip[4];
+int host_ip(char *str, unsigned char ip[4])
{
unsigned int in[4];
int i;
@@ -541,9 +511,7 @@ err:
return(0);
}
-int extract_port(str,port_ptr)
-char *str;
-short *port_ptr;
+int extract_port(char *str, short *port_ptr)
{
int i;
struct servent *s;
@@ -575,8 +543,7 @@ static struct ghbn_cache_st
static unsigned long ghbn_hits=0L;
static unsigned long ghbn_miss=0L;
-static struct hostent *GetHostByName(name)
-char *name;
+static struct hostent *GetHostByName(char *name)
{
struct hostent *ret;
int i,lowi=0;
@@ -616,11 +583,7 @@ char *name;
}
#ifndef MSDOS
-int spawn(argc, argv, in, out)
-int argc;
-char **argv;
-int *in;
-int *out;
+int spawn(int argc, char **argv, int *in, int *out)
{
int pid;
#define CHILD_READ p1[0]
diff --git a/apps/s_time.c b/apps/s_time.c
index 0d4d509dc8..1e335ef4b2 100644
--- a/apps/s_time.c
+++ b/apps/s_time.c
@@ -190,7 +190,7 @@ static int t_nbio=0;
static int exitNow = 0; /* Set when it's time to exit main */
#endif
-static void s_time_init()
+static void s_time_init(void)
{
host=SSL_CONNECT_NAME;
t_cert_file=NULL;
@@ -218,7 +218,7 @@ static void s_time_init()
/***********************************************************************
* usage - display usage message
*/
-static void s_time_usage()
+static void s_time_usage(void)
{
static char umsg[] = "\
-time arg - max number of seconds to collect data, default %d\n\
@@ -250,9 +250,7 @@ static void s_time_usage()
*
* Returns 0 if ok, -1 on bad args
*/
-static int parseArgs(argc,argv)
-int argc;
-char **argv;
+static int parseArgs(int argc, char **argv)
{
int badop = 0;
@@ -377,8 +375,7 @@ bad:
#define START 0
#define STOP 1
-static double tm_Time_F(s)
-int s;
+static double tm_Time_F(int s)
{
static double ret;
#ifdef TIMES
@@ -412,10 +409,7 @@ int s;
* MAIN - main processing area for client
* real name depends on MONOLITH
*/
-int
-MAIN(argc,argv)
-int argc;
-char **argv;
+int MAIN(int argc, char **argv)
{
double totalTime = 0.0;
int nConn = 0;
@@ -639,9 +633,7 @@ end:
* Returns:
* SSL * = the connection pointer.
*/
-static SSL *
-doConnection(scon)
-SSL *scon;
+static SSL *doConnection(SSL *scon)
{
BIO *conn;
SSL *serverCon;
diff --git a/apps/sc.c b/apps/sc.c
index fccd805921..816040d28a 100644
--- a/apps/sc.c
+++ b/apps/sc.c
@@ -110,7 +110,7 @@ static void print_stuff();
static BIO *bio_c_out=NULL;
static int c_quiet=0;
-static void sc_usage()
+static void sc_usage(void)
{
BIO_printf(bio_err,"usage: client args\n");
BIO_printf(bio_err,"\n");
@@ -143,9 +143,7 @@ static void sc_usage()
}
-int MAIN(argc, argv)
-int argc;
-char **argv;
+int MAIN(int argc, char **argv)
{
int off=0;
SSL *con=NULL,*con2=NULL;
diff --git a/apps/sess_id.c b/apps/sess_id.c
index 4a1860d080..c1b497981e 100644
--- a/apps/sess_id.c
+++ b/apps/sess_id.c
@@ -89,9 +89,7 @@ static SSL_SESSION *load_sess_id(char *file, int format);
static SSL_SESSION *load_sess_id();
#endif
-int MAIN(argc, argv)
-int argc;
-char **argv;
+int MAIN(int argc, char **argv)
{
SSL_SESSION *x=NULL;
int ret=1,i,num,badops=0;
@@ -271,9 +269,7 @@ end:
EXIT(ret);
}
-static SSL_SESSION *load_sess_id(infile, format)
-char *infile;
-int format;
+static SSL_SESSION *load_sess_id(char *infile, int format)
{
SSL_SESSION *x=NULL;
BIO *in=NULL;
diff --git a/apps/speed.c b/apps/speed.c
index 4a337be0ae..6c88a1c3d1 100644
--- a/apps/speed.c
+++ b/apps/speed.c
@@ -204,8 +204,7 @@ static SIGRETTYPE sig_done(int sig);
static SIGRETTYPE sig_done();
#endif
-static SIGRETTYPE sig_done(sig)
-int sig;
+static SIGRETTYPE sig_done(int sig)
{
signal(SIGALRM,sig_done);
run=0;
@@ -218,8 +217,7 @@ int sig;
#define START 0
#define STOP 1
-static double Time_F(s)
-int s;
+static double Time_F(int s)
{
double ret;
#ifdef TIMES
@@ -255,9 +253,7 @@ int s;
#endif
}
-int MAIN(argc,argv)
-int argc;
-char **argv;
+int MAIN(int argc, char **argv)
{
unsigned char *buf=NULL,*buf2=NULL;
int ret=1;
@@ -1183,10 +1179,7 @@ end:
EXIT(ret);
}
-static void print_message(s,num,length)
-char *s;
-long num;
-int length;
+static void print_message(char *s, long num, int length)
{
#ifdef SIGALRM
BIO_printf(bio_err,"Doing %s for %ds on %d size blocks: ",s,SECONDS,length);
@@ -1201,12 +1194,8 @@ int length;
#endif
}
-static void pkey_print_message(str,str2,num,bits,tm)
-char *str;
-char *str2;
-long num;
-int bits;
-int tm;
+static void pkey_print_message(char *str, char *str2, long num, int bits,
+ int tm)
{
#ifdef SIGALRM
BIO_printf(bio_err,"Doing %d bit %s %s's for %ds: ",bits,str,str2,tm);
diff --git a/apps/verify.c b/apps/verify.c
index 2179110d37..1a324c3da9 100644
--- a/apps/verify.c
+++ b/apps/verify.c
@@ -78,9 +78,7 @@ static int check();
static int v_verbose=0;
-int MAIN(argc, argv)
-int argc;
-char **argv;
+int MAIN(int argc, char **argv)
{
int i,ret=1;
char *CApath=NULL,*CAfile=NULL;
@@ -154,9 +152,7 @@ end:
EXIT(ret);
}
-static int check(ctx,file)
-X509_STORE *ctx;
-char *file;
+static int check(X509_STORE *ctx, char *file)
{
X509 *x=NULL;
BIO *in=NULL;
@@ -210,9 +206,7 @@ end:
return(ret);
}
-static int MS_CALLBACK cb(ok,ctx)
-int ok;
-X509_STORE_CTX *ctx;
+static int MS_CALLBACK cb(int ok, X509_STORE_CTX *ctx)
{
char buf[256];
diff --git a/apps/version.c b/apps/version.c
index 0de9c495a8..fd46e17688 100644
--- a/apps/version.c
+++ b/apps/version.c
@@ -66,9 +66,7 @@
#undef PROG
#define PROG version_main
-int MAIN(argc, argv)
-int argc;
-char **argv;
+int MAIN(int argc, char **argv)
{
int i,ret=0;
int cflags=0,version=0,date=0,options=0,platform=0;
diff --git a/apps/x509.c b/apps/x509.c
index 2a7188f121..f1975dca9d 100644
--- a/apps/x509.c
+++ b/apps/x509.c
@@ -135,9 +135,7 @@ static int x509_certify ();
static int reqfile=0;
-int MAIN(argc, argv)
-int argc;
-char **argv;
+int MAIN(int argc, char **argv)
{
int ret=1;
X509_REQ *req=NULL;
@@ -704,16 +702,9 @@ end:
EXIT(ret);
}
-static int x509_certify(ctx,CAfile,digest,x,xca,pkey,serialfile,create,days)
-X509_STORE *ctx;
-char *CAfile;
-const EVP_MD *digest;
-X509 *x;
-X509 *xca;
-EVP_PKEY *pkey;
-char *serialfile;
-int create;
-int days;
+static int x509_certify(X509_STORE *ctx, char *CAfile, const EVP_MD *digest,
+ X509 *x, X509 *xca, EVP_PKEY *pkey, char *serialfile, int create,
+ int days)
{
int ret=0;
BIO *io=NULL;
@@ -859,9 +850,7 @@ end:
return(ret);
}
-static int MS_CALLBACK callb(ok, ctx)
-int ok;
-X509_STORE_CTX *ctx;
+static int MS_CALLBACK callb(int ok, X509_STORE_CTX *ctx)
{
char buf[256];
int err;
@@ -894,9 +883,7 @@ X509_STORE_CTX *ctx;
}
}
-static EVP_PKEY *load_key(file, format)
-char *file;
-int format;
+static EVP_PKEY *load_key(char *file, int format)
{
BIO *key=NULL;
EVP_PKEY *pkey=NULL;
@@ -949,9 +936,7 @@ end:
return(pkey);
}
-static X509 *load_cert(file, format)
-char *file;
-int format;
+static X509 *load_cert(char *file, int format)
{
ASN1_HEADER *ah=NULL;
BUF_MEM *buf=NULL;
@@ -1038,11 +1023,7 @@ end:
}
/* self sign */
-static int sign(x, pkey, days, digest)
-X509 *x;
-EVP_PKEY *pkey;
-int days;
-const EVP_MD *digest;
+static int sign(X509 *x, EVP_PKEY *pkey, int days, const EVP_MD *digest)
{
EVP_PKEY *pktmp;