aboutsummaryrefslogtreecommitdiffstats
path: root/ssl
diff options
context:
space:
mode:
Diffstat (limited to 'ssl')
-rw-r--r--ssl/bio_ssl.c44
-rw-r--r--ssl/s23_clnt.c14
-rw-r--r--ssl/s23_lib.c26
-rw-r--r--ssl/s23_meth.c5
-rw-r--r--ssl/s23_pkt.c7
-rw-r--r--ssl/s23_srvr.c11
-rw-r--r--ssl/s2_clnt.c43
-rw-r--r--ssl/s2_enc.c13
-rw-r--r--ssl/s2_lib.c53
-rw-r--r--ssl/s2_meth.c5
-rw-r--r--ssl/s2_pkt.c43
-rw-r--r--ssl/s2_srvr.c37
-rw-r--r--ssl/s3_both.c37
-rw-r--r--ssl/s3_clnt.c41
-rw-r--r--ssl/s3_enc.c63
-rw-r--r--ssl/s3_lib.c78
-rw-r--r--ssl/s3_meth.c5
-rw-r--r--ssl/s3_pkt.c56
-rw-r--r--ssl/s3_srvr.c38
-rw-r--r--ssl/ssl_algs.c2
-rw-r--r--ssl/ssl_asn1.c10
-rw-r--r--ssl/ssl_cert.c7
-rw-r--r--ssl/ssl_ciph.c50
-rw-r--r--ssl/ssl_err.c2
-rw-r--r--ssl/ssl_err2.c2
-rw-r--r--ssl/ssl_lib.c2
-rw-r--r--ssl/ssl_rsa.c95
-rw-r--r--ssl/ssl_sess.c86
-rw-r--r--ssl/ssl_stat.c24
-rw-r--r--ssl/ssl_txt.c8
-rw-r--r--ssl/ssltest.c21
-rw-r--r--ssl/t1_clnt.c5
-rw-r--r--ssl/t1_enc.c68
-rw-r--r--ssl/t1_lib.c19
-rw-r--r--ssl/t1_meth.c5
-rw-r--r--ssl/t1_srvr.c5
36 files changed, 295 insertions, 735 deletions
diff --git a/ssl/bio_ssl.c b/ssl/bio_ssl.c
index 58a6d69b9b..ed08327228 100644
--- a/ssl/bio_ssl.c
+++ b/ssl/bio_ssl.c
@@ -104,13 +104,12 @@ static BIO_METHOD methods_sslp=
ssl_free,
};
-BIO_METHOD *BIO_f_ssl()
+BIO_METHOD *BIO_f_ssl(void)
{
return(&methods_sslp);
}
-static int ssl_new(bi)
-BIO *bi;
+static int ssl_new(BIO *bi)
{
BIO_SSL *bs;
@@ -127,8 +126,7 @@ BIO *bi;
return(1);
}
-static int ssl_free(a)
-BIO *a;
+static int ssl_free(BIO *a)
{
BIO_SSL *bs;
@@ -147,10 +145,7 @@ BIO *a;
return(1);
}
-static int ssl_read(b,out,outl)
-BIO *b;
-char *out;
-int outl;
+static int ssl_read(BIO *b, char *out, int outl)
{
int ret=1;
BIO_SSL *sb;
@@ -234,10 +229,7 @@ int outl;
return(ret);
}
-static int ssl_write(b,out,outl)
-BIO *b;
-char *out;
-int outl;
+static int ssl_write(BIO *b, char *out, int outl)
{
int ret,r=0;
int retry_reason=0;
@@ -305,11 +297,7 @@ int outl;
return(ret);
}
-static long ssl_ctrl(b,cmd,num,ptr)
-BIO *b;
-int cmd;
-long num;
-char *ptr;
+static long ssl_ctrl(BIO *b, int cmd, long num, char *ptr)
{
SSL **sslp,*ssl;
BIO_SSL *bs;
@@ -483,9 +471,7 @@ char *ptr;
return(ret);
}
-static int ssl_puts(bp,str)
-BIO *bp;
-char *str;
+static int ssl_puts(BIO *bp, char *str)
{
int n,ret;
@@ -494,8 +480,7 @@ char *str;
return(ret);
}
-BIO *BIO_new_buffer_ssl_connect(ctx)
-SSL_CTX *ctx;
+BIO *BIO_new_buffer_ssl_connect(SSL_CTX *ctx)
{
BIO *ret=NULL,*buf=NULL,*ssl=NULL;
@@ -512,8 +497,7 @@ err:
return(NULL);
}
-BIO *BIO_new_ssl_connect(ctx)
-SSL_CTX *ctx;
+BIO *BIO_new_ssl_connect(SSL_CTX *ctx)
{
BIO *ret=NULL,*con=NULL,*ssl=NULL;
@@ -530,9 +514,7 @@ err:
return(NULL);
}
-BIO *BIO_new_ssl(ctx,client)
-SSL_CTX *ctx;
-int client;
+BIO *BIO_new_ssl(SSL_CTX *ctx, int client)
{
BIO *ret;
SSL *ssl;
@@ -553,8 +535,7 @@ int client;
return(ret);
}
-int BIO_ssl_copy_session_id(t,f)
-BIO *t,*f;
+int BIO_ssl_copy_session_id(BIO *t, BIO *f)
{
t=BIO_find_type(t,BIO_TYPE_SSL);
f=BIO_find_type(f,BIO_TYPE_SSL);
@@ -567,8 +548,7 @@ BIO *t,*f;
return(1);
}
-void BIO_ssl_shutdown(b)
-BIO *b;
+void BIO_ssl_shutdown(BIO *b)
{
SSL *s;
diff --git a/ssl/s23_clnt.c b/ssl/s23_clnt.c
index c0948fd2da..61c7420135 100644
--- a/ssl/s23_clnt.c
+++ b/ssl/s23_clnt.c
@@ -75,8 +75,7 @@ static int ssl23_client_hello();
static int ssl23_get_server_hello();
#endif
-static SSL_METHOD *ssl23_get_client_method(ver)
-int ver;
+static SSL_METHOD *ssl23_get_client_method(int ver)
{
if (ver == SSL2_VERSION)
return(SSLv2_client_method());
@@ -88,7 +87,7 @@ int ver;
return(NULL);
}
-SSL_METHOD *SSLv23_client_method()
+SSL_METHOD *SSLv23_client_method(void)
{
static int init=1;
static SSL_METHOD SSLv23_client_data;
@@ -104,8 +103,7 @@ SSL_METHOD *SSLv23_client_method()
return(&SSLv23_client_data);
}
-int ssl23_connect(s)
-SSL *s;
+int ssl23_connect(SSL *s)
{
BUF_MEM *buf;
unsigned long Time=time(NULL);
@@ -215,8 +213,7 @@ end:
}
-static int ssl23_client_hello(s)
-SSL *s;
+static int ssl23_client_hello(SSL *s)
{
unsigned char *buf;
unsigned char *p,*d;
@@ -315,8 +312,7 @@ SSL *s;
return(ssl23_write_bytes(s));
}
-static int ssl23_get_server_hello(s)
-SSL *s;
+static int ssl23_get_server_hello(SSL *s)
{
char buf[8];
unsigned char *p;
diff --git a/ssl/s23_lib.c b/ssl/s23_lib.c
index 34aa0de4fd..4d58558522 100644
--- a/ssl/s23_lib.c
+++ b/ssl/s23_lib.c
@@ -105,23 +105,22 @@ static SSL_METHOD SSLv23_data= {
&ssl3_undef_enc_method,
};
-static long ssl23_default_timeout()
+static long ssl23_default_timeout(void)
{
return(300);
}
-SSL_METHOD *sslv23_base_method()
+SSL_METHOD *sslv23_base_method(void)
{
return(&SSLv23_data);
}
-static int ssl23_num_ciphers()
+static int ssl23_num_ciphers(void)
{
return(ssl3_num_ciphers()+ssl2_num_ciphers());
}
-static SSL_CIPHER *ssl23_get_cipher(u)
-unsigned int u;
+static SSL_CIPHER *ssl23_get_cipher(unsigned int u)
{
unsigned int uu=ssl3_num_ciphers();
@@ -133,8 +132,7 @@ unsigned int u;
/* This function needs to check if the ciphers required are actually
* available */
-static SSL_CIPHER *ssl23_get_cipher_by_char(p)
-const unsigned char *p;
+static SSL_CIPHER *ssl23_get_cipher_by_char(const unsigned char *p)
{
SSL_CIPHER c,*cp;
unsigned long id;
@@ -150,9 +148,7 @@ const unsigned char *p;
return(cp);
}
-static int ssl23_put_cipher_by_char(c,p)
-const SSL_CIPHER *c;
-unsigned char *p;
+static int ssl23_put_cipher_by_char(const SSL_CIPHER *c, unsigned char *p)
{
long l;
@@ -167,10 +163,7 @@ unsigned char *p;
return(3);
}
-static int ssl23_read(s,buf,len)
-SSL *s;
-char *buf;
-int len;
+static int ssl23_read(SSL *s, char *buf, int len)
{
int n;
@@ -200,10 +193,7 @@ int len;
}
}
-static int ssl23_write(s,buf,len)
-SSL *s;
-const char *buf;
-int len;
+static int ssl23_write(SSL *s, const char *buf, int len)
{
int n;
diff --git a/ssl/s23_meth.c b/ssl/s23_meth.c
index bbda4ff182..edcbdbb2bd 100644
--- a/ssl/s23_meth.c
+++ b/ssl/s23_meth.c
@@ -66,8 +66,7 @@ static SSL_METHOD *ssl23_get_method(int ver);
static SSL_METHOD *ssl23_get_method();
#endif
-static SSL_METHOD *ssl23_get_method(ver)
-int ver;
+static SSL_METHOD *ssl23_get_method(int ver)
{
if (ver == SSL2_VERSION)
return(SSLv23_method());
@@ -79,7 +78,7 @@ int ver;
return(NULL);
}
-SSL_METHOD *SSLv23_method()
+SSL_METHOD *SSLv23_method(void)
{
static int init=1;
static SSL_METHOD SSLv23_data;
diff --git a/ssl/s23_pkt.c b/ssl/s23_pkt.c
index 99f909d50f..64acf2ce7d 100644
--- a/ssl/s23_pkt.c
+++ b/ssl/s23_pkt.c
@@ -63,8 +63,7 @@
#include "buffer.h"
#include "ssl_locl.h"
-int ssl23_write_bytes(s)
-SSL *s;
+int ssl23_write_bytes(SSL *s)
{
int i,num,tot;
char *buf;
@@ -91,9 +90,7 @@ SSL *s;
}
/* only return when we have read 'n' bytes */
-int ssl23_read_bytes(s,n)
-SSL *s;
-int n;
+int ssl23_read_bytes(SSL *s, int n)
{
unsigned char *p;
int j;
diff --git a/ssl/s23_srvr.c b/ssl/s23_srvr.c
index fa132166bd..8dc0a0608f 100644
--- a/ssl/s23_srvr.c
+++ b/ssl/s23_srvr.c
@@ -73,8 +73,7 @@ static SSL_METHOD *ssl23_get_server_method();
int ssl23_get_client_hello();
#endif
-static SSL_METHOD *ssl23_get_server_method(ver)
-int ver;
+static SSL_METHOD *ssl23_get_server_method(int ver)
{
if (ver == SSL2_VERSION)
return(SSLv2_server_method());
@@ -86,7 +85,7 @@ int ver;
return(NULL);
}
-SSL_METHOD *SSLv23_server_method()
+SSL_METHOD *SSLv23_server_method(void)
{
static int init=1;
static SSL_METHOD SSLv23_server_data;
@@ -102,8 +101,7 @@ SSL_METHOD *SSLv23_server_method()
return(&SSLv23_server_data);
}
-int ssl23_accept(s)
-SSL *s;
+int ssl23_accept(SSL *s)
{
BUF_MEM *buf;
unsigned long Time=time(NULL);
@@ -194,8 +192,7 @@ end:
}
-int ssl23_get_client_hello(s)
-SSL *s;
+int ssl23_get_client_hello(SSL *s)
{
char buf_space[8];
char *buf= &(buf_space[0]);
diff --git a/ssl/s2_clnt.c b/ssl/s2_clnt.c
index 8c3cbde177..5652549dac 100644
--- a/ssl/s2_clnt.c
+++ b/ssl/s2_clnt.c
@@ -88,8 +88,7 @@ static int ssl_rsa_public_encrypt();
#define BREAK break
-static SSL_METHOD *ssl2_get_client_method(ver)
-int ver;
+static SSL_METHOD *ssl2_get_client_method(int ver)
{
if (ver == SSL2_VERSION)
return(SSLv2_client_method());
@@ -97,7 +96,7 @@ int ver;
return(NULL);
}
-SSL_METHOD *SSLv2_client_method()
+SSL_METHOD *SSLv2_client_method(void)
{
static int init=1;
static SSL_METHOD SSLv2_client_data;
@@ -113,8 +112,7 @@ SSL_METHOD *SSLv2_client_method()
return(&SSLv2_client_data);
}
-int ssl2_connect(s)
-SSL *s;
+int ssl2_connect(SSL *s)
{
unsigned long l=time(NULL);
BUF_MEM *buf=NULL;
@@ -296,8 +294,7 @@ end:
return(ret);
}
-static int get_server_hello(s)
-SSL *s;
+static int get_server_hello(SSL *s)
{
unsigned char *buf;
unsigned char *p;
@@ -461,8 +458,7 @@ SSL *s;
return(1);
}
-static int client_hello(s)
-SSL *s;
+static int client_hello(SSL *s)
{
unsigned char *buf;
unsigned char *p,*d;
@@ -529,8 +525,7 @@ SSL *s;
return(ssl2_do_write(s));
}
-static int client_master_key(s)
-SSL *s;
+static int client_master_key(SSL *s)
{
unsigned char *buf;
unsigned char *p,*d;
@@ -615,8 +610,7 @@ SSL *s;
return(ssl2_do_write(s));
}
-static int client_finished(s)
-SSL *s;
+static int client_finished(SSL *s)
{
unsigned char *p;
@@ -634,8 +628,7 @@ SSL *s;
}
/* read the data and then respond */
-static int client_certificate(s)
-SSL *s;
+static int client_certificate(SSL *s)
{
unsigned char *buf;
unsigned char *p,*d;
@@ -779,8 +772,7 @@ SSL *s;
return(ssl2_do_write(s));
}
-static int get_server_verify(s)
-SSL *s;
+static int get_server_verify(SSL *s)
{
unsigned char *p;
int i;
@@ -823,8 +815,7 @@ SSL *s;
return(1);
}
-static int get_server_finished(s)
-SSL *s;
+static int get_server_finished(SSL *s)
{
unsigned char *buf;
unsigned char *p;
@@ -889,11 +880,7 @@ SSL *s;
}
/* loads in the certificate from the server */
-int ssl2_set_certificate(s, type, len, data)
-SSL *s;
-int type;
-int len;
-unsigned char *data;
+int ssl2_set_certificate(SSL *s, int type, int len, unsigned char *data)
{
STACK_OF(X509) *sk=NULL;
EVP_PKEY *pkey=NULL;
@@ -963,12 +950,8 @@ err:
return(ret);
}
-static int ssl_rsa_public_encrypt(c, len, from, to, padding)
-CERT *c;
-int len;
-unsigned char *from;
-unsigned char *to;
-int padding;
+static int ssl_rsa_public_encrypt(CERT *c, int len, unsigned char *from,
+ unsigned char *to, int padding)
{
EVP_PKEY *pkey=NULL;
int i= -1;
diff --git a/ssl/s2_enc.c b/ssl/s2_enc.c
index af12dc472f..09835008a9 100644
--- a/ssl/s2_enc.c
+++ b/ssl/s2_enc.c
@@ -59,9 +59,7 @@
#include <stdio.h>
#include "ssl_locl.h"
-int ssl2_enc_init(s, client)
-SSL *s;
-int client;
+int ssl2_enc_init(SSL *s, int client)
{
/* Max number of bytes needed */
EVP_CIPHER_CTX *rs,*ws;
@@ -114,9 +112,7 @@ err:
/* read/writes from s->s2->mac_data using length for encrypt and
* decrypt. It sets the s->s2->padding, s->[rw]length and
* s->s2->pad_data ptr if we are encrypting */
-void ssl2_enc(s,send)
-SSL *s;
-int send;
+void ssl2_enc(SSL *s, int send)
{
EVP_CIPHER_CTX *ds;
unsigned long l;
@@ -146,10 +142,7 @@ int send;
EVP_Cipher(ds,s->s2->mac_data,s->s2->mac_data,l);
}
-void ssl2_mac(s, md,send)
-SSL *s;
-unsigned char *md;
-int send;
+void ssl2_mac(SSL *s, unsigned char *md, int send)
{
EVP_MD_CTX c;
unsigned char sequence[4],*p,*sec,*act;
diff --git a/ssl/s2_lib.c b/ssl/s2_lib.c
index 7241ea2cf9..43c7cab3ed 100644
--- a/ssl/s2_lib.c
+++ b/ssl/s2_lib.c
@@ -196,23 +196,22 @@ static SSL_METHOD SSLv2_data= {
&ssl3_undef_enc_method,
};
-static long ssl2_default_timeout()
+static long ssl2_default_timeout(void)
{
return(300);
}
-SSL_METHOD *sslv2_base_method()
+SSL_METHOD *sslv2_base_method(void)
{
return(&SSLv2_data);
}
-int ssl2_num_ciphers()
+int ssl2_num_ciphers(void)
{
return(SSL2_NUM_CIPHERS);
}
-SSL_CIPHER *ssl2_get_cipher(u)
-unsigned int u;
+SSL_CIPHER *ssl2_get_cipher(unsigned int u)
{
if (u < SSL2_NUM_CIPHERS)
return(&(ssl2_ciphers[SSL2_NUM_CIPHERS-1-u]));
@@ -220,14 +219,12 @@ unsigned int u;
return(NULL);
}
-int ssl2_pending(s)
-SSL *s;
+int ssl2_pending(SSL *s)
{
return(s->s2->ract_data_length);
}
-int ssl2_new(s)
-SSL *s;
+int ssl2_new(SSL *s)
{
SSL2_CTX *s2;
@@ -252,8 +249,7 @@ err:
return(0);
}
-void ssl2_free(s)
-SSL *s;
+void ssl2_free(SSL *s)
{
SSL2_CTX *s2;
@@ -268,8 +264,7 @@ SSL *s;
s->s2=NULL;
}
-void ssl2_clear(s)
-SSL *s;
+void ssl2_clear(SSL *s)
{
SSL2_CTX *s2;
unsigned char *rbuf,*wbuf;
@@ -289,11 +284,7 @@ SSL *s;
s->packet_length=0;
}
-long ssl2_ctrl(s,cmd,larg,parg)
-SSL *s;
-int cmd;
-long larg;
-char *parg;
+long ssl2_ctrl(SSL *s, int cmd, long larg, char *parg)
{
int ret=0;
@@ -308,19 +299,14 @@ char *parg;
return(ret);
}
-long ssl2_ctx_ctrl(ctx,cmd,larg,parg)
-SSL_CTX *ctx;
-int cmd;
-long larg;
-char *parg;
+long ssl2_ctx_ctrl(SSL_CTX *ctx, int cmd, long larg, char *parg)
{
return(0);
}
/* This function needs to check if the ciphers required are actually
* available */
-SSL_CIPHER *ssl2_get_cipher_by_char(p)
-const unsigned char *p;
+SSL_CIPHER *ssl2_get_cipher_by_char(const unsigned char *p)
{
static int init=1;
static SSL_CIPHER *sorted[SSL2_NUM_CIPHERS];
@@ -353,9 +339,7 @@ const unsigned char *p;
return(*cpp);
}
-int ssl2_put_cipher_by_char(c,p)
-const SSL_CIPHER *c;
-unsigned char *p;
+int ssl2_put_cipher_by_char(const SSL_CIPHER *c, unsigned char *p)
{
long l;
@@ -370,8 +354,7 @@ unsigned char *p;
return(3);
}
-void ssl2_generate_key_material(s)
-SSL *s;
+void ssl2_generate_key_material(SSL *s)
{
unsigned int i;
MD5_CTX ctx;
@@ -393,9 +376,7 @@ SSL *s;
}
}
-void ssl2_return_error(s,err)
-SSL *s;
-int err;
+void ssl2_return_error(SSL *s, int err)
{
if (!s->error)
{
@@ -407,8 +388,7 @@ int err;
}
-void ssl2_write_error(s)
-SSL *s;
+void ssl2_write_error(SSL *s)
{
char buf[3];
int i,error;
@@ -431,8 +411,7 @@ SSL *s;
s->error=0; */
}
-int ssl2_shutdown(s)
-SSL *s;
+int ssl2_shutdown(SSL *s)
{
s->shutdown=(SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN);
return(1);
diff --git a/ssl/s2_meth.c b/ssl/s2_meth.c
index f28c9162cf..7d7eed8a8f 100644
--- a/ssl/s2_meth.c
+++ b/ssl/s2_meth.c
@@ -66,8 +66,7 @@ static SSL_METHOD *ssl2_get_method(int ver);
static SSL_METHOD *ssl2_get_method();
#endif
-static SSL_METHOD *ssl2_get_method(ver)
-int ver;
+static SSL_METHOD *ssl2_get_method(int ver)
{
if (ver == SSL2_VERSION)
return(SSLv2_method());
@@ -75,7 +74,7 @@ int ver;
return(NULL);
}
-SSL_METHOD *SSLv2_method()
+SSL_METHOD *SSLv2_method(void)
{
static int init=1;
static SSL_METHOD SSLv2_data;
diff --git a/ssl/s2_pkt.c b/ssl/s2_pkt.c
index e1b13ccf65..89fe9dabb1 100644
--- a/ssl/s2_pkt.c
+++ b/ssl/s2_pkt.c
@@ -80,10 +80,7 @@ static int write_pending();
static int ssl_mt_error();
#endif
-int ssl2_peek(s,buf,len)
-SSL *s;
-char *buf;
-int len;
+int ssl2_peek(SSL *s, char *buf, int len)
{
int ret;
@@ -99,10 +96,7 @@ int len;
/* SSL_read -
* This routine will return 0 to len bytes, decrypted etc if required.
*/
-int ssl2_read(s, buf, len)
-SSL *s;
-char *buf;
-int len;
+int ssl2_read(SSL *s, char *buf, int len)
{
int n;
unsigned char mac[MAX_MAC_SIZE];
@@ -252,11 +246,8 @@ int len;
}
}
-static int read_n(s, n, max, extend)
-SSL *s;
-unsigned int n;
-unsigned int max;
-unsigned int extend;
+static int read_n(SSL *s, unsigned int n, unsigned int max,
+ unsigned int extend)
{
int i,off,newb;
@@ -354,10 +345,7 @@ unsigned int extend;
return(n);
}
-int ssl2_write(s, buf, len)
-SSL *s;
-const char *buf;
-int len;
+int ssl2_write(SSL *s, const char *buf, int len)
{
unsigned int n,tot;
int i;
@@ -403,10 +391,7 @@ int len;
}
}
-static int write_pending(s,buf,len)
-SSL *s;
-const char *buf;
-unsigned int len;
+static int write_pending(SSL *s, const char *buf, unsigned int len)
{
int i;
@@ -451,10 +436,7 @@ unsigned int len;
}
}
-static int do_ssl_write(s, buf, len)
-SSL *s;
-const char *buf;
-unsigned int len;
+static int do_ssl_write(SSL *s, const char *buf, unsigned int len)
{
unsigned int j,k,olen,p,mac_size,bs;
register unsigned char *pp;
@@ -575,10 +557,7 @@ unsigned int len;
return(write_pending(s,buf,olen));
}
-int ssl2_part_read(s,f,i)
-SSL *s;
-unsigned long f;
-int i;
+int ssl2_part_read(SSL *s, unsigned long f, int i)
{
unsigned char *p;
int j;
@@ -608,8 +587,7 @@ int i;
}
}
-int ssl2_do_write(s)
-SSL *s;
+int ssl2_do_write(SSL *s)
{
int ret;
@@ -624,8 +602,7 @@ SSL *s;
return(0);
}
-static int ssl_mt_error(n)
-int n;
+static int ssl_mt_error(int n)
{
int ret;
diff --git a/ssl/s2_srvr.c b/ssl/s2_srvr.c
index c058b522bc..83621290fb 100644
--- a/ssl/s2_srvr.c
+++ b/ssl/s2_srvr.c
@@ -88,8 +88,7 @@ static int ssl_rsa_private_decrypt();
#define BREAK break
-static SSL_METHOD *ssl2_get_server_method(ver)
-int ver;
+static SSL_METHOD *ssl2_get_server_method(int ver)
{
if (ver == SSL2_VERSION)
return(SSLv2_server_method());
@@ -97,7 +96,7 @@ int ver;
return(NULL);
}
-SSL_METHOD *SSLv2_server_method()
+SSL_METHOD *SSLv2_server_method(void)
{
static int init=1;
static SSL_METHOD SSLv2_server_data;
@@ -113,8 +112,7 @@ SSL_METHOD *SSLv2_server_method()
return(&SSLv2_server_data);
}
-int ssl2_accept(s)
-SSL *s;
+int ssl2_accept(SSL *s)
{
unsigned long l=time(NULL);
BUF_MEM *buf=NULL;
@@ -334,8 +332,7 @@ end:
return(ret);
}
-static int get_client_master_key(s)
-SSL *s;
+static int get_client_master_key(SSL *s)
{
int export,i,n,keya,ek;
unsigned char *p;
@@ -460,8 +457,7 @@ SSL *s;
return(1);
}
-static int get_client_hello(s)
-SSL *s;
+static int get_client_hello(SSL *s)
{
int i,n;
unsigned char *p;
@@ -603,8 +599,7 @@ mem_err:
return(0);
}
-static int server_hello(s)
-SSL *s;
+static int server_hello(SSL *s)
{
unsigned char *p,*d;
int n,hit;
@@ -694,8 +689,7 @@ SSL *s;
return(ssl2_do_write(s));
}
-static int get_client_finished(s)
-SSL *s;
+static int get_client_finished(SSL *s)
{
unsigned char *p;
int i;
@@ -737,8 +731,7 @@ SSL *s;
return(1);
}
-static int server_verify(s)
-SSL *s;
+static int server_verify(SSL *s)
{
unsigned char *p;
@@ -756,8 +749,7 @@ SSL *s;
return(ssl2_do_write(s));
}
-static int server_finish(s)
-SSL *s;
+static int server_finish(SSL *s)
{
unsigned char *p;
@@ -780,8 +772,7 @@ SSL *s;
}
/* send the request and check the response */
-static int request_certificate(s)
-SSL *s;
+static int request_certificate(SSL *s)
{
unsigned char *p,*p2,*buf2;
unsigned char *ccd;
@@ -938,12 +929,8 @@ end:
return(ret);
}
-static int ssl_rsa_private_decrypt(c, len, from, to,padding)
-CERT *c;
-int len;
-unsigned char *from;
-unsigned char *to;
-int padding;
+static int ssl_rsa_private_decrypt(CERT *c, int len, unsigned char *from,
+ unsigned char *to, int padding)
{
RSA *rsa;
int i;
diff --git a/ssl/s3_both.c b/ssl/s3_both.c
index c3d660ff33..d5f8c464ba 100644
--- a/ssl/s3_both.c
+++ b/ssl/s3_both.c
@@ -69,12 +69,8 @@
/* SSL3err(SSL_F_SSL3_GET_FINISHED,SSL_R_EXCESSIVE_MESSAGE_SIZE);
*/
-int ssl3_send_finished(s,a,b,sender,slen)
-SSL *s;
-int a;
-int b;
-unsigned char *sender;
-int slen;
+int ssl3_send_finished(SSL *s, int a, int b, unsigned char *sender,
+ int slen)
{
unsigned char *p,*d;
int i;
@@ -111,10 +107,7 @@ int slen;
return(ssl3_do_write(s,SSL3_RT_HANDSHAKE));
}
-int ssl3_get_finished(s,a,b)
-SSL *s;
-int a;
-int b;
+int ssl3_get_finished(SSL *s, int a, int b)
{
int al,i,ok;
long n;
@@ -174,9 +167,7 @@ f_err:
* ssl->session->read_compression assign
* ssl->session->read_hash assign
*/
-int ssl3_send_change_cipher_spec(s,a,b)
-SSL *s;
-int a,b;
+int ssl3_send_change_cipher_spec(SSL *s, int a, int b)
{
unsigned char *p;
@@ -194,9 +185,7 @@ int a,b;
return(ssl3_do_write(s,SSL3_RT_CHANGE_CIPHER_SPEC));
}
-unsigned long ssl3_output_cert_chain(s,x)
-SSL *s;
-X509 *x;
+unsigned long ssl3_output_cert_chain(SSL *s, X509 *x)
{
unsigned char *p;
int n,i;
@@ -271,11 +260,7 @@ X509 *x;
return(l);
}
-long ssl3_get_message(s,st1,stn,mt,max,ok)
-SSL *s;
-int st1,stn,mt;
-long max;
-int *ok;
+long ssl3_get_message(SSL *s, int st1, int stn, int mt, long max, int *ok)
{
unsigned char *p;
unsigned long l;
@@ -356,9 +341,7 @@ err:
return(-1);
}
-int ssl_cert_type(x,pkey)
-X509 *x;
-EVP_PKEY *pkey;
+int ssl_cert_type(X509 *x, EVP_PKEY *pkey)
{
EVP_PKEY *pk;
int ret= -1,i,j;
@@ -408,8 +391,7 @@ err:
return(ret);
}
-int ssl_verify_alarm_type(type)
-long type;
+int ssl_verify_alarm_type(long type)
{
int al;
@@ -461,8 +443,7 @@ long type;
return(al);
}
-int ssl3_setup_buffers(s)
-SSL *s;
+int ssl3_setup_buffers(SSL *s)
{
unsigned char *p;
unsigned int extra;
diff --git a/ssl/s3_clnt.c b/ssl/s3_clnt.c
index 24d4f14e93..6c8eefbdcf 100644
--- a/ssl/s3_clnt.c
+++ b/ssl/s3_clnt.c
@@ -101,8 +101,7 @@ static int ssl3_get_server_certificate();
static int ssl3_check_cert_and_algorithm();
#endif
-static SSL_METHOD *ssl3_get_client_method(ver)
-int ver;
+static SSL_METHOD *ssl3_get_client_method(int ver)
{
if (ver == SSL3_VERSION)
return(SSLv3_client_method());
@@ -110,7 +109,7 @@ int ver;
return(NULL);
}
-SSL_METHOD *SSLv3_client_method()
+SSL_METHOD *SSLv3_client_method(void)
{
static int init=1;
static SSL_METHOD SSLv3_client_data;
@@ -126,8 +125,7 @@ SSL_METHOD *SSLv3_client_method()
return(&SSLv3_client_data);
}
-int ssl3_connect(s)
-SSL *s;
+int ssl3_connect(SSL *s)
{
BUF_MEM *buf;
unsigned long Time=time(NULL),l;
@@ -468,8 +466,7 @@ end:
}
-static int ssl3_client_hello(s)
-SSL *s;
+static int ssl3_client_hello(SSL *s)
{
unsigned char *buf;
unsigned char *p,*d;
@@ -557,8 +554,7 @@ err:
return(-1);
}
-static int ssl3_get_server_hello(s)
-SSL *s;
+static int ssl3_get_server_hello(SSL *s)
{
STACK_OF(SSL_CIPHER) *sk;
SSL_CIPHER *c;
@@ -700,8 +696,7 @@ err:
return(-1);
}
-static int ssl3_get_server_certificate(s)
-SSL *s;
+static int ssl3_get_server_certificate(SSL *s)
{
int al,i,ok,ret= -1;
unsigned long n,nc,llen,l;
@@ -849,8 +844,7 @@ err:
return(ret);
}
-static int ssl3_get_key_exchange(s)
-SSL *s;
+static int ssl3_get_key_exchange(SSL *s)
{
#ifndef NO_RSA
unsigned char *q,md_buf[EVP_MAX_MD_SIZE*2];
@@ -1143,8 +1137,7 @@ err:
return(-1);
}
-static int ssl3_get_certificate_request(s)
-SSL *s;
+static int ssl3_get_certificate_request(SSL *s)
{
int ok,ret=0;
unsigned long n,nc,l;
@@ -1290,14 +1283,12 @@ err:
return(ret);
}
-static int ca_dn_cmp(a,b)
-X509_NAME **a,**b;
+static int ca_dn_cmp(X509_NAME **a, X509_NAME **b)
{
return(X509_NAME_cmp(*a,*b));
}
-static int ssl3_get_server_done(s)
-SSL *s;
+static int ssl3_get_server_done(SSL *s)
{
int ok,ret=0;
long n;
@@ -1320,8 +1311,7 @@ SSL *s;
return(ret);
}
-static int ssl3_send_client_key_exchange(s)
-SSL *s;
+static int ssl3_send_client_key_exchange(SSL *s)
{
unsigned char *p,*q,*d;
int n;
@@ -1471,8 +1461,7 @@ err:
return(-1);
}
-static int ssl3_send_client_verify(s)
-SSL *s;
+static int ssl3_send_client_verify(SSL *s)
{
unsigned char *p,*d;
unsigned char data[MD5_DIGEST_LENGTH+SHA_DIGEST_LENGTH];
@@ -1542,8 +1531,7 @@ err:
return(-1);
}
-static int ssl3_send_client_certificate(s)
-SSL *s;
+static int ssl3_send_client_certificate(SSL *s)
{
X509 *x509=NULL;
EVP_PKEY *pkey=NULL;
@@ -1622,8 +1610,7 @@ SSL *s;
#define has_bits(i,m) (((i)&(m)) == (m))
-static int ssl3_check_cert_and_algorithm(s)
-SSL *s;
+static int ssl3_check_cert_and_algorithm(SSL *s)
{
int i,idx;
long algs;
diff --git a/ssl/s3_enc.c b/ssl/s3_enc.c
index d1341af178..dfddb51d17 100644
--- a/ssl/s3_enc.c
+++ b/ssl/s3_enc.c
@@ -83,10 +83,7 @@ static int ssl3_handshake_mac(SSL *s, EVP_MD_CTX *in_ctx,
static int ssl3_handshake_mac();
#endif
-static void ssl3_generate_key_block(s,km,num)
-SSL *s;
-unsigned char *km;
-int num;
+static void ssl3_generate_key_block(SSL *s, unsigned char *km, int num)
{
MD5_CTX m5;
SHA_CTX s1;
@@ -126,9 +123,7 @@ int num;
memset(smd,0,SHA_DIGEST_LENGTH);
}
-int ssl3_change_cipher_state(s,which)
-SSL *s;
-int which;
+int ssl3_change_cipher_state(SSL *s, int which)
{
unsigned char *p,*key_block,*mac_secret;
unsigned char exp_key[EVP_MAX_KEY_LENGTH];
@@ -278,8 +273,7 @@ err2:
return(0);
}
-int ssl3_setup_key_block(s)
-SSL *s;
+int ssl3_setup_key_block(SSL *s)
{
unsigned char *p;
const EVP_CIPHER *c;
@@ -319,8 +313,7 @@ err:
return(0);
}
-void ssl3_cleanup_key_block(s)
-SSL *s;
+void ssl3_cleanup_key_block(SSL *s)
{
if (s->s3->tmp.key_block != NULL)
{
@@ -332,9 +325,7 @@ SSL *s;
s->s3->tmp.key_block_length=0;
}
-int ssl3_enc(s,send)
-SSL *s;
-int send;
+int ssl3_enc(SSL *s, int send)
{
SSL3_RECORD *rec;
EVP_CIPHER_CTX *ds;
@@ -402,36 +393,25 @@ int send;
return(1);
}
-void ssl3_init_finished_mac(s)
-SSL *s;
+void ssl3_init_finished_mac(SSL *s)
{
EVP_DigestInit(&(s->s3->finish_dgst1),s->ctx->md5);
EVP_DigestInit(&(s->s3->finish_dgst2),s->ctx->sha1);
}
-void ssl3_finish_mac(s,buf,len)
-SSL *s;
-const unsigned char *buf;
-int len;
+void ssl3_finish_mac(SSL *s, const unsigned char *buf, int len)
{
EVP_DigestUpdate(&(s->s3->finish_dgst1),buf,len);
EVP_DigestUpdate(&(s->s3->finish_dgst2),buf,len);
}
-int ssl3_cert_verify_mac(s,ctx,p)
-SSL *s;
-EVP_MD_CTX *ctx;
-unsigned char *p;
+int ssl3_cert_verify_mac(SSL *s, EVP_MD_CTX *ctx, unsigned char *p)
{
return(ssl3_handshake_mac(s,ctx,NULL,0,p));
}
-int ssl3_final_finish_mac(s,ctx1,ctx2,sender,len,p)
-SSL *s;
-EVP_MD_CTX *ctx1,*ctx2;
-unsigned char *sender;
-int len;
-unsigned char *p;
+int ssl3_final_finish_mac(SSL *s, EVP_MD_CTX *ctx1, EVP_MD_CTX *ctx2,
+ unsigned char *sender, int len, unsigned char *p)
{
int ret;
@@ -441,12 +421,8 @@ unsigned char *p;
return(ret);
}
-static int ssl3_handshake_mac(s,in_ctx,sender,len,p)
-SSL *s;
-EVP_MD_CTX *in_ctx;
-unsigned char *sender;
-int len;
-unsigned char *p;
+static int ssl3_handshake_mac(SSL *s, EVP_MD_CTX *in_ctx,
+ unsigned char *sender, int len, unsigned char *p)
{
unsigned int ret;
int npad,n;
@@ -478,10 +454,7 @@ unsigned char *p;
return((int)ret);
}
-int ssl3_mac(ssl,md,send)
-SSL *ssl;
-unsigned char *md;
-int send;
+int ssl3_mac(SSL *ssl, unsigned char *md, int send)
{
SSL3_RECORD *rec;
unsigned char *mac_sec,*seq;
@@ -535,11 +508,8 @@ int send;
return(md_size);
}
-int ssl3_generate_master_secret(s,out,p,len)
-SSL *s;
-unsigned char *out;
-unsigned char *p;
-int len;
+int ssl3_generate_master_secret(SSL *s, unsigned char *out, unsigned char *p,
+ int len)
{
static const unsigned char *salt[3]={
(const unsigned char *)"A",
@@ -572,8 +542,7 @@ int len;
return(ret);
}
-int ssl3_alert_code(code)
-int code;
+int ssl3_alert_code(int code)
{
switch (code)
{
diff --git a/ssl/s3_lib.c b/ssl/s3_lib.c
index 444e554c27..4e58bcd632 100644
--- a/ssl/s3_lib.c
+++ b/ssl/s3_lib.c
@@ -464,25 +464,24 @@ static SSL_METHOD SSLv3_data= {
&SSLv3_enc_data,
};
-static long ssl3_default_timeout()
+static long ssl3_default_timeout(void)
{
/* 2 hours, the 24 hours mentioned in the SSLv3 spec
* is way too long for http, the cache would over fill */
return(60*60*2);
}
-SSL_METHOD *sslv3_base_method()
+SSL_METHOD *sslv3_base_method(void)
{
return(&SSLv3_data);
}
-int ssl3_num_ciphers()
+int ssl3_num_ciphers(void)
{
return(SSL3_NUM_CIPHERS);
}
-SSL_CIPHER *ssl3_get_cipher(u)
-unsigned int u;
+SSL_CIPHER *ssl3_get_cipher(unsigned int u)
{
if (u < SSL3_NUM_CIPHERS)
return(&(ssl3_ciphers[SSL3_NUM_CIPHERS-1-u]));
@@ -491,14 +490,12 @@ unsigned int u;
}
/* The problem is that it may not be the correct record type */
-int ssl3_pending(s)
-SSL *s;
+int ssl3_pending(SSL *s)
{
return(s->s3->rrec.length);
}
-int ssl3_new(s)
-SSL *s;
+int ssl3_new(SSL *s)
{
SSL3_CTX *s3;
@@ -520,8 +517,7 @@ err:
return(0);
}
-void ssl3_free(s)
-SSL *s;
+void ssl3_free(SSL *s)
{
if(s == NULL)
return;
@@ -544,8 +540,7 @@ SSL *s;
s->s3=NULL;
}
-void ssl3_clear(s)
-SSL *s;
+void ssl3_clear(SSL *s)
{
unsigned char *rp,*wp;
@@ -576,11 +571,7 @@ SSL *s;
s->version=SSL3_VERSION;
}
-long ssl3_ctrl(s,cmd,larg,parg)
-SSL *s;
-int cmd;
-long larg;
-char *parg;
+long ssl3_ctrl(SSL *s, int cmd, long larg, char *parg)
{
int ret=0;
@@ -693,11 +684,7 @@ char *parg;
return(ret);
}
-long ssl3_ctx_ctrl(ctx,cmd,larg,parg)
-SSL_CTX *ctx;
-int cmd;
-long larg;
-char *parg;
+long ssl3_ctx_ctrl(SSL_CTX *ctx, int cmd, long larg, char *parg)
{
CERT *cert;
@@ -800,8 +787,7 @@ char *parg;
/* This function needs to check if the ciphers required are actually
* available */
-SSL_CIPHER *ssl3_get_cipher_by_char(p)
-const unsigned char *p;
+SSL_CIPHER *ssl3_get_cipher_by_char(const unsigned char *p)
{
static int init=1;
static SSL_CIPHER *sorted[SSL3_NUM_CIPHERS];
@@ -833,9 +819,7 @@ const unsigned char *p;
return(*cpp);
}
-int ssl3_put_cipher_by_char(c,p)
-const SSL_CIPHER *c;
-unsigned char *p;
+int ssl3_put_cipher_by_char(const SSL_CIPHER *c, unsigned char *p)
{
long l;
@@ -849,9 +833,7 @@ unsigned char *p;
return(2);
}
-int ssl3_part_read(s,i)
-SSL *s;
-int i;
+int ssl3_part_read(SSL *s, int i)
{
s->rwstate=SSL_READING;
@@ -866,10 +848,8 @@ int i;
}
}
-SSL_CIPHER *ssl3_choose_cipher(s,have,pref)
-SSL *s;
-STACK_OF(SSL_CIPHER) *have;
-STACK_OF(SSL_CIPHER) *pref;
+SSL_CIPHER *ssl3_choose_cipher(SSL *s, STACK_OF(SSL_CIPHER) *have,
+ STACK_OF(SSL_CIPHER) *pref)
{
SSL_CIPHER *c,*ret=NULL;
int i,j,ok;
@@ -931,9 +911,7 @@ STACK_OF(SSL_CIPHER) *pref;
return(ret);
}
-int ssl3_get_req_cert_type(s,p)
-SSL *s;
-unsigned char *p;
+int ssl3_get_req_cert_type(SSL *s, unsigned char *p)
{
int ret=0;
unsigned long alg;
@@ -970,8 +948,7 @@ unsigned char *p;
return(ret);
}
-int ssl3_shutdown(s)
-SSL *s;
+int ssl3_shutdown(SSL *s)
{
/* Don't do anything much if we have not done the handshake or
@@ -1011,10 +988,7 @@ SSL *s;
return(0);
}
-int ssl3_write(s,buf,len)
-SSL *s;
-const char *buf;
-int len;
+int ssl3_write(SSL *s, const char *buf, int len)
{
int ret,n;
@@ -1067,10 +1041,7 @@ int len;
return(ret);
}
-int ssl3_read(s,buf,len)
-SSL *s;
-char *buf;
-int len;
+int ssl3_read(SSL *s, char *buf, int len)
{
int ret;
@@ -1092,10 +1063,7 @@ int len;
return(ret);
}
-int ssl3_peek(s,buf,len)
-SSL *s;
-char *buf;
-int len;
+int ssl3_peek(SSL *s, char *buf, int len)
{
SSL3_RECORD *rr;
int n;
@@ -1117,8 +1085,7 @@ int len;
return(n);
}
-int ssl3_renegotiate(s)
-SSL *s;
+int ssl3_renegotiate(SSL *s)
{
if (s->handshake_func == NULL)
return(1);
@@ -1130,8 +1097,7 @@ SSL *s;
return(1);
}
-int ssl3_renegotiate_check(s)
-SSL *s;
+int ssl3_renegotiate_check(SSL *s)
{
int ret=0;
diff --git a/ssl/s3_meth.c b/ssl/s3_meth.c
index 387b352370..d9cd9c2210 100644
--- a/ssl/s3_meth.c
+++ b/ssl/s3_meth.c
@@ -66,8 +66,7 @@ static SSL_METHOD *ssl3_get_method(int ver);
static SSL_METHOD *ssl3_get_method();
#endif
-static SSL_METHOD *ssl3_get_method(ver)
-int ver;
+static SSL_METHOD *ssl3_get_method(int ver)
{
if (ver == SSL3_VERSION)
return(SSLv3_method());
@@ -75,7 +74,7 @@ int ver;
return(NULL);
}
-SSL_METHOD *SSLv3_method()
+SSL_METHOD *SSLv3_method(void)
{
static int init=1;
static SSL_METHOD SSLv3_data;
diff --git a/ssl/s3_pkt.c b/ssl/s3_pkt.c
index 6b1addc6ac..6e581e1ab1 100644
--- a/ssl/s3_pkt.c
+++ b/ssl/s3_pkt.c
@@ -110,11 +110,7 @@ static int do_uncompress();
static int do_change_cipher_spec();
#endif
-static int ssl3_read_n(s,n,max,extend)
-SSL *s;
-int n;
-int max;
-int extend;
+static int ssl3_read_n(SSL *s, int n, int max, int extend)
{
int i,off,newb;
@@ -223,8 +219,7 @@ int extend;
* ssl->s3->rrec.data, - data
* ssl->s3->rrec.length, - number of bytes
*/
-static int ssl3_get_record(s)
-SSL *s;
+static int ssl3_get_record(SSL *s)
{
int ssl_major,ssl_minor,al;
int n,i,ret= -1;
@@ -435,8 +430,7 @@ err:
return(ret);
}
-static int do_uncompress(ssl)
-SSL *ssl;
+static int do_uncompress(SSL *ssl)
{
int i;
SSL3_RECORD *rr;
@@ -453,8 +447,7 @@ SSL *ssl;
return(1);
}
-static int do_compress(ssl)
-SSL *ssl;
+static int do_compress(SSL *ssl)
{
int i;
SSL3_RECORD *wr;
@@ -475,11 +468,7 @@ SSL *ssl;
/* Call this to write data
* It will return <= 0 if not all data has been sent or non-blocking IO.
*/
-int ssl3_write_bytes(s,type,buf,len)
-SSL *s;
-int type;
-const char *buf;
-int len;
+int ssl3_write_bytes(SSL *s, int type, const char *buf, int len)
{
unsigned int tot,n,nw;
int i;
@@ -524,11 +513,8 @@ int len;
}
}
-static int do_ssl3_write(s,type,buf,len)
-SSL *s;
-int type;
-const char *buf;
-unsigned int len;
+static int do_ssl3_write(SSL *s, int type, const char *buf,
+ unsigned int len)
{
unsigned char *p,*plen;
int i,mac_size,clear=0;
@@ -642,11 +628,8 @@ err:
}
/* if s->s3->wbuf.left != 0, we need to call this */
-static int ssl3_write_pending(s,type,buf,len)
-SSL *s;
-int type;
-const char *buf;
-unsigned int len;
+static int ssl3_write_pending(SSL *s, int type, const char *buf,
+ unsigned int len)
{
int i;
@@ -686,11 +669,7 @@ unsigned int len;
}
}
-int ssl3_read_bytes(s,type,buf,len)
-SSL *s;
-int type;
-char *buf;
-int len;
+int ssl3_read_bytes(SSL *s, int type, char *buf, int len)
{
int al,i,j,n,ret;
SSL3_RECORD *rr;
@@ -984,8 +963,7 @@ err:
return(-1);
}
-static int do_change_cipher_spec(s)
-SSL *s;
+static int do_change_cipher_spec(SSL *s)
{
int i;
unsigned char *sender;
@@ -1027,9 +1005,7 @@ SSL *s;
return(1);
}
-int ssl3_do_write(s,type)
-SSL *s;
-int type;
+int ssl3_do_write(SSL *s, int type)
{
int ret;
@@ -1043,10 +1019,7 @@ int type;
return(0);
}
-void ssl3_send_alert(s,level,desc)
-SSL *s;
-int level;
-int desc;
+void ssl3_send_alert(SSL *s, int level, int desc)
{
/* Map tls/ssl alert value to correct one */
desc=s->method->ssl3_enc->alert_value(desc);
@@ -1064,8 +1037,7 @@ int desc;
* some time in the future */
}
-int ssl3_dispatch_alert(s)
-SSL *s;
+int ssl3_dispatch_alert(SSL *s)
{
int i,j;
void (*cb)()=NULL;
diff --git a/ssl/s3_srvr.c b/ssl/s3_srvr.c
index 3969657599..06e5268a54 100644
--- a/ssl/s3_srvr.c
+++ b/ssl/s3_srvr.c
@@ -101,8 +101,7 @@ static int ssl3_send_hello_request();
#endif
-static SSL_METHOD *ssl3_get_server_method(ver)
-int ver;
+static SSL_METHOD *ssl3_get_server_method(int ver)
{
if (ver == SSL3_VERSION)
return(SSLv3_server_method());
@@ -110,7 +109,7 @@ int ver;
return(NULL);
}
-SSL_METHOD *SSLv3_server_method()
+SSL_METHOD *SSLv3_server_method(void)
{
static int init=1;
static SSL_METHOD SSLv3_server_data;
@@ -126,8 +125,7 @@ SSL_METHOD *SSLv3_server_method()
return(&SSLv3_server_data);
}
-int ssl3_accept(s)
-SSL *s;
+int ssl3_accept(SSL *s)
{
BUF_MEM *buf;
unsigned long l,Time=time(NULL);
@@ -523,8 +521,7 @@ end:
return(ret);
}
-static int ssl3_send_hello_request(s)
-SSL *s;
+static int ssl3_send_hello_request(SSL *s)
{
unsigned char *p;
@@ -546,8 +543,7 @@ SSL *s;
return(ssl3_do_write(s,SSL3_RT_HANDSHAKE));
}
-static int ssl3_get_client_hello(s)
-SSL *s;
+static int ssl3_get_client_hello(SSL *s)
{
int i,j,ok,al,ret= -1;
long n;
@@ -814,8 +810,7 @@ err:
return(ret);
}
-static int ssl3_send_server_hello(s)
-SSL *s;
+static int ssl3_send_server_hello(SSL *s)
{
unsigned char *buf;
unsigned char *p,*d;
@@ -881,8 +876,7 @@ SSL *s;
return(ssl3_do_write(s,SSL3_RT_HANDSHAKE));
}
-static int ssl3_send_server_done(s)
-SSL *s;
+static int ssl3_send_server_done(SSL *s)
{
unsigned char *p;
@@ -906,8 +900,7 @@ SSL *s;
return(ssl3_do_write(s,SSL3_RT_HANDSHAKE));
}
-static int ssl3_send_server_key_exchange(s)
-SSL *s;
+static int ssl3_send_server_key_exchange(SSL *s)
{
#ifndef NO_RSA
unsigned char *q;
@@ -1131,8 +1124,7 @@ err:
return(-1);
}
-static int ssl3_send_certificate_request(s)
-SSL *s;
+static int ssl3_send_certificate_request(SSL *s)
{
unsigned char *p,*d;
int i,j,nl,off,n;
@@ -1209,8 +1201,7 @@ err:
return(-1);
}
-static int ssl3_get_client_key_exchange(s)
-SSL *s;
+static int ssl3_get_client_key_exchange(SSL *s)
{
int i,al,ok;
long n;
@@ -1416,8 +1407,7 @@ err:
return(-1);
}
-static int ssl3_get_cert_verify(s)
-SSL *s;
+static int ssl3_get_cert_verify(SSL *s)
{
EVP_PKEY *pkey=NULL;
unsigned char *p;
@@ -1555,8 +1545,7 @@ end:
return(ret);
}
-static int ssl3_get_client_certificate(s)
-SSL *s;
+static int ssl3_get_client_certificate(SSL *s)
{
int i,ok,al,ret= -1;
X509 *x=NULL;
@@ -1698,8 +1687,7 @@ err:
return(ret);
}
-int ssl3_send_server_certificate(s)
-SSL *s;
+int ssl3_send_server_certificate(SSL *s)
{
unsigned long l;
X509 *x;
diff --git a/ssl/ssl_algs.c b/ssl/ssl_algs.c
index 31809582bd..0c0e8da482 100644
--- a/ssl/ssl_algs.c
+++ b/ssl/ssl_algs.c
@@ -61,7 +61,7 @@
#include "lhash.h"
#include "ssl_locl.h"
-int SSL_library_init()
+int SSL_library_init(void)
{
#ifndef NO_DES
EVP_add_cipher(EVP_des_cbc());
diff --git a/ssl/ssl_asn1.c b/ssl/ssl_asn1.c
index f4ba04a961..7454ba39ac 100644
--- a/ssl/ssl_asn1.c
+++ b/ssl/ssl_asn1.c
@@ -80,9 +80,7 @@ typedef struct ssl_session_asn1_st
* SSLerr(SSL_F_D2I_SSL_SESSION,SSL_R_UNSUPPORTED_CIPHER);
*/
-int i2d_SSL_SESSION(in,pp)
-SSL_SESSION *in;
-unsigned char **pp;
+int i2d_SSL_SESSION(SSL_SESSION *in, unsigned char **pp)
{
#define LSIZE2 (sizeof(long)*2)
int v1=0,v2=0,v3=0,v4=0;
@@ -199,10 +197,8 @@ unsigned char **pp;
M_ASN1_I2D_finish();
}
-SSL_SESSION *d2i_SSL_SESSION(a,pp,length)
-SSL_SESSION **a;
-unsigned char **pp;
-long length;
+SSL_SESSION *d2i_SSL_SESSION(SSL_SESSION **a, unsigned char **pp,
+ long length)
{
int version,ssl_version=0,i;
long id;
diff --git a/ssl/ssl_cert.c b/ssl/ssl_cert.c
index 52812e9966..90eb769ea6 100644
--- a/ssl/ssl_cert.c
+++ b/ssl/ssl_cert.c
@@ -66,7 +66,7 @@
#include "pem.h"
#include "ssl_locl.h"
-int SSL_get_ex_data_X509_STORE_CTX_idx()
+int SSL_get_ex_data_X509_STORE_CTX_idx(void)
{
static int ssl_x509_store_ctx_idx= -1;
@@ -78,7 +78,7 @@ int SSL_get_ex_data_X509_STORE_CTX_idx()
return(ssl_x509_store_ctx_idx);
}
-CERT *ssl_cert_new()
+CERT *ssl_cert_new(void)
{
CERT *ret;
@@ -207,8 +207,7 @@ int ssl_verify_cert_chain(SSL *s,STACK_OF(X509) *sk)
return(i);
}
-static void set_client_CA_list(STACK_OF(X509_NAME) **ca_list,
- STACK_OF(X509_NAME) *list)
+static void set_client_CA_list(STACK_OF(X509_NAME) **ca_list,STACK_OF(X509_NAME) *list)
{
if (*ca_list != NULL)
sk_X509_NAME_pop_free(*ca_list,X509_NAME_free);
diff --git a/ssl/ssl_ciph.c b/ssl/ssl_ciph.c
index 2b95ee6aff..b5d6f09969 100644
--- a/ssl/ssl_ciph.c
+++ b/ssl/ssl_ciph.c
@@ -159,13 +159,12 @@ static SSL_CIPHER cipher_aliases[]={
static int init_ciphers=1;
static void load_ciphers();
-static int cmp_by_name(a,b)
-SSL_CIPHER **a,**b;
+static int cmp_by_name(SSL_CIPHER **a, SSL_CIPHER **b)
{
return(strcmp((*a)->name,(*b)->name));
}
-static void load_ciphers()
+static void load_ciphers(void)
{
init_ciphers=0;
ssl_cipher_methods[SSL_ENC_DES_IDX]=
@@ -185,11 +184,8 @@ static void load_ciphers()
EVP_get_digestbyname(SN_sha1);
}
-int ssl_cipher_get_evp(s,enc,md,comp)
-SSL_SESSION *s;
-const EVP_CIPHER **enc;
-const EVP_MD **md;
-SSL_COMP **comp;
+int ssl_cipher_get_evp(SSL_SESSION *s, const EVP_CIPHER **enc,
+ const EVP_MD **md, SSL_COMP **comp)
{
int i;
SSL_CIPHER *c;
@@ -282,8 +278,8 @@ SSL_COMP **comp;
#define ITEM_SEP(a) \
(((a) == ':') || ((a) == ' ') || ((a) == ';') || ((a) == ','))
-static void ll_append_tail(head,curr,tail)
-CIPHER_ORDER **head,*curr,**tail;
+static void ll_append_tail(CIPHER_ORDER **head, CIPHER_ORDER *curr,
+ CIPHER_ORDER **tail)
{
if (curr == *tail) return;
if (curr == *head)
@@ -298,11 +294,10 @@ CIPHER_ORDER **head,*curr,**tail;
*tail=curr;
}
-STACK_OF(SSL_CIPHER) *ssl_create_cipher_list(ssl_method,cipher_list,
- cipher_list_by_id,str)
-SSL_METHOD *ssl_method;
-STACK_OF(SSL_CIPHER) **cipher_list,**cipher_list_by_id;
-char *str;
+STACK_OF(SSL_CIPHER) *ssl_create_cipher_list(SSL_METHOD *ssl_method,
+ STACK_OF(SSL_CIPHER) **cipher_list,
+ STACK_OF(SSL_CIPHER) **cipher_list_by_id,
+ char *str)
{
SSL_CIPHER *c;
char *l;
@@ -613,10 +608,7 @@ err:
return(ok);
}
-char *SSL_CIPHER_description(cipher,buf,len)
-SSL_CIPHER *cipher;
-char *buf;
-int len;
+char *SSL_CIPHER_description(SSL_CIPHER *cipher, char *buf, int len)
{
int is_export,pkl,kl;
char *ver,*exp;
@@ -734,8 +726,7 @@ int len;
return(buf);
}
-char *SSL_CIPHER_get_version(c)
-SSL_CIPHER *c;
+char *SSL_CIPHER_get_version(SSL_CIPHER *c)
{
int i;
@@ -750,8 +741,7 @@ SSL_CIPHER *c;
}
/* return the actual cipher being used */
-const char *SSL_CIPHER_get_name(c)
-SSL_CIPHER *c;
+const char *SSL_CIPHER_get_name(SSL_CIPHER *c)
{
if (c != NULL)
return(c->name);
@@ -759,9 +749,7 @@ SSL_CIPHER *c;
}
/* number of bits for symetric cipher */
-int SSL_CIPHER_get_bits(c,alg_bits)
-SSL_CIPHER *c;
-int *alg_bits;
+int SSL_CIPHER_get_bits(SSL_CIPHER *c, int *alg_bits)
{
int ret=0,a=0;
const EVP_CIPHER *enc;
@@ -794,9 +782,7 @@ int *alg_bits;
return(ret);
}
-SSL_COMP *ssl3_comp_find(sk,n)
-STACK_OF(SSL_COMP) *sk;
-int n;
+SSL_COMP *ssl3_comp_find(STACK_OF(SSL_COMP) *sk, int n)
{
SSL_COMP *ctmp;
int i,nn;
@@ -817,14 +803,12 @@ static int sk_comp_cmp(SSL_COMP **a,SSL_COMP **b)
return((*a)->id-(*b)->id);
}
-STACK_OF(SSL_COMP) *SSL_COMP_get_compression_methods()
+STACK_OF(SSL_COMP) *SSL_COMP_get_compression_methods(void)
{
return(ssl_comp_methods);
}
-int SSL_COMP_add_compression_method(id,cm)
-int id;
-COMP_METHOD *cm;
+int SSL_COMP_add_compression_method(int id, COMP_METHOD *cm)
{
SSL_COMP *comp;
STACK_OF(SSL_COMP) *sk;
diff --git a/ssl/ssl_err.c b/ssl/ssl_err.c
index 4f8bd3652a..a9c2b6f66e 100644
--- a/ssl/ssl_err.c
+++ b/ssl/ssl_err.c
@@ -388,7 +388,7 @@ static ERR_STRING_DATA SSL_str_reasons[]=
#endif
-void ERR_load_SSL_strings()
+void ERR_load_SSL_strings(void)
{
static int init=1;
diff --git a/ssl/ssl_err2.c b/ssl/ssl_err2.c
index 0b91f7b8d2..dc8d038875 100644
--- a/ssl/ssl_err2.c
+++ b/ssl/ssl_err2.c
@@ -60,7 +60,7 @@
#include "err.h"
#include "ssl.h"
-void SSL_load_error_strings()
+void SSL_load_error_strings(void)
{
#ifndef NO_ERR
ERR_load_crypto_strings();
diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c
index 2fad1c32c3..6479e38959 100644
--- a/ssl/ssl_lib.c
+++ b/ssl/ssl_lib.c
@@ -1678,7 +1678,7 @@ void SSL_set_info_callback(SSL *ssl,void (*cb)())
ssl->info_callback=cb;
}
-void (*SSL_get_info_callback(SSL *ssl))()
+void (*SSL_get_info_callback(SSL *ssl))(void)
{
return((void (*)())ssl->info_callback);
}
diff --git a/ssl/ssl_rsa.c b/ssl/ssl_rsa.c
index 8579c51fc6..9d10831ca0 100644
--- a/ssl/ssl_rsa.c
+++ b/ssl/ssl_rsa.c
@@ -72,9 +72,7 @@ static int ssl_set_cert();
static int ssl_set_pkey();
#endif
-int SSL_use_certificate(ssl, x)
-SSL *ssl;
-X509 *x;
+int SSL_use_certificate(SSL *ssl, X509 *x)
{
if (x == NULL)
{
@@ -90,10 +88,7 @@ X509 *x;
}
#ifndef NO_STDIO
-int SSL_use_certificate_file(ssl, file, type)
-SSL *ssl;
-char *file;
-int type;
+int SSL_use_certificate_file(SSL *ssl, char *file, int type)
{
int j;
BIO *in;
@@ -142,10 +137,7 @@ end:
}
#endif
-int SSL_use_certificate_ASN1(ssl, d,len)
-SSL *ssl;
-unsigned char *d;
-int len;
+int SSL_use_certificate_ASN1(SSL *ssl, unsigned char *d, int len)
{
X509 *x;
int ret;
@@ -163,9 +155,7 @@ int len;
}
#ifndef NO_RSA
-int SSL_use_RSAPrivateKey(ssl, rsa)
-SSL *ssl;
-RSA *rsa;
+int SSL_use_RSAPrivateKey(SSL *ssl, RSA *rsa)
{
EVP_PKEY *pkey;
int ret;
@@ -195,9 +185,7 @@ RSA *rsa;
}
#endif
-static int ssl_set_pkey(c,pkey)
-CERT *c;
-EVP_PKEY *pkey;
+static int ssl_set_pkey(CERT *c, EVP_PKEY *pkey)
{
int i,ok=0,bad=0;
@@ -271,10 +259,7 @@ EVP_PKEY *pkey;
#ifndef NO_RSA
#ifndef NO_STDIO
-int SSL_use_RSAPrivateKey_file(ssl, file, type)
-SSL *ssl;
-char *file;
-int type;
+int SSL_use_RSAPrivateKey_file(SSL *ssl, char *file, int type)
{
int j,ret=0;
BIO *in;
@@ -321,10 +306,7 @@ end:
}
#endif
-int SSL_use_RSAPrivateKey_ASN1(ssl,d,len)
-SSL *ssl;
-unsigned char *d;
-long len;
+int SSL_use_RSAPrivateKey_ASN1(SSL *ssl, unsigned char *d, long len)
{
int ret;
unsigned char *p;
@@ -343,9 +325,7 @@ long len;
}
#endif /* !NO_RSA */
-int SSL_use_PrivateKey(ssl, pkey)
-SSL *ssl;
-EVP_PKEY *pkey;
+int SSL_use_PrivateKey(SSL *ssl, EVP_PKEY *pkey)
{
int ret;
@@ -364,10 +344,7 @@ EVP_PKEY *pkey;
}
#ifndef NO_STDIO
-int SSL_use_PrivateKey_file(ssl, file, type)
-SSL *ssl;
-char *file;
-int type;
+int SSL_use_PrivateKey_file(SSL *ssl, char *file, int type)
{
int j,ret=0;
BIO *in;
@@ -409,11 +386,7 @@ end:
}
#endif
-int SSL_use_PrivateKey_ASN1(type,ssl,d,len)
-int type;
-SSL *ssl;
-unsigned char *d;
-long len;
+int SSL_use_PrivateKey_ASN1(int type, SSL *ssl, unsigned char *d, long len)
{
int ret;
unsigned char *p;
@@ -431,9 +404,7 @@ long len;
return(ret);
}
-int SSL_CTX_use_certificate(ctx, x)
-SSL_CTX *ctx;
-X509 *x;
+int SSL_CTX_use_certificate(SSL_CTX *ctx, X509 *x)
{
if (x == NULL)
{
@@ -448,9 +419,7 @@ X509 *x;
return(ssl_set_cert(ctx->default_cert,x));
}
-static int ssl_set_cert(c,x)
-CERT *c;
-X509 *x;
+static int ssl_set_cert(CERT *c, X509 *x)
{
EVP_PKEY *pkey;
int i,ok=0,bad=0;
@@ -531,10 +500,7 @@ X509 *x;
}
#ifndef NO_STDIO
-int SSL_CTX_use_certificate_file(ctx, file, type)
-SSL_CTX *ctx;
-char *file;
-int type;
+int SSL_CTX_use_certificate_file(SSL_CTX *ctx, char *file, int type)
{
int j;
BIO *in;
@@ -583,10 +549,7 @@ end:
}
#endif
-int SSL_CTX_use_certificate_ASN1(ctx, len, d)
-SSL_CTX *ctx;
-int len;
-unsigned char *d;
+int SSL_CTX_use_certificate_ASN1(SSL_CTX *ctx, int len, unsigned char *d)
{
X509 *x;
int ret;
@@ -604,9 +567,7 @@ unsigned char *d;
}
#ifndef NO_RSA
-int SSL_CTX_use_RSAPrivateKey(ctx, rsa)
-SSL_CTX *ctx;
-RSA *rsa;
+int SSL_CTX_use_RSAPrivateKey(SSL_CTX *ctx, RSA *rsa)
{
int ret;
EVP_PKEY *pkey;
@@ -636,10 +597,7 @@ RSA *rsa;
}
#ifndef NO_STDIO
-int SSL_CTX_use_RSAPrivateKey_file(ctx, file, type)
-SSL_CTX *ctx;
-char *file;
-int type;
+int SSL_CTX_use_RSAPrivateKey_file(SSL_CTX *ctx, char *file, int type)
{
int j,ret=0;
BIO *in;
@@ -686,10 +644,7 @@ end:
}
#endif
-int SSL_CTX_use_RSAPrivateKey_ASN1(ctx,d,len)
-SSL_CTX *ctx;
-unsigned char *d;
-long len;
+int SSL_CTX_use_RSAPrivateKey_ASN1(SSL_CTX *ctx, unsigned char *d, long len)
{
int ret;
unsigned char *p;
@@ -708,9 +663,7 @@ long len;
}
#endif /* !NO_RSA */
-int SSL_CTX_use_PrivateKey(ctx, pkey)
-SSL_CTX *ctx;
-EVP_PKEY *pkey;
+int SSL_CTX_use_PrivateKey(SSL_CTX *ctx, EVP_PKEY *pkey)
{
if (pkey == NULL)
{
@@ -726,10 +679,7 @@ EVP_PKEY *pkey;
}
#ifndef NO_STDIO
-int SSL_CTX_use_PrivateKey_file(ctx, file, type)
-SSL_CTX *ctx;
-char *file;
-int type;
+int SSL_CTX_use_PrivateKey_file(SSL_CTX *ctx, char *file, int type)
{
int j,ret=0;
BIO *in;
@@ -771,11 +721,8 @@ end:
}
#endif
-int SSL_CTX_use_PrivateKey_ASN1(type,ctx,d,len)
-int type;
-SSL_CTX *ctx;
-unsigned char *d;
-long len;
+int SSL_CTX_use_PrivateKey_ASN1(int type, SSL_CTX *ctx, unsigned char *d,
+ long len)
{
int ret;
unsigned char *p;
diff --git a/ssl/ssl_sess.c b/ssl/ssl_sess.c
index 1eb40c0606..3422099ace 100644
--- a/ssl/ssl_sess.c
+++ b/ssl/ssl_sess.c
@@ -72,18 +72,13 @@ static void SSL_SESSION_list_add();
static int ssl_session_num=0;
static STACK *ssl_session_meth=NULL;
-SSL_SESSION *SSL_get_session(ssl)
-SSL *ssl;
+SSL_SESSION *SSL_get_session(SSL *ssl)
{
return(ssl->session);
}
-int SSL_SESSION_get_ex_new_index(argl,argp,new_func,dup_func,free_func)
-long argl;
-char *argp;
-int (*new_func)();
-int (*dup_func)();
-void (*free_func)();
+int SSL_SESSION_get_ex_new_index(long argl, char *argp, int (*new_func)(),
+ int (*dup_func)(), void (*free_func)())
{
ssl_session_num++;
return(CRYPTO_get_ex_new_index(ssl_session_num-1,
@@ -91,22 +86,17 @@ void (*free_func)();
argl,argp,new_func,dup_func,free_func));
}
-int SSL_SESSION_set_ex_data(s,idx,arg)
-SSL_SESSION *s;
-int idx;
-void *arg;
+int SSL_SESSION_set_ex_data(SSL_SESSION *s, int idx, void *arg)
{
return(CRYPTO_set_ex_data(&s->ex_data,idx,arg));
}
-void *SSL_SESSION_get_ex_data(s,idx)
-SSL_SESSION *s;
-int idx;
+void *SSL_SESSION_get_ex_data(SSL_SESSION *s, int idx)
{
return(CRYPTO_get_ex_data(&s->ex_data,idx));
}
-SSL_SESSION *SSL_SESSION_new()
+SSL_SESSION *SSL_SESSION_new(void)
{
SSL_SESSION *ss;
@@ -128,9 +118,7 @@ SSL_SESSION *SSL_SESSION_new()
return(ss);
}
-int ssl_get_new_session(s, session)
-SSL *s;
-int session;
+int ssl_get_new_session(SSL *s, int session)
{
SSL_SESSION *ss=NULL;
@@ -198,10 +186,7 @@ int session;
return(1);
}
-int ssl_get_prev_session(s,session_id,len)
-SSL *s;
-unsigned char *session_id;
-int len;
+int ssl_get_prev_session(SSL *s, unsigned char *session_id, int len)
{
SSL_SESSION *ret=NULL,data;
int copy=1;
@@ -292,9 +277,7 @@ int len;
return(1);
}
-int SSL_CTX_add_session(ctx,c)
-SSL_CTX *ctx;
-SSL_SESSION *c;
+int SSL_CTX_add_session(SSL_CTX *ctx, SSL_SESSION *c)
{
int ret=0;
SSL_SESSION *s;
@@ -339,9 +322,7 @@ SSL_SESSION *c;
return(ret);
}
-int SSL_CTX_remove_session(ctx,c)
-SSL_CTX *ctx;
-SSL_SESSION *c;
+int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c)
{
SSL_SESSION *r;
int ret=0;
@@ -371,8 +352,7 @@ SSL_SESSION *c;
return(ret);
}
-void SSL_SESSION_free(ss)
-SSL_SESSION *ss;
+void SSL_SESSION_free(SSL_SESSION *ss)
{
int i;
@@ -404,9 +384,7 @@ SSL_SESSION *ss;
Free(ss);
}
-int SSL_set_session(s, session)
-SSL *s;
-SSL_SESSION *session;
+int SSL_set_session(SSL *s, SSL_SESSION *session)
{
int ret=0;
SSL_METHOD *meth;
@@ -459,41 +437,33 @@ SSL_SESSION *session;
return(ret);
}
-long SSL_SESSION_set_timeout(s,t)
-SSL_SESSION *s;
-long t;
+long SSL_SESSION_set_timeout(SSL_SESSION *s, long t)
{
if (s == NULL) return(0);
s->timeout=t;
return(1);
}
-long SSL_SESSION_get_timeout(s)
-SSL_SESSION *s;
+long SSL_SESSION_get_timeout(SSL_SESSION *s)
{
if (s == NULL) return(0);
return(s->timeout);
}
-long SSL_SESSION_get_time(s)
-SSL_SESSION *s;
+long SSL_SESSION_get_time(SSL_SESSION *s)
{
if (s == NULL) return(0);
return(s->time);
}
-long SSL_SESSION_set_time(s,t)
-SSL_SESSION *s;
-long t;
+long SSL_SESSION_set_time(SSL_SESSION *s, long t)
{
if (s == NULL) return(0);
s->time=t;
return(t);
}
-long SSL_CTX_set_timeout(s,t)
-SSL_CTX *s;
-long t;
+long SSL_CTX_set_timeout(SSL_CTX *s, long t)
{
long l;
if (s == NULL) return(0);
@@ -502,8 +472,7 @@ long t;
return(l);
}
-long SSL_CTX_get_timeout(s)
-SSL_CTX *s;
+long SSL_CTX_get_timeout(SSL_CTX *s)
{
if (s == NULL) return(0);
return(s->session_timeout);
@@ -516,9 +485,7 @@ typedef struct timeout_param_st
LHASH *cache;
} TIMEOUT_PARAM;
-static void timeout(s,p)
-SSL_SESSION *s;
-TIMEOUT_PARAM *p;
+static void timeout(SSL_SESSION *s, TIMEOUT_PARAM *p)
{
if ((p->time == 0) || (p->time > (s->time+s->timeout))) /* timeout */
{
@@ -533,9 +500,7 @@ TIMEOUT_PARAM *p;
}
}
-void SSL_CTX_flush_sessions(s,t)
-SSL_CTX *s;
-long t;
+void SSL_CTX_flush_sessions(SSL_CTX *s, long t)
{
unsigned long i;
TIMEOUT_PARAM tp;
@@ -552,8 +517,7 @@ long t;
CRYPTO_w_unlock(CRYPTO_LOCK_SSL_CTX);
}
-int ssl_clear_bad_session(s)
-SSL *s;
+int ssl_clear_bad_session(SSL *s)
{
if ( (s->session != NULL) &&
!(s->shutdown & SSL_SENT_SHUTDOWN) &&
@@ -567,9 +531,7 @@ SSL *s;
}
/* locked by SSL_CTX in the calling function */
-static void SSL_SESSION_list_remove(ctx,s)
-SSL_CTX *ctx;
-SSL_SESSION *s;
+static void SSL_SESSION_list_remove(SSL_CTX *ctx, SSL_SESSION *s)
{
if ((s->next == NULL) || (s->prev == NULL)) return;
@@ -602,9 +564,7 @@ SSL_SESSION *s;
s->prev=s->next=NULL;
}
-static void SSL_SESSION_list_add(ctx,s)
-SSL_CTX *ctx;
-SSL_SESSION *s;
+static void SSL_SESSION_list_add(SSL_CTX *ctx, SSL_SESSION *s)
{
if ((s->next != NULL) && (s->prev != NULL))
SSL_SESSION_list_remove(ctx,s);
diff --git a/ssl/ssl_stat.c b/ssl/ssl_stat.c
index 1401ae724a..14f58dbdfd 100644
--- a/ssl/ssl_stat.c
+++ b/ssl/ssl_stat.c
@@ -59,8 +59,7 @@
#include <stdio.h>
#include "ssl_locl.h"
-char *SSL_state_string_long(s)
-SSL *s;
+char *SSL_state_string_long(SSL *s)
{
char *str;
@@ -198,8 +197,7 @@ default: str="unknown state"; break;
return(str);
}
-char *SSL_rstate_string_long(s)
-SSL *s;
+char *SSL_rstate_string_long(SSL *s)
{
char *str;
@@ -213,8 +211,7 @@ SSL *s;
return(str);
}
-char *SSL_state_string(s)
-SSL *s;
+char *SSL_state_string(SSL *s)
{
char *str;
@@ -346,8 +343,7 @@ default: str="UNKWN "; break;
return(str);
}
-char *SSL_alert_type_string_long(value)
-int value;
+char *SSL_alert_type_string_long(int value)
{
value>>=8;
if (value == SSL3_AL_WARNING)
@@ -358,8 +354,7 @@ int value;
return("unknown");
}
-char *SSL_alert_type_string(value)
-int value;
+char *SSL_alert_type_string(int value)
{
value>>=8;
if (value == SSL3_AL_WARNING)
@@ -370,8 +365,7 @@ int value;
return("U");
}
-char *SSL_alert_desc_string(value)
-int value;
+char *SSL_alert_desc_string(int value)
{
char *str;
@@ -394,8 +388,7 @@ int value;
return(str);
}
-char *SSL_alert_desc_string_long(value)
-int value;
+char *SSL_alert_desc_string_long(int value)
{
char *str;
@@ -442,8 +435,7 @@ int value;
return(str);
}
-char *SSL_rstate_string(s)
-SSL *s;
+char *SSL_rstate_string(SSL *s)
{
char *str;
diff --git a/ssl/ssl_txt.c b/ssl/ssl_txt.c
index 22fbb5f55b..c1b2a8652a 100644
--- a/ssl/ssl_txt.c
+++ b/ssl/ssl_txt.c
@@ -61,9 +61,7 @@
#include "ssl_locl.h"
#ifndef NO_FP_API
-int SSL_SESSION_print_fp(fp, x)
-FILE *fp;
-SSL_SESSION *x;
+int SSL_SESSION_print_fp(FILE *fp, SSL_SESSION *x)
{
BIO *b;
int ret;
@@ -80,9 +78,7 @@ SSL_SESSION *x;
}
#endif
-int SSL_SESSION_print(bp,x)
-BIO *bp;
-SSL_SESSION *x;
+int SSL_SESSION_print(BIO *bp, SSL_SESSION *x)
{
unsigned int i;
char str[128],*s;
diff --git a/ssl/ssltest.c b/ssl/ssltest.c
index 720abfa01e..ef80d42990 100644
--- a/ssl/ssltest.c
+++ b/ssl/ssltest.c
@@ -104,7 +104,7 @@ int doit(SSL *s_ssl,SSL *c_ssl,long bytes);
int doit();
#endif
-static void sv_usage()
+static void sv_usage(void)
{
fprintf(stderr,"usage: ssltest [args ...]\n");
fprintf(stderr,"\n");
@@ -132,9 +132,7 @@ static void sv_usage()
fprintf(stderr," -cipher arg - The cipher list\n");
}
-int main(argc, argv)
-int argc;
-char *argv[];
+int main(int argc, char *argv[])
{
char *CApath=NULL,*CAfile=NULL;
int badop=0;
@@ -373,9 +371,7 @@ end:
#define C_DONE 1
#define S_DONE 2
-int doit(s_ssl,c_ssl,count)
-SSL *s_ssl,*c_ssl;
-long count;
+int doit(SSL *s_ssl, SSL *c_ssl, long count)
{
MS_STATIC char cbuf[1024*8],sbuf[1024*8];
long cw_num=count,cr_num=count;
@@ -674,9 +670,7 @@ err:
return(ret);
}
-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 *s,buf[256];
@@ -717,7 +711,7 @@ static unsigned char dh512_g[]={
0x02,
};
-static DH *get_dh512()
+static DH *get_dh512(void)
{
DH *dh=NULL;
@@ -730,10 +724,7 @@ static DH *get_dh512()
}
#endif
-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/ssl/t1_clnt.c b/ssl/t1_clnt.c
index 1a179221e7..3cc03e3887 100644
--- a/ssl/t1_clnt.c
+++ b/ssl/t1_clnt.c
@@ -69,8 +69,7 @@ static SSL_METHOD *tls1_get_client_method(int ver);
static SSL_METHOD *tls1_get_client_method();
#endif
-static SSL_METHOD *tls1_get_client_method(ver)
-int ver;
+static SSL_METHOD *tls1_get_client_method(int ver)
{
if (ver == TLS1_VERSION)
return(TLSv1_client_method());
@@ -78,7 +77,7 @@ int ver;
return(NULL);
}
-SSL_METHOD *TLSv1_client_method()
+SSL_METHOD *TLSv1_client_method(void)
{
static int init=1;
static SSL_METHOD TLSv1_client_data;
diff --git a/ssl/t1_enc.c b/ssl/t1_enc.c
index 4e783c23a4..235205b676 100644
--- a/ssl/t1_enc.c
+++ b/ssl/t1_enc.c
@@ -62,14 +62,8 @@
#include "hmac.h"
#include "ssl_locl.h"
-static void tls1_P_hash(md,sec,sec_len,seed,seed_len,out,olen)
-EVP_MD *md;
-unsigned char *sec;
-int sec_len;
-unsigned char *seed;
-int seed_len;
-unsigned char *out;
-int olen;
+static void tls1_P_hash(EVP_MD *md, unsigned char *sec, int sec_len,
+ unsigned char *seed, int seed_len, unsigned char *out, int olen)
{
int chunk,n;
unsigned int j;
@@ -111,16 +105,9 @@ int olen;
memset(A1,0,sizeof(A1));
}
-static void tls1_PRF(md5,sha1,label,label_len,sec,slen,out1,out2,olen)
-EVP_MD *md5;
-EVP_MD *sha1;
-unsigned char *label;
-int label_len;
-unsigned char *sec;
-int slen;
-unsigned char *out1;
-unsigned char *out2;
-int olen;
+static void tls1_PRF(EVP_MD *md5, EVP_MD *sha1, unsigned char *label,
+ int label_len, unsigned char *sec, int slen, unsigned char *out1,
+ unsigned char *out2, int olen)
{
int len,i;
unsigned char *S1,*S2;
@@ -138,10 +125,8 @@ int olen;
out1[i]^=out2[i];
}
-static void tls1_generate_key_block(s,km,tmp,num)
-SSL *s;
-unsigned char *km,*tmp;
-int num;
+static void tls1_generate_key_block(SSL *s, unsigned char *km,
+ unsigned char *tmp, int num)
{
unsigned char *p;
unsigned char buf[SSL3_RANDOM_SIZE*2+
@@ -161,9 +146,7 @@ int num;
km,tmp,num);
}
-int tls1_change_cipher_state(s,which)
-SSL *s;
-int which;
+int tls1_change_cipher_state(SSL *s, int which)
{
unsigned char *p,*key_block,*mac_secret;
unsigned char *exp_label,buf[TLS_MD_MAX_CONST_SIZE+
@@ -342,8 +325,7 @@ err2:
return(0);
}
-int tls1_setup_key_block(s)
-SSL *s;
+int tls1_setup_key_block(SSL *s)
{
unsigned char *p1,*p2;
const EVP_CIPHER *c;
@@ -399,9 +381,7 @@ err:
return(0);
}
-int tls1_enc(s,send)
-SSL *s;
-int send;
+int tls1_enc(SSL *s, int send)
{
SSL3_RECORD *rec;
EVP_CIPHER_CTX *ds;
@@ -498,10 +478,7 @@ int send;
return(1);
}
-int tls1_cert_verify_mac(s,in_ctx,out)
-SSL *s;
-EVP_MD_CTX *in_ctx;
-unsigned char *out;
+int tls1_cert_verify_mac(SSL *s, EVP_MD_CTX *in_ctx, unsigned char *out)
{
unsigned int ret;
EVP_MD_CTX ctx;
@@ -511,12 +488,8 @@ unsigned char *out;
return((int)ret);
}
-int tls1_final_finish_mac(s,in1_ctx,in2_ctx,str,slen,out)
-SSL *s;
-EVP_MD_CTX *in1_ctx,*in2_ctx;
-unsigned char *str;
-int slen;
-unsigned char *out;
+int tls1_final_finish_mac(SSL *s, EVP_MD_CTX *in1_ctx, EVP_MD_CTX *in2_ctx,
+ unsigned char *str, int slen, unsigned char *out)
{
unsigned int i;
EVP_MD_CTX ctx;
@@ -542,10 +515,7 @@ unsigned char *out;
return((int)12);
}
-int tls1_mac(ssl,md,send)
-SSL *ssl;
-unsigned char *md;
-int send;
+int tls1_mac(SSL *ssl, unsigned char *md, int send)
{
SSL3_RECORD *rec;
unsigned char *mac_sec,*seq;
@@ -605,11 +575,8 @@ printf("rec=");
return(md_size);
}
-int tls1_generate_master_secret(s,out,p,len)
-SSL *s;
-unsigned char *out;
-unsigned char *p;
-int len;
+int tls1_generate_master_secret(SSL *s, unsigned char *out, unsigned char *p,
+ int len)
{
unsigned char buf[SSL3_RANDOM_SIZE*2+TLS_MD_MASTER_SECRET_CONST_SIZE];
unsigned char buff[SSL_MAX_MASTER_KEY_LENGTH];
@@ -627,8 +594,7 @@ int len;
return(SSL3_MASTER_SECRET_SIZE);
}
-int tls1_alert_code(code)
-int code;
+int tls1_alert_code(int code)
{
switch (code)
{
diff --git a/ssl/t1_lib.c b/ssl/t1_lib.c
index 4534403d22..746ef7edff 100644
--- a/ssl/t1_lib.c
+++ b/ssl/t1_lib.c
@@ -107,45 +107,38 @@ static SSL_METHOD TLSv1_data= {
&TLSv1_enc_data,
};
-static long tls1_default_timeout()
+static long tls1_default_timeout(void)
{
/* 2 hours, the 24 hours mentioned in the TLSv1 spec
* is way too long for http, the cache would over fill */
return(60*60*2);
}
-SSL_METHOD *tlsv1_base_method()
+SSL_METHOD *tlsv1_base_method(void)
{
return(&TLSv1_data);
}
-int tls1_new(s)
-SSL *s;
+int tls1_new(SSL *s)
{
if (!ssl3_new(s)) return(0);
s->method->ssl_clear(s);
return(1);
}
-void tls1_free(s)
-SSL *s;
+void tls1_free(SSL *s)
{
ssl3_free(s);
}
-void tls1_clear(s)
-SSL *s;
+void tls1_clear(SSL *s)
{
ssl3_clear(s);
s->version=TLS1_VERSION;
}
#if 0
-long tls1_ctrl(s,cmd,larg,parg)
-SSL *s;
-int cmd;
-long larg;
-char *parg;
+long tls1_ctrl(SSL *s, int cmd, long larg, char *parg)
{
return(0);
}
diff --git a/ssl/t1_meth.c b/ssl/t1_meth.c
index d64b5f4e67..fb065d2c94 100644
--- a/ssl/t1_meth.c
+++ b/ssl/t1_meth.c
@@ -66,8 +66,7 @@ static SSL_METHOD *tls1_get_method(int ver);
static SSL_METHOD *tls1_get_method();
#endif
-static SSL_METHOD *tls1_get_method(ver)
-int ver;
+static SSL_METHOD *tls1_get_method(int ver)
{
if (ver == TLS1_VERSION)
return(TLSv1_method());
@@ -75,7 +74,7 @@ int ver;
return(NULL);
}
-SSL_METHOD *TLSv1_method()
+SSL_METHOD *TLSv1_method(void)
{
static int init=1;
static SSL_METHOD TLSv1_data;
diff --git a/ssl/t1_srvr.c b/ssl/t1_srvr.c
index 8b18572fb0..5603879284 100644
--- a/ssl/t1_srvr.c
+++ b/ssl/t1_srvr.c
@@ -70,8 +70,7 @@ static SSL_METHOD *tls1_get_server_method(int ver);
static SSL_METHOD *tls1_get_server_method();
#endif
-static SSL_METHOD *tls1_get_server_method(ver)
-int ver;
+static SSL_METHOD *tls1_get_server_method(int ver)
{
if (ver == TLS1_VERSION)
return(TLSv1_server_method());
@@ -79,7 +78,7 @@ int ver;
return(NULL);
}
-SSL_METHOD *TLSv1_server_method()
+SSL_METHOD *TLSv1_server_method(void)
{
static int init=1;
static SSL_METHOD TLSv1_server_data;