From 00a631a28dab62c3d53cbbc5463099bfbf586e2f Mon Sep 17 00:00:00 2001 From: William Robinet Date: Mon, 14 Aug 2023 10:57:16 +0200 Subject: [PATCH] Convert old-style function definitions --- base/network.c | 43 ++- base/proto_mod.c | 12 +- base/tcpconn.c | 23 +- base/tcppack.c | 30 +- common/lib/debug.c | 6 +- common/lib/r_assoc.c | 58 ++-- common/lib/r_assoc_test.c | 7 +- common/lib/r_bitfield.c | 19 +- common/lib/r_data.c | 35 +-- common/lib/r_list.c | 23 +- common/lib/r_replace.c | 4 +- common/lib/r_time.c | 19 +- common/lib/threads/pthreads/pthread.c | 26 +- null/null_analyze.c | 16 +- pcap/pcap_logger.c | 25 +- ssl/Attic/lex.yy.c | 18 +- ssl/Attic/main.c | 12 +- ssl/Attic/ssl_enum.c | 98 ++----- ssl/ciphersuites.c | 5 +- ssl/ssl.enums.c | 399 ++++++++------------------ ssl/ssl_analyze.c | 75 ++--- ssl/ssl_rec.c | 65 ++--- ssl/ssldecode.c | 157 ++++------ ssl/sslprint.c | 121 +++----- ssl/sslxprint.c | 22 +- 25 files changed, 440 insertions(+), 878 deletions(-) diff --git a/base/network.c b/base/network.c index 3b96f6e..074de52 100644 --- a/base/network.c +++ b/base/network.c @@ -68,9 +68,8 @@ struct network_handler_ { proto_ctx *ctx; }; -int network_handler_create(mod,handlerp) - proto_mod *mod; - n_handler **handlerp; +int +network_handler_create (proto_mod *mod, n_handler **handlerp) { int r,_status; n_handler *handler=0; @@ -91,9 +90,8 @@ int network_handler_create(mod,handlerp) return(_status); } -int network_handler_destroy(mod,handlerp) - proto_mod *mod; - n_handler **handlerp; +int +network_handler_destroy (proto_mod *mod, n_handler **handlerp) { n_handler *handler=0; if(!handlerp || !*handlerp) @@ -107,12 +105,8 @@ int network_handler_destroy(mod,handlerp) return(0); } -int network_process_packet(handler,timestamp,data,length,af) - n_handler *handler; - struct timeval *timestamp; - UCHAR *data; - int length; - int af; +int +network_process_packet (n_handler *handler, struct timeval *timestamp, UCHAR *data, int length, int af) { int r; int hlen; @@ -208,9 +202,8 @@ int network_process_packet(handler,timestamp,data,length,af) return(0); } -int packet_copy(in,out) - packet *in; - packet **out; +int +packet_copy (packet *in, packet **out) { int _status; @@ -240,8 +233,8 @@ int packet_copy(in,out) return(_status); } -int packet_destroy(p) - packet *p; +int +packet_destroy (packet *p) { if(!p) return(0); @@ -251,10 +244,8 @@ int packet_destroy(p) return(0); } -int timestamp_diff(t1,t0,diff) - struct timeval *t1; - struct timeval *t0; - struct timeval *diff; +int +timestamp_diff (struct timeval *t1, struct timeval *t0, struct timeval *diff) { long d; @@ -280,9 +271,8 @@ int timestamp_diff(t1,t0,diff) -int lookuphostname(so_st,namep) - struct sockaddr_storage *so_st; - char **namep; +int +lookuphostname (struct sockaddr_storage *so_st, char **namep) { int r = 1; *namep = calloc(1, NI_MAXHOST); @@ -304,9 +294,8 @@ int lookuphostname(so_st,namep) return(0); } -int addrtotext(so_st,namep) - struct sockaddr_storage *so_st; - char **namep; +int +addrtotext (struct sockaddr_storage *so_st, char **namep) { *namep = calloc(1, NI_MAXHOST); void *addr = NULL; diff --git a/base/proto_mod.c b/base/proto_mod.c index 0c31808..80cebd2 100644 --- a/base/proto_mod.c +++ b/base/proto_mod.c @@ -47,12 +47,8 @@ #include "network.h" -int create_proto_handler(mod,ctx,handlerp,conn,first_packet) - proto_mod *mod; - proto_ctx *ctx; - proto_handler **handlerp; - tcp_conn *conn; - struct timeval *first_packet; +int +create_proto_handler (proto_mod *mod, proto_ctx *ctx, proto_handler **handlerp, tcp_conn *conn, struct timeval *first_packet) { int r,_status; proto_handler *handler=0; @@ -74,8 +70,8 @@ int create_proto_handler(mod,ctx,handlerp,conn,first_packet) return(_status); } -int destroy_proto_handler(handlerp) - proto_handler **handlerp; +int +destroy_proto_handler (proto_handler **handlerp) { if(!handlerp || !*handlerp) return(0); diff --git a/base/tcpconn.c b/base/tcpconn.c index 2d00777..f9bcb5f 100644 --- a/base/tcpconn.c +++ b/base/tcpconn.c @@ -63,8 +63,8 @@ extern int conn_ttl; static int zero_conn PROTO_LIST((tcp_conn *conn)); -static int zero_conn(conn) - tcp_conn *conn; +static int +zero_conn (tcp_conn *conn) { memset(conn,0,sizeof(tcp_conn)); return(0); @@ -131,8 +131,8 @@ int tcp_create_conn(tcp_conn **connp,struct sockaddr_storage *i_addr, return(0); } -int tcp_destroy_conn(conn) - tcp_conn *conn; +int +tcp_destroy_conn (tcp_conn *conn) { conn_struct *c=conn->backptr; @@ -161,7 +161,8 @@ int tcp_destroy_conn(conn) return(0); } -int clean_old_conn() { +int +clean_old_conn (void) { conn_struct *conn; tcp_conn *tcpconn; struct timeval dt; @@ -184,7 +185,8 @@ int clean_old_conn() { return i; } -int destroy_all_conn() { +int +destroy_all_conn (void) { int i = 0; while(first_conn) { i++; @@ -193,8 +195,8 @@ int destroy_all_conn() { return i; } -int free_tcp_segment_queue(seg) - segment *seg; +int +free_tcp_segment_queue (segment *seg) { segment *tmp; @@ -208,9 +210,8 @@ int free_tcp_segment_queue(seg) return(0); } -int copy_tcp_segment_queue(out,in) - segment **out; - segment *in; +int +copy_tcp_segment_queue (segment **out, segment *in) { int r,_status; segment *base=0; diff --git a/base/tcppack.c b/base/tcppack.c index 8763d89..04fceed 100644 --- a/base/tcppack.c +++ b/base/tcppack.c @@ -71,10 +71,8 @@ static int new_connection PROTO_LIST((proto_mod *handler,proto_ctx *ctx, static int print_tcp_packet PROTO_LIST((packet *p)); int STRIM PROTO_LIST((UINT4 _seq,segment *s)); -int process_tcp_packet(handler,ctx,p) - proto_mod *handler; - proto_ctx *ctx; - packet *p; +int +process_tcp_packet (proto_mod *handler, proto_ctx *ctx, packet *p) { int r,_status; int direction; @@ -165,11 +163,8 @@ int process_tcp_packet(handler,ctx,p) return(_status); } -static int new_connection(handler,ctx,p,connp) - proto_mod *handler; - proto_ctx *ctx; - packet *p; - tcp_conn **connp; +static int +new_connection (proto_mod *handler, proto_ctx *ctx, packet *p, tcp_conn **connp) { int r,_status; tcp_conn *conn=0; @@ -227,12 +222,8 @@ static int new_connection(handler,ctx,p,connp) } */ -static int process_data_segment(conn,handler,p,stream,direction) - tcp_conn *conn; - proto_mod *handler; - packet *p; - stream_data *stream; - int direction; +static int +process_data_segment (tcp_conn *conn, proto_mod *handler, packet *p, stream_data *stream, int direction) { int r,_status; tcp_seq seq,right_edge; @@ -393,8 +384,8 @@ static int process_data_segment(conn,handler,p,stream,direction) return(_status); } -static int print_tcp_packet(p) - packet *p; +static int +print_tcp_packet (packet *p) { char *src=0,*dst=0; @@ -441,9 +432,8 @@ static int print_tcp_packet(p) return(0); } -int STRIM(_seq,s) - UINT4 _seq; - segment *s; +int +STRIM (UINT4 _seq, segment *s) { int l; int off; diff --git a/common/lib/debug.c b/common/lib/debug.c index 17afdbf..ff3d17b 100644 --- a/common/lib/debug.c +++ b/common/lib/debug.c @@ -62,10 +62,8 @@ int debug(int class,char *format,...) return(0); } -int xdump(name,data,len) - char *name; - UCHAR *data; - int len; +int +xdump (char *name, UCHAR *data, int len) { int i; diff --git a/common/lib/r_assoc.c b/common/lib/r_assoc.c index 0e9e16e..43395ad 100644 --- a/common/lib/r_assoc.c +++ b/common/lib/r_assoc.c @@ -83,8 +83,8 @@ UINT4 hash_compute PROTO_LIST((char *key,int len,int size)); static int copy_assoc_chain PROTO_LIST((r_assoc_el **newp, r_assoc_el *old)); -int r_assoc_create(assocp) - r_assoc **assocp; +int +r_assoc_create (r_assoc **assocp) { r_assoc *assoc=0; int _status; @@ -108,8 +108,8 @@ int r_assoc_create(assocp) return(_status); } -int r_assoc_destroy(assocp) - r_assoc **assocp; +int +r_assoc_destroy (r_assoc **assocp) { r_assoc *assoc; int i; @@ -127,8 +127,8 @@ int r_assoc_destroy(assocp) return(0); } -static int destroy_assoc_chain(chain) - r_assoc_el *chain; +static int +destroy_assoc_chain (r_assoc_el *chain) { r_assoc_el *nxt; @@ -147,9 +147,8 @@ static int destroy_assoc_chain(chain) return(0); } -static int copy_assoc_chain(newp,old) - r_assoc_el **newp; - r_assoc_el *old; +static int +copy_assoc_chain (r_assoc_el **newp, r_assoc_el *old) { r_assoc_el *new=0,*ptr,*tmp; int r,_status; @@ -197,11 +196,8 @@ static int copy_assoc_chain(newp,old) return(_status); } -static int r_assoc_fetch_bucket(assoc,key,len,bucketp) - r_assoc *assoc; - char *key; - int len; - r_assoc_el **bucketp; +static int +r_assoc_fetch_bucket (r_assoc *assoc, char *key, int len, r_assoc_el **bucketp) { UINT4 hash_value; r_assoc_el *bucket; @@ -218,11 +214,8 @@ static int r_assoc_fetch_bucket(assoc,key,len,bucketp) return(R_NOT_FOUND); } -int r_assoc_fetch(assoc,key,len,datap) - r_assoc *assoc; - char *key; - int len; - void **datap; +int +r_assoc_fetch (r_assoc *assoc, char *key, int len, void **datap) { r_assoc_el *bucket; int r; @@ -292,9 +285,8 @@ int r_assoc_insert(assoc,key,len,data,copy,destroy,how) return(_status); } -int r_assoc_copy(newp,old) - r_assoc **newp; - r_assoc *old; +int +r_assoc_copy (r_assoc **newp, r_assoc *old) { int r,_status,i; r_assoc *new; @@ -320,9 +312,8 @@ int r_assoc_copy(newp,old) return(_status); } -int r_assoc_init_iter(assoc,iter) - r_assoc *assoc; - r_assoc_iterator *iter; +int +r_assoc_init_iter (r_assoc *assoc, r_assoc_iterator *iter) { int i; @@ -344,11 +335,8 @@ int r_assoc_init_iter(assoc,iter) return(0); } -int r_assoc_iter(iter,key,keyl,val) - r_assoc_iterator *iter; - void **key; - int *keyl; - void **val; +int +r_assoc_iter (r_assoc_iterator *iter, void **key, int *keyl, void **val) { int i; r_assoc_el *ret; @@ -386,8 +374,8 @@ int r_assoc_iter(iter,key,keyl,val) } /* Delete the last returned value*/ -int r_assoc_iter_delete(iter) - r_assoc_iterator *iter; +int +r_assoc_iter_delete (r_assoc_iterator *iter) { /* First unhook it from the list*/ if(!iter->prev->prev){ @@ -411,10 +399,8 @@ int r_assoc_iter_delete(iter) /*This is a hack from AMS. Supposedly, it's pretty good for strings, even though it doesn't take into account all the data*/ -UINT4 hash_compute(key,len,bits) - char *key; - int len; - int bits; +UINT4 +hash_compute (char *key, int len, int bits) { UINT4 h=0; diff --git a/common/lib/r_assoc_test.c b/common/lib/r_assoc_test.c index 03ef065..eb25fd3 100644 --- a/common/lib/r_assoc_test.c +++ b/common/lib/r_assoc_test.c @@ -48,7 +48,8 @@ #include #include -int main() +int +main (void) { char test_vector[1024],*v; int rnd,ct,r; @@ -94,8 +95,8 @@ int main() exit(0); } -int fetch_test(assoc) - r_assoc *assoc; +int +fetch_test (r_assoc *assoc) { int ct; char vec[4],*v; diff --git a/common/lib/r_bitfield.c b/common/lib/r_bitfield.c index abd4ca5..4b91880 100644 --- a/common/lib/r_bitfield.c +++ b/common/lib/r_bitfield.c @@ -12,9 +12,8 @@ #include #include "r_bitfield.h" -int r_bitfield_create(setp,size) - r_bitfield **setp; - UINT4 size; +int +r_bitfield_create (r_bitfield **setp, UINT4 size) { r_bitfield *set=0; int _status; @@ -40,8 +39,8 @@ int r_bitfield_create(setp,size) return(_status); } -int r_bitfield_destroy(setp) - r_bitfield **setp; +int +r_bitfield_destroy (r_bitfield **setp) { r_bitfield *set; @@ -57,9 +56,8 @@ int r_bitfield_destroy(setp) return(0); } -int r_bitfield_set(set,bit) - r_bitfield *set; - int bit; +int +r_bitfield_set (r_bitfield *set, int bit) { int word=(bit-set->base)/32; int bbit=(bit-set->base)%32; @@ -90,9 +88,8 @@ int r_bitfield_set(set,bit) return(_status); } -int r_bitfield_isset(set,bit) - r_bitfield *set; - int bit; +int +r_bitfield_isset (r_bitfield *set, int bit) { int word=(bit-set->base)/32; int bbit=(bit-set->base)%32; diff --git a/common/lib/r_data.c b/common/lib/r_data.c index c3ca644..9b4606c 100644 --- a/common/lib/r_data.c +++ b/common/lib/r_data.c @@ -48,10 +48,8 @@ #include #include -int r_data_create(dp,d,l) - Data **dp; - UCHAR *d; - int l; +int +r_data_create (Data **dp, UCHAR *d, int l) { Data *d_=0; int _status; @@ -74,9 +72,8 @@ int r_data_create(dp,d,l) return(_status); } -int r_data_alloc(dp,l) - Data **dp; - int l; +int +r_data_alloc (Data **dp, int l) { Data *d_=0; int _status; @@ -97,10 +94,8 @@ int r_data_alloc(dp,l) return(_status); } -int r_data_make(dp,d,l) - Data *dp; - UCHAR *d; - int l; +int +r_data_make (Data *dp, UCHAR *d, int l) { if(!(dp->data=(UCHAR *)malloc(l))) ERETURN(R_NO_MEMORY); @@ -111,8 +106,8 @@ int r_data_make(dp,d,l) return(0); } -int r_data_destroy(dp) - Data **dp; +int +r_data_destroy (Data **dp) { if(!dp || !*dp) return(0); @@ -126,9 +121,8 @@ int r_data_destroy(dp) return(0); } -int r_data_copy(dst,src) - Data *dst; - Data *src; +int +r_data_copy (Data *dst, Data *src) { if(!(dst->data=(UCHAR *)malloc(src->len))) ERETURN(R_NO_MEMORY); @@ -136,8 +130,8 @@ int r_data_copy(dst,src) return(0); } -int r_data_zfree(d) - Data *d; +int +r_data_zfree (Data *d) { if(!d) return(0); @@ -148,9 +142,8 @@ int r_data_zfree(d) return(0); } -int r_data_compare(d1,d2) - Data *d1; - Data *d2; +int +r_data_compare (Data *d1, Data *d2) { if(d1->lenlen) return(-1); diff --git a/common/lib/r_list.c b/common/lib/r_list.c index d2a6711..5fb9ae7 100644 --- a/common/lib/r_list.c +++ b/common/lib/r_list.c @@ -61,8 +61,8 @@ struct r_list_ { struct r_list_el_ *last; }; -int r_list_create(listp) - r_list **listp; +int +r_list_create (r_list **listp) { r_list *list=0; int _status; @@ -79,8 +79,8 @@ int r_list_create(listp) return(_status); } -int r_list_destroy(listp) - r_list **listp; +int +r_list_destroy (r_list **listp) { r_list *list; r_list_el *el; @@ -107,9 +107,8 @@ int r_list_destroy(listp) return(0); } -int r_list_copy(outp,in) - r_list**outp; - r_list *in; +int +r_list_copy (r_list **outp, r_list *in) { r_list *out=0; r_list_el *el,*el2,*last=0; @@ -204,9 +203,8 @@ int r_list_append(list,value,copy,destroy) return(_status); } -int r_list_init_iter(list,iter) - r_list *list; - r_list_iterator *iter; +int +r_list_init_iter (r_list *list, r_list_iterator *iter) { iter->list=list; iter->ptr=list->first; @@ -214,9 +212,8 @@ int r_list_init_iter(list,iter) return(0); } -int r_list_iter(iter,val) - r_list_iterator *iter; - void **val; +int +r_list_iter (r_list_iterator *iter, void **val) { if(!iter->ptr) return(R_EOD); diff --git a/common/lib/r_replace.c b/common/lib/r_replace.c index fcc5c7f..39571e6 100644 --- a/common/lib/r_replace.c +++ b/common/lib/r_replace.c @@ -49,8 +49,8 @@ #ifndef HAVE_STRDUP -char *strdup(str) - char *str; +char * +strdup (char *str) { int len=strlen(str); char *n; diff --git a/common/lib/r_time.c b/common/lib/r_time.c index 322dd1d..e0a0b98 100644 --- a/common/lib/r_time.c +++ b/common/lib/r_time.c @@ -84,10 +84,8 @@ int gettimeofday(struct timeval *tv, struct timezone *tzp) } #endif /*Note that t1 must be > t0 */ -int r_timeval_diff(t1,t0,diff) - struct timeval *t1; - struct timeval *t0; - struct timeval *diff; +int +r_timeval_diff (struct timeval *t1, struct timeval *t0, struct timeval *diff) { long d; @@ -111,10 +109,8 @@ int r_timeval_diff(t1,t0,diff) return(0); } -int r_timeval_add(t1,t2,sum) - struct timeval *t1; - struct timeval *t2; - struct timeval *sum; +int +r_timeval_add (struct timeval *t1, struct timeval *t2, struct timeval *sum) { long tv_sec,tv_usec,d; @@ -135,8 +131,8 @@ int r_timeval_add(t1,t2,sum) return(0); } -UINT8 r_timeval2int(tv) - struct timeval *tv; +UINT8 +r_timeval2int (struct timeval *tv) { UINT8 r=0; @@ -147,7 +143,8 @@ UINT8 r_timeval2int(tv) return r; } -UINT8 r_gettimeint() +UINT8 +r_gettimeint (void) { struct timeval tv; diff --git a/common/lib/threads/pthreads/pthread.c b/common/lib/threads/pthreads/pthread.c index eaeb783..cffd97f 100644 --- a/common/lib/threads/pthreads/pthread.c +++ b/common/lib/threads/pthreads/pthread.c @@ -23,8 +23,8 @@ typedef struct { static void *r_thread_real_create PROTO_LIST((void *arg)); -static void *r_thread_real_create(arg) - void *arg; +static void * +r_thread_real_create (void *arg) { helper *h; @@ -61,19 +61,22 @@ int r_thread_fork(func,arg,id) return(_status); } -int r_thread_yield() +int +r_thread_yield (void) { pthread_yield(); } -int r_thread_exit() +int +r_thread_exit (void) { thread_count--; pthread_exit(0); return(0); } -int r_thread_wait_last() +int +r_thread_wait_last (void) { do { pthread_yield(); @@ -84,8 +87,8 @@ int r_thread_wait_last() return(0); } -int r_rwlock_create(lockp) - r_rwlock **lockp; +int +r_rwlock_create (r_rwlock **lockp) { pthread_rwlock_t *lock; int r; @@ -100,8 +103,8 @@ int r_rwlock_create(lockp) return(0); } -int r_rwlock_destroy(lock) - r_rwlock **lock; +int +r_rwlock_destroy (r_rwlock **lock) { pthread_rwlock_t *plock; @@ -115,9 +118,8 @@ int r_rwlock_destroy(lock) return(0); } -int r_rwlock_lock(lock,action) - r_rwlock *lock; - int action; +int +r_rwlock_lock (r_rwlock *lock, int action) { pthread_rwlock_t *plock; int r,_status; diff --git a/null/null_analyze.c b/null/null_analyze.c index 39f5514..cb98eef 100644 --- a/null/null_analyze.c +++ b/null/null_analyze.c @@ -77,8 +77,8 @@ static int create_null_analyzer(void *handle, proto_ctx *ctx, tcp_conn *conn, return(0); } -int destroy_null_analyzer(objp) - proto_obj **objp; +int +destroy_null_analyzer (proto_obj **objp) { null_analyzer *obj; @@ -94,10 +94,8 @@ int destroy_null_analyzer(objp) return(0); } -int data_null_analyzer(_obj,seg,direction) - proto_obj *_obj; - segment *seg; - int direction; +int +data_null_analyzer (proto_obj *_obj, segment *seg, int direction) { #ifdef DEBUG null_analyzer *obj=(null_analyzer *)_obj; @@ -124,10 +122,8 @@ int data_null_analyzer(_obj,seg,direction) return(0); } -int fin_null_analyzer(_obj,p,direction) - proto_obj *_obj; - packet *p; - int direction; +int +fin_null_analyzer (proto_obj *_obj, packet *p, int direction) { #ifdef DEBUG null_analyzer *obj=(null_analyzer *)_obj; diff --git a/pcap/pcap_logger.c b/pcap/pcap_logger.c index a2ada57..b9db7bb 100644 --- a/pcap/pcap_logger.c +++ b/pcap/pcap_logger.c @@ -29,8 +29,8 @@ int pcap_fd = -1; static uint8_t content_pcap_src_ether[ETHER_ADDR_LEN] = {0x02, 0x00, 0x00, 0x11, 0x11, 0x11}; static uint8_t content_pcap_dst_ether[ETHER_ADDR_LEN] = {0x02, 0x00, 0x00, 0x22, 0x22, 0x22}; -static int init_pcap_logger(data) - void *data; +static int +init_pcap_logger (void *data) { char *pcap_outfile = (char *) data; pcap_fd = open(pcap_outfile, O_RDWR|O_CREAT, DFLT_FILEMODE); @@ -47,7 +47,8 @@ static int init_pcap_logger(data) return 0; } -static int deinit_pcap_logger() +static int +deinit_pcap_logger (void) { fdatasync(pcap_fd); close(pcap_fd); @@ -85,8 +86,8 @@ static int create_pcap_logger(proto_obj **objp, struct sockaddr_storage *i_addr, return(_status); } -static int destroy_pcap_logger(objp) - proto_obj **objp; +static int +destroy_pcap_logger (proto_obj **objp) { logpkt_ctx_t *pcap_obj; @@ -101,11 +102,8 @@ static int destroy_pcap_logger(objp) return(0); } -static int data_pcap_logger(_obj,data,len,dir) - proto_obj *_obj; - unsigned char *data; - unsigned int len; - int dir; +static int +data_pcap_logger (proto_obj *_obj, unsigned char *data, unsigned int len, int dir) { logpkt_ctx_t *pcap_obj = (logpkt_ctx_t *)_obj; int direction; @@ -119,11 +117,8 @@ static int data_pcap_logger(_obj,data,len,dir) return status; } -int close_pcap_logger(_obj,data,len,dir) - proto_obj *_obj; - unsigned char *data; - unsigned int len; - int dir; +int +close_pcap_logger (proto_obj *_obj, unsigned char *data, unsigned int len, int dir) { logpkt_ctx_t *pcap_obj = (logpkt_ctx_t *)_obj; int direction; diff --git a/ssl/Attic/lex.yy.c b/ssl/Attic/lex.yy.c index 4ceaba7..e0d141d 100644 --- a/ssl/Attic/lex.yy.c +++ b/ssl/Attic/lex.yy.c @@ -1024,7 +1024,8 @@ ECHO; * EOB_ACT_END_OF_FILE - end of file */ -static int yy_get_next_buffer() +static int +yy_get_next_buffer (void) { register char *dest = yy_current_buffer->yy_ch_buf; register char *source = yytext_ptr; @@ -1156,7 +1157,8 @@ static int yy_get_next_buffer() /* yy_get_previous_state - get the state just before the EOB char was reached */ -static yy_state_type yy_get_previous_state() +static yy_state_type +yy_get_previous_state (void) { register yy_state_type yy_current_state; register char *yy_cp; @@ -1636,7 +1638,8 @@ int new_state; #ifndef YY_NO_POP_STATE -static void yy_pop_state() +static void +yy_pop_state (void) { if ( --yy_start_stack_ptr < 0 ) YY_FATAL_ERROR( "start-condition stack underflow" ); @@ -1647,7 +1650,8 @@ static void yy_pop_state() #ifndef YY_NO_TOP_STATE -static int yy_top_state() +static int +yy_top_state (void) { return yy_start_stack[yy_start_stack_ptr - 1]; } @@ -1760,7 +1764,8 @@ void *ptr; } #if YY_MAIN -int main() +int +main (void) { yylex(); return 0; @@ -1768,7 +1773,8 @@ int main() #endif #line 60 "ssl.l" -int mkname() +int +mkname (void) { #if 0 printf("%s\n",yytext); diff --git a/ssl/Attic/main.c b/ssl/Attic/main.c index 2fe9cc9..db9008c 100644 --- a/ssl/Attic/main.c +++ b/ssl/Attic/main.c @@ -62,9 +62,8 @@ int verr_exit(char *fmt,...) } -int main(argc,argv) - int argc; - char **argv; +int +main (int argc, char **argv) { char name[100]; FILE *in; @@ -86,12 +85,13 @@ int main(argc,argv) extern int yylineno; -int yywrap() +int +yywrap (void) { ;} -int yyerror(s) - char *s; +int +yyerror (char *s) { printf("Parse error %s at line %d\n",s,yylineno); exit(1); diff --git a/ssl/Attic/ssl_enum.c b/ssl/Attic/ssl_enum.c index 8c9fff8..dad0b13 100644 --- a/ssl/Attic/ssl_enum.c +++ b/ssl/Attic/ssl_enum.c @@ -1,27 +1,18 @@ #include "network.h" #include "ssl.h" #include "sslprint.h" -static int decode_ContentType_change_cipher_spec(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_ContentType_change_cipher_spec (ssl_obj *ssl, int dir, segment *seg, Data *data) { return(0); } -static int decode_ContentType_alert(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_ContentType_alert (ssl_obj *ssl, int dir, segment *seg, Data *data) { return(0); } -static int decode_ContentType_handshake(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_ContentType_handshake (ssl_obj *ssl, int dir, segment *seg, Data *data) { @@ -41,11 +32,8 @@ static int decode_ContentType_handshake(ssl,dir,seg,data) ssl_decode_switch(ssl,HandshakeType_decoder,t,dir,seg,data); } -static int decode_ContentType_application_data(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_ContentType_application_data (ssl_obj *ssl, int dir, segment *seg, Data *data) { return(0); } @@ -73,19 +61,13 @@ decoder ContentType_decoder[]={ {-1} }; -static int decode_HandshakeType_hello_request(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_HandshakeType_hello_request (ssl_obj *ssl, int dir, segment *seg, Data *data) { return(0); } -static int decode_HandshakeType_client_hello(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_HandshakeType_client_hello (ssl_obj *ssl, int dir, segment *seg, Data *data) { @@ -128,11 +110,8 @@ static int decode_HandshakeType_client_hello(ssl,dir,seg,data) return(0); } -static int decode_HandshakeType_server_hello(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_HandshakeType_server_hello (ssl_obj *ssl, int dir, segment *seg, Data *data) { @@ -153,59 +132,38 @@ static int decode_HandshakeType_server_hello(ssl,dir,seg,data) return(0); } -static int decode_HandshakeType_certificate(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_HandshakeType_certificate (ssl_obj *ssl, int dir, segment *seg, Data *data) { return(0); } -static int decode_HandshakeType_server_key_exchange(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_HandshakeType_server_key_exchange (ssl_obj *ssl, int dir, segment *seg, Data *data) { return(0); } -static int decode_HandshakeType_certificate_request(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_HandshakeType_certificate_request (ssl_obj *ssl, int dir, segment *seg, Data *data) { return(0); } -static int decode_HandshakeType_server_hello_done(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_HandshakeType_server_hello_done (ssl_obj *ssl, int dir, segment *seg, Data *data) { return(0); } -static int decode_HandshakeType_certificate_verify(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_HandshakeType_certificate_verify (ssl_obj *ssl, int dir, segment *seg, Data *data) { return(0); } -static int decode_HandshakeType_client_key_exchange(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_HandshakeType_client_key_exchange (ssl_obj *ssl, int dir, segment *seg, Data *data) { return(0); } -static int decode_HandshakeType_finished(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_HandshakeType_finished (ssl_obj *ssl, int dir, segment *seg, Data *data) { return(0); } diff --git a/ssl/ciphersuites.c b/ssl/ciphersuites.c index bd555a2..faab334 100644 --- a/ssl/ciphersuites.c +++ b/ssl/ciphersuites.c @@ -233,9 +233,8 @@ static SSL_CipherSuite CipherSuites[]={ {-1} }; -int ssl_find_cipher(num,cs) - int num; - SSL_CipherSuite **cs; +int +ssl_find_cipher (int num, SSL_CipherSuite **cs) { SSL_CipherSuite *c; diff --git a/ssl/ssl.enums.c b/ssl/ssl.enums.c index 0f4eb4f..8c8ab6a 100644 --- a/ssl/ssl.enums.c +++ b/ssl/ssl.enums.c @@ -10,11 +10,8 @@ #include "ssl.enums.h" static int decode_extension(ssl_obj *ssl, int dir, segment *seg, Data *data); static int decode_server_name(ssl_obj *ssl, int dir, segment *seg, Data *data); -static int decode_ContentType_ChangeCipherSpec(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_ContentType_ChangeCipherSpec (ssl_obj *ssl, int dir, segment *seg, Data *data) { struct json_object *jobj; @@ -35,11 +32,8 @@ static int decode_ContentType_ChangeCipherSpec(ssl,dir,seg,data) return(0); } -static int decode_ContentType_Alert(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_ContentType_Alert (ssl_obj *ssl, int dir, segment *seg, Data *data) { int r; @@ -74,11 +68,8 @@ static int decode_ContentType_Alert(ssl,dir,seg,data) return(0); } -static int decode_ContentType_Handshake(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_ContentType_Handshake (ssl_obj *ssl, int dir, segment *seg, Data *data) { @@ -122,11 +113,8 @@ static int decode_ContentType_Handshake(ssl,dir,seg,data) return(0); } -static int decode_ContentType_application_data(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_ContentType_application_data (ssl_obj *ssl, int dir, segment *seg, Data *data) { @@ -172,11 +160,8 @@ decoder ContentType_decoder[]={ {-1} }; -static int decode_HandshakeType_HelloRequest(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_HandshakeType_HelloRequest (ssl_obj *ssl, int dir, segment *seg, Data *data) { struct json_object *jobj; jobj = ssl->cur_json_st; @@ -187,11 +172,8 @@ static int decode_HandshakeType_HelloRequest(ssl,dir,seg,data) return(0); } -static int decode_HandshakeType_ClientHello(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_HandshakeType_ClientHello (ssl_obj *ssl, int dir, segment *seg, Data *data) { struct json_object *jobj; jobj = ssl->cur_json_st; @@ -375,11 +357,8 @@ static int decode_HandshakeType_ClientHello(ssl,dir,seg,data) return(0); } -static int decode_HandshakeType_ServerHello(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_HandshakeType_ServerHello (ssl_obj *ssl, int dir, segment *seg, Data *data) { int r; @@ -520,11 +499,8 @@ static int decode_HandshakeType_ServerHello(ssl,dir,seg,data) return(0); } -static int decode_HandshakeType_Certificate(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_HandshakeType_Certificate (ssl_obj *ssl, int dir, segment *seg, Data *data) { UINT4 len,exlen,ex; Data cert; @@ -569,11 +545,8 @@ static int decode_HandshakeType_Certificate(ssl,dir,seg,data) } -static int decode_HandshakeType_SessionTicket(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_HandshakeType_SessionTicket (ssl_obj *ssl, int dir, segment *seg, Data *data) { int r; UINT4 exlen, ex, val; @@ -601,11 +574,8 @@ static int decode_HandshakeType_SessionTicket(ssl,dir,seg,data) } } -static int decode_HandshakeType_EncryptedExtensions(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_HandshakeType_EncryptedExtensions (ssl_obj *ssl, int dir, segment *seg, Data *data) { int r; UINT4 exlen, ex; @@ -626,11 +596,8 @@ static int decode_HandshakeType_EncryptedExtensions(ssl,dir,seg,data) } } -static int decode_HandshakeType_ServerKeyExchange(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_HandshakeType_ServerKeyExchange (ssl_obj *ssl, int dir, segment *seg, Data *data) { @@ -666,11 +633,8 @@ static int decode_HandshakeType_ServerKeyExchange(ssl,dir,seg,data) return(0); } -static int decode_HandshakeType_CertificateRequest(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_HandshakeType_CertificateRequest (ssl_obj *ssl, int dir, segment *seg, Data *data) { @@ -706,11 +670,8 @@ static int decode_HandshakeType_CertificateRequest(ssl,dir,seg,data) return(0); } -static int decode_HandshakeType_ServerHelloDone(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_HandshakeType_ServerHelloDone (ssl_obj *ssl, int dir, segment *seg, Data *data) { struct json_object *jobj; @@ -722,11 +683,8 @@ static int decode_HandshakeType_ServerHelloDone(ssl,dir,seg,data) return(0); } -static int decode_HandshakeType_CertificateVerify(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_HandshakeType_CertificateVerify (ssl_obj *ssl, int dir, segment *seg, Data *data) { @@ -746,11 +704,8 @@ static int decode_HandshakeType_CertificateVerify(ssl,dir,seg,data) return(0); } -static int decode_HandshakeType_ClientKeyExchange(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_HandshakeType_ClientKeyExchange (ssl_obj *ssl, int dir, segment *seg, Data *data) { @@ -789,11 +744,8 @@ static int decode_HandshakeType_ClientKeyExchange(ssl,dir,seg,data) return(0); } -static int decode_HandshakeType_Finished(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_HandshakeType_Finished (ssl_obj *ssl, int dir, segment *seg, Data *data) { @@ -822,11 +774,8 @@ static int decode_HandshakeType_Finished(ssl,dir,seg,data) } -static int decode_HandshakeType_KeyUpdate(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_HandshakeType_KeyUpdate (ssl_obj *ssl, int dir, segment *seg, Data *data) { LF; ssl_tls13_update_keying_material(ssl, ssl->decoder, dir); @@ -2463,22 +2412,16 @@ decoder cipher_suite_decoder[]={ {-1} }; -static int decode_AlertLevel_warning(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_AlertLevel_warning (ssl_obj *ssl, int dir, segment *seg, Data *data) { struct json_object *jobj; jobj = ssl->cur_json_st; json_object_object_add(jobj, "alert_level", json_object_new_string("warning")); return(0); } -static int decode_AlertLevel_fatal(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_AlertLevel_fatal (ssl_obj *ssl, int dir, segment *seg, Data *data) { struct json_object *jobj; jobj = ssl->cur_json_st; @@ -2499,187 +2442,118 @@ decoder AlertLevel_decoder[]={ {-1} }; -static int decode_AlertDescription_close_notify(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_AlertDescription_close_notify (ssl_obj *ssl, int dir, segment *seg, Data *data) { return(0); } -static int decode_AlertDescription_unexpected_message(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_AlertDescription_unexpected_message (ssl_obj *ssl, int dir, segment *seg, Data *data) { return(0); } -static int decode_AlertDescription_bad_record_mac(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_AlertDescription_bad_record_mac (ssl_obj *ssl, int dir, segment *seg, Data *data) { return(0); } -static int decode_AlertDescription_decryption_failed(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_AlertDescription_decryption_failed (ssl_obj *ssl, int dir, segment *seg, Data *data) { return(0); } -static int decode_AlertDescription_record_overflow(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_AlertDescription_record_overflow (ssl_obj *ssl, int dir, segment *seg, Data *data) { return(0); } -static int decode_AlertDescription_decompression_failure(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_AlertDescription_decompression_failure (ssl_obj *ssl, int dir, segment *seg, Data *data) { return(0); } -static int decode_AlertDescription_handshake_failure(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_AlertDescription_handshake_failure (ssl_obj *ssl, int dir, segment *seg, Data *data) { return(0); } -static int decode_AlertDescription_bad_certificate(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_AlertDescription_bad_certificate (ssl_obj *ssl, int dir, segment *seg, Data *data) { return(0); } -static int decode_AlertDescription_unsupported_certificate(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_AlertDescription_unsupported_certificate (ssl_obj *ssl, int dir, segment *seg, Data *data) { return(0); } -static int decode_AlertDescription_certificate_revoked(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_AlertDescription_certificate_revoked (ssl_obj *ssl, int dir, segment *seg, Data *data) { return(0); } -static int decode_AlertDescription_certificate_expired(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_AlertDescription_certificate_expired (ssl_obj *ssl, int dir, segment *seg, Data *data) { return(0); } -static int decode_AlertDescription_certificate_unknown(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_AlertDescription_certificate_unknown (ssl_obj *ssl, int dir, segment *seg, Data *data) { return(0); } -static int decode_AlertDescription_illegal_parameter(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_AlertDescription_illegal_parameter (ssl_obj *ssl, int dir, segment *seg, Data *data) { return(0); } -static int decode_AlertDescription_unknown_ca(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_AlertDescription_unknown_ca (ssl_obj *ssl, int dir, segment *seg, Data *data) { return(0); } -static int decode_AlertDescription_access_denied(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_AlertDescription_access_denied (ssl_obj *ssl, int dir, segment *seg, Data *data) { return(0); } -static int decode_AlertDescription_decode_error(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_AlertDescription_decode_error (ssl_obj *ssl, int dir, segment *seg, Data *data) { return(0); } -static int decode_AlertDescription_decrypt_error(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_AlertDescription_decrypt_error (ssl_obj *ssl, int dir, segment *seg, Data *data) { return(0); } -static int decode_AlertDescription_export_restriction(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_AlertDescription_export_restriction (ssl_obj *ssl, int dir, segment *seg, Data *data) { return(0); } -static int decode_AlertDescription_protocol_version(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_AlertDescription_protocol_version (ssl_obj *ssl, int dir, segment *seg, Data *data) { return(0); } -static int decode_AlertDescription_insufficient_security(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_AlertDescription_insufficient_security (ssl_obj *ssl, int dir, segment *seg, Data *data) { return(0); } -static int decode_AlertDescription_internal_error(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_AlertDescription_internal_error (ssl_obj *ssl, int dir, segment *seg, Data *data) { return(0); } -static int decode_AlertDescription_user_canceled(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_AlertDescription_user_canceled (ssl_obj *ssl, int dir, segment *seg, Data *data) { return(0); } -static int decode_AlertDescription_no_renegotiation(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_AlertDescription_no_renegotiation (ssl_obj *ssl, int dir, segment *seg, Data *data) { return(0); } @@ -2810,35 +2684,23 @@ decoder compression_method_decoder[]={ {-1} }; -static int decode_client_certificate_type_rsa_sign(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_client_certificate_type_rsa_sign (ssl_obj *ssl, int dir, segment *seg, Data *data) { return(0); } -static int decode_client_certificate_type_dss_sign(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_client_certificate_type_dss_sign (ssl_obj *ssl, int dir, segment *seg, Data *data) { return(0); } -static int decode_client_certificate_type_rsa_fixed_dh(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_client_certificate_type_rsa_fixed_dh (ssl_obj *ssl, int dir, segment *seg, Data *data) { return(0); } -static int decode_client_certificate_type_dss_fixed_dh(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_client_certificate_type_dss_fixed_dh (ssl_obj *ssl, int dir, segment *seg, Data *data) { return(0); } @@ -2866,11 +2728,8 @@ decoder client_certificate_type_decoder[]={ {-1} }; -static int decode_extension_server_name(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_extension_server_name (ssl_obj *ssl, int dir, segment *seg, Data *data) { UINT4 t,l; int r,p; @@ -2902,11 +2761,8 @@ static int decode_extension_server_name(ssl,dir,seg,data) } return(0); } -static int decode_extension_encrypt_then_mac(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_extension_encrypt_then_mac (ssl_obj *ssl, int dir, segment *seg, Data *data) { int r,*etm; UINT4 l; @@ -2920,11 +2776,8 @@ static int decode_extension_encrypt_then_mac(ssl,dir,seg,data) dir==DIR_I2R?*etm=1:++*etm; return(0); } -static int decode_extension_extended_master_secret(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_extension_extended_master_secret (ssl_obj *ssl, int dir, segment *seg, Data *data) { int r,*ems; UINT4 l; @@ -2938,11 +2791,8 @@ static int decode_extension_extended_master_secret(ssl,dir,seg,data) dir==DIR_I2R?*ems=1:++*ems; return(0); } -static int decode_extension(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_extension (ssl_obj *ssl, int dir, segment *seg, Data *data) { int r; UINT4 l; @@ -2965,11 +2815,8 @@ decoder supported_groups_decoder[] = { {0x0104,"ffdhe8192",0}, }; // Extension #10 supported_groups (renamed from "elliptic_curves") -static int decode_extension_supported_groups(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_extension_supported_groups (ssl_obj *ssl, int dir, segment *seg, Data *data) { int r,p; UINT4 l,g; @@ -3007,11 +2854,8 @@ decoder ec_point_formats_decoder[] = { {2,"ansiX962_compressed_char2",0,} }; // Extension #11 ec_point_formats -static int decode_extension_ec_point_formats(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_extension_ec_point_formats (ssl_obj *ssl, int dir, segment *seg, Data *data) { int r,p; UINT4 l,f; @@ -3044,11 +2888,8 @@ static int decode_extension_ec_point_formats(ssl,dir,seg,data) return(0); } -static int decode_extension_supported_versions(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_extension_supported_versions (ssl_obj *ssl, int dir, segment *seg, Data *data) { int r; UINT4 len, version; @@ -3070,11 +2911,8 @@ decoder tls13_certificate_types[] = { {2,"raw public key",0}, {3,"1609 dot 2",0} }; -static int decode_extension_client_certificate_type(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_extension_client_certificate_type (ssl_obj *ssl, int dir, segment *seg, Data *data) { int r; UINT4 len, certificate_type; @@ -3090,11 +2928,8 @@ static int decode_extension_client_certificate_type(ssl,dir,seg,data) if (dir == DIR_R2I) ssl->extensions->client_certificate_type = certificate_type; // Server sets the client_certificate_type } -static int decode_extension_server_certificate_type(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_extension_server_certificate_type (ssl_obj *ssl, int dir, segment *seg, Data *data) { int r; UINT4 len, certificate_type; @@ -3394,11 +3229,8 @@ decoder extension_decoder[] = { {-1} }; -static int decode_server_name_type_host_name(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_server_name_type_host_name (ssl_obj *ssl, int dir, segment *seg, Data *data) { int r; UINT4 l; @@ -3424,11 +3256,8 @@ static int decode_server_name_type_host_name(ssl,dir,seg,data) data->data+=l; return(0); } -static int decode_server_name(ssl,dir,seg,data) - ssl_obj *ssl; - int dir; - segment *seg; - Data *data; +static int +decode_server_name (ssl_obj *ssl, int dir, segment *seg, Data *data) { int r; UINT4 l; diff --git a/ssl/ssl_analyze.c b/ssl/ssl_analyze.c index de2d7f0..3cf7131 100644 --- a/ssl/ssl_analyze.c +++ b/ssl/ssl_analyze.c @@ -162,8 +162,8 @@ flag_struct flags[]={ {0} }; -int parse_ssl_flag(flag) - int flag; +int +parse_ssl_flag (int flag) { flag_struct *fl; @@ -181,8 +181,8 @@ int parse_ssl_flag(flag) return(0); } -static int parse_ssl_flags(str) - char *str; +static int +parse_ssl_flags (char *str) { char *x,*y; flag_struct *fl; @@ -214,9 +214,8 @@ static int parse_ssl_flags(str) return(0); } -static int create_ssl_ctx(handle,ctxp) - void *handle; - proto_ctx **ctxp; +static int +create_ssl_ctx (void *handle, proto_ctx **ctxp) { ssl_decode_ctx *ctx=0; int r,_status; @@ -230,9 +229,8 @@ static int create_ssl_ctx(handle,ctxp) return(_status); } -static int destroy_ssl_ctx(handle,ctxp) - void *handle; - proto_ctx **ctxp; +static int +destroy_ssl_ctx (void *handle, proto_ctx **ctxp) { ssl_decode_ctx *ctx=0; ctx=(ssl_decode_ctx *) *ctxp; @@ -292,8 +290,8 @@ static int create_ssl_analyzer(void *handle, proto_ctx *ctx, tcp_conn *conn, return(_status); } -static int destroy_ssl_analyzer(objp) - proto_obj **objp; +static int +destroy_ssl_analyzer (proto_obj **objp) { ssl_obj *obj; @@ -321,8 +319,8 @@ static int destroy_ssl_analyzer(objp) } -static int free_r_queue(q) - r_queue *q; +static int +free_r_queue (r_queue *q) { FREE(q->data); if(q->q) free_tcp_segment_queue(q->q); @@ -330,8 +328,8 @@ static int free_r_queue(q) return(0); } -static int create_r_queue(qp) - r_queue **qp; +static int +create_r_queue (r_queue **qp) { r_queue *q=0; int _status; @@ -355,13 +353,8 @@ static int create_r_queue(qp) return(_status); } -static int read_ssl_record(obj,q,seg,offset,lastp,offsetp) - ssl_obj *obj; - r_queue *q; - segment *seg; - int offset; - segment **lastp; - int *offsetp; +static int +read_ssl_record (ssl_obj *obj, r_queue *q, segment *seg, int offset, segment **lastp, int *offsetp) { segment *last=seg; @@ -422,12 +415,8 @@ static int read_ssl_record(obj,q,seg,offset,lastp,offsetp) } -static int read_data(q,seg,offset,lastp,offsetp) - r_queue *q; - segment *seg; - int offset; - segment **lastp; - int *offsetp; +static int +read_data (r_queue *q, segment *seg, int offset, segment **lastp, int *offsetp) { int tocpy=0,r,_status; #ifdef DEBUG @@ -477,10 +466,8 @@ static int read_data(q,seg,offset,lastp,offsetp) return(_status); } -static int data_ssl_analyzer(_obj,seg,direction) - proto_obj *_obj; - segment *seg; - int direction; +static int +data_ssl_analyzer (proto_obj *_obj, segment *seg, int direction) { int _status,r; r_queue *q; @@ -555,12 +542,8 @@ static int data_ssl_analyzer(_obj,seg,direction) return(_status); } -static int print_ssl_header(obj,direction,q,data,len) - ssl_obj *obj; - int direction; - segment *q; - UCHAR *data; - int len; +static int +print_ssl_header (ssl_obj *obj, int direction, segment *q, UCHAR *data, int len) { int ct=0; segment *s; @@ -583,12 +566,8 @@ static int print_ssl_header(obj,direction,q,data,len) return(0); } -static int print_ssl_record(obj,direction,q,data,len) - ssl_obj *obj; - int direction; - segment *q; - UCHAR *data; - int len; +static int +print_ssl_record (ssl_obj *obj, int direction, segment *q, UCHAR *data, int len) { int r; @@ -614,10 +593,8 @@ static int print_ssl_record(obj,direction,q,data,len) return(0); } -int close_ssl_analyzer(_obj,p,dir) - proto_obj *_obj; - packet *p; - int dir; +int +close_ssl_analyzer (proto_obj *_obj, packet *p, int dir) { ssl_obj *ssl=(ssl_obj *)_obj; char *what; diff --git a/ssl/ssl_rec.c b/ssl/ssl_rec.c index 2150549..14cf938 100644 --- a/ssl/ssl_rec.c +++ b/ssl/ssl_rec.c @@ -104,12 +104,8 @@ static int tls_check_mac PROTO_LIST((ssl_rec_decoder *d,int ct, int ver,UCHAR *data,UINT4 datalen,UCHAR *iv,UINT4 ivlen,UCHAR *mac)); static int fmt_seq PROTO_LIST((UINT4 num,UCHAR *buf)); -int ssl_create_rec_decoder(dp,ssl,mk,sk,iv) - ssl_rec_decoder **dp; - ssl_obj *ssl; - UCHAR *mk; - UCHAR *sk; - UCHAR *iv; +int +ssl_create_rec_decoder (ssl_rec_decoder **dp, ssl_obj *ssl, UCHAR *mk, UCHAR *sk, UCHAR *iv) { int r,_status; ssl_rec_decoder *dec=0; @@ -168,8 +164,8 @@ int ssl_create_rec_decoder(dp,ssl,mk,sk,iv) return(_status); } -int ssl_destroy_rec_decoder(dp) - ssl_rec_decoder **dp; +int +ssl_destroy_rec_decoder (ssl_rec_decoder **dp) { ssl_rec_decoder *d; @@ -195,25 +191,16 @@ int ssl_destroy_rec_decoder(dp) #define MSB(a) ((a>>8)&0xff) #define LSB(a) (a&0xff) -int tls13_update_rec_key(d,newkey,newiv) - ssl_rec_decoder *d; - UCHAR *newkey; - UCHAR *newiv; +int +tls13_update_rec_key (ssl_rec_decoder *d, UCHAR *newkey, UCHAR *newiv) { d->write_key->data = newkey; d->implicit_iv->data = newiv; d->seq = 0; } -int tls13_decode_rec_data(ssl,d,ct,version,in,inl,out,outl) - ssl_obj *ssl; - ssl_rec_decoder *d; - int ct; - int version; - UCHAR *in; - int inl; - UCHAR *out; - int *outl; +int +tls13_decode_rec_data (ssl_obj *ssl, ssl_rec_decoder *d, int ct, int version, UCHAR *in, int inl, UCHAR *out, int *outl) { int pad,i; int r,encpadl,x,_status=0; @@ -284,15 +271,8 @@ abort: return _status; } -int ssl_decode_rec_data(ssl,d,ct,version,in,inl,out,outl) - ssl_obj *ssl; - ssl_rec_decoder *d; - int ct; - int version; - UCHAR *in; - int inl; - UCHAR *out; - int *outl; +int +ssl_decode_rec_data (ssl_obj *ssl, ssl_rec_decoder *d, int ct, int version, UCHAR *in, int inl, UCHAR *out, int *outl) { #ifdef OPENSSL int pad; @@ -426,9 +406,8 @@ int ssl_decode_rec_data(ssl,d,ct,version,in,inl,out,outl) /* This should go to 2^128, but we're never really going to see more than 2^64, so we cheat*/ -static int fmt_seq(num,buf) - UINT4 num; - UCHAR *buf; +static int +fmt_seq (UINT4 num, UCHAR *buf) { UINT4 netnum; @@ -439,15 +418,8 @@ static int fmt_seq(num,buf) return(0); } -static int tls_check_mac(d,ct,ver,data,datalen,iv,ivlen,mac) - ssl_rec_decoder *d; - int ct; - int ver; - UCHAR *data; - UINT4 datalen; - UCHAR *iv; - UINT4 ivlen; - UCHAR *mac; +static int +tls_check_mac (ssl_rec_decoder *d, int ct, int ver, UCHAR *data, UINT4 datalen, UCHAR *iv, UINT4 ivlen, UCHAR *mac) { HMAC_CTX *hm = HMAC_CTX_new(); if(!hm) @@ -489,13 +461,8 @@ static int tls_check_mac(d,ct,ver,data,datalen,iv,ivlen,mac) return(0); } -int ssl3_check_mac(d,ct,ver,data,datalen,mac) - ssl_rec_decoder *d; - int ct; - int ver; - UCHAR *data; - UINT4 datalen; - UCHAR *mac; +int +ssl3_check_mac (ssl_rec_decoder *d, int ct, int ver, UCHAR *data, UINT4 datalen, UCHAR *mac) { EVP_MD_CTX *mc = EVP_MD_CTX_new(); const EVP_MD *md; diff --git a/ssl/ssldecode.c b/ssl/ssldecode.c index 5a81834..1d28fc0 100644 --- a/ssl/ssldecode.c +++ b/ssl/ssldecode.c @@ -139,11 +139,8 @@ static int password_cb(char *buf,int num,int rwflag,void *userdata) return(strlen(ssl_password)); } -int ssl_decode_ctx_create(dp,keyfile,pass,keylogfile) - ssl_decode_ctx **dp; - char *keyfile; - char *pass; - char *keylogfile; +int +ssl_decode_ctx_create (ssl_decode_ctx **dp, char *keyfile, char *pass, char *keylogfile) { #ifdef OPENSSL ssl_decode_ctx *d=0; @@ -197,8 +194,8 @@ int ssl_decode_ctx_create(dp,keyfile,pass,keylogfile) #endif } -int ssl_decode_ctx_destroy(dp) - ssl_decode_ctx **dp; +int +ssl_decode_ctx_destroy (ssl_decode_ctx **dp) { #ifdef OPENSSL ssl_decode_ctx *d = *dp; @@ -217,9 +214,8 @@ int ssl_decode_ctx_destroy(dp) return(0); } -int ssl_decoder_create(dp,ctx) - ssl_decoder **dp; - ssl_decode_ctx *ctx; +int +ssl_decoder_create (ssl_decoder **dp, ssl_decode_ctx *ctx) { int _status; @@ -241,8 +237,8 @@ int ssl_decoder_create(dp,ctx) #endif } -int ssl_decoder_destroy(dp) - ssl_decoder **dp; +int +ssl_decoder_destroy (ssl_decoder **dp) { #ifdef OPENSSL ssl_decoder *d; @@ -267,10 +263,8 @@ int ssl_decoder_destroy(dp) return(0); } -int ssl_set_client_random(d,msg,len) - ssl_decoder *d; - UCHAR *msg; - int len; +int +ssl_set_client_random (ssl_decoder *d, UCHAR *msg, int len) { #ifdef OPENSSL int r; @@ -282,10 +276,8 @@ int ssl_set_client_random(d,msg,len) return(0); } -int ssl_set_server_random(d,msg,len) - ssl_decoder *d; - UCHAR *msg; - int len; +int +ssl_set_server_random (ssl_decoder *d, UCHAR *msg, int len) { #ifdef OPENSSL int r; @@ -297,10 +289,8 @@ int ssl_set_server_random(d,msg,len) return(0); } -int ssl_set_client_session_id(d,msg,len) - ssl_decoder *d; - UCHAR *msg; - int len; +int +ssl_set_client_session_id (ssl_decoder *d, UCHAR *msg, int len) { #ifdef OPENSSL int r; @@ -314,11 +304,8 @@ int ssl_set_client_session_id(d,msg,len) return(0); } -int ssl_process_server_session_id(ssl,d,msg,len) - ssl_obj *ssl; - ssl_decoder *d; - UCHAR *msg; - int len; +int +ssl_process_server_session_id (ssl_obj *ssl, ssl_decoder *d, UCHAR *msg, int len) { #ifdef OPENSSL int r,_status; @@ -359,11 +346,8 @@ int ssl_process_server_session_id(ssl,d,msg,len) #endif } -int ssl_process_client_session_id(ssl,d,msg,len) - ssl_obj *ssl; - ssl_decoder *d; - UCHAR *msg; - int len; +int +ssl_process_client_session_id (ssl_obj *ssl, ssl_decoder *d, UCHAR *msg, int len) { #ifdef OPENSSL int _status; @@ -410,10 +394,8 @@ int ssl_process_handshake_finished(ssl_obj* ssl,ssl_decoder *dec, Data *data){ } } -int ssl_process_change_cipher_spec(ssl,d,direction) - ssl_obj *ssl; - ssl_decoder *d; - int direction; +int +ssl_process_change_cipher_spec (ssl_obj *ssl, ssl_decoder *d, int direction) { #ifdef OPENSSL if (ssl->version!=TLSV13_VERSION){ @@ -431,13 +413,8 @@ int ssl_process_change_cipher_spec(ssl,d,direction) #endif return(0); } -int ssl_decode_record(ssl,dec,direction,ct,version,d) - ssl_obj *ssl; - ssl_decoder *dec; - int direction; - int ct; - int version; - Data *d; +int +ssl_decode_record (ssl_obj *ssl, ssl_decoder *dec, int direction, int ct, int version, Data *d) { ssl_rec_decoder *rd; UCHAR *out; @@ -493,9 +470,8 @@ int ssl_decode_record(ssl,dec,direction,ct,version,d) #endif } -int ssl_update_handshake_messages(ssl,data) - ssl_obj *ssl; - Data *data; +int +ssl_update_handshake_messages (ssl_obj *ssl, Data *data) { #ifdef OPENSSL Data *hms; @@ -523,12 +499,8 @@ int ssl_update_handshake_messages(ssl,data) } -static int ssl_create_session_lookup_key(ssl,id,idlen,keyp,keyl) - ssl_obj *ssl; - UCHAR *id; - UINT4 idlen; - UCHAR **keyp; - UINT4 *keyl; +static int +ssl_create_session_lookup_key (ssl_obj *ssl, UCHAR *id, UINT4 idlen, UCHAR **keyp, UINT4 *keyl) { UCHAR *key=0; UINT4 l; @@ -554,9 +526,8 @@ static int ssl_create_session_lookup_key(ssl,id,idlen,keyp,keyl) /* Look up the session id in the session cache and generate the appropriate keying material */ -int ssl_restore_session(ssl,d) - ssl_obj *ssl; - ssl_decoder *d; +int +ssl_restore_session (ssl_obj *ssl, ssl_decoder *d) { UCHAR *lookup_key=0; void *msv; @@ -599,9 +570,8 @@ int ssl_restore_session(ssl,d) /* Look up the session id in the session cache and generate the appropriate keying material */ -int ssl_save_session(ssl,d) - ssl_obj *ssl; - ssl_decoder *d; +int +ssl_save_session (ssl_obj *ssl, ssl_decoder *d) { #ifdef OPENSSL UCHAR *lookup_key=0; @@ -634,11 +604,8 @@ int ssl_save_session(ssl,d) /* This only works with RSA because the other cipher suites offer PFS. Yuck. */ -int ssl_process_client_key_exchange(ssl,d,msg,len) - ssl_obj *ssl; - ssl_decoder *d; - UCHAR *msg; - int len; +int +ssl_process_client_key_exchange (ssl_obj *ssl, ssl_decoder *d, UCHAR *msg, int len) { #ifdef OPENSSL int r,_status; @@ -755,13 +722,8 @@ static int tls_P_hash(ssl,secret,seed,md,out) } -static int tls_prf(ssl,secret,usage,rnd1,rnd2,out) - ssl_obj *ssl; - Data *secret; - char *usage; - Data *rnd1; - Data *rnd2; - Data *out; +static int +tls_prf (ssl_obj *ssl, Data *secret, char *usage, Data *rnd1, Data *rnd2, Data *out) { int r,_status; Data *md5_out=0,*sha_out=0; @@ -813,13 +775,8 @@ static int tls_prf(ssl,secret,usage,rnd1,rnd2,out) } -static int tls12_prf(ssl,secret,usage,rnd1,rnd2,out) - ssl_obj *ssl; - Data *secret; - char *usage; - Data *rnd1; - Data *rnd2; - Data *out; +static int +tls12_prf (ssl_obj *ssl, Data *secret, char *usage, Data *rnd1, Data *rnd2, Data *out) { const EVP_MD *md; @@ -861,11 +818,8 @@ static int tls12_prf(ssl,secret,usage,rnd1,rnd2,out) } -static int ssl3_generate_export_iv(ssl,r1,r2,out) - ssl_obj *ssl; - Data *r1; - Data *r2; - Data *out; +static int +ssl3_generate_export_iv (ssl_obj *ssl, Data *r1, Data *r2, Data *out) { MD5_CTX md5; UCHAR tmp[16]; @@ -880,13 +834,8 @@ static int ssl3_generate_export_iv(ssl,r1,r2,out) return(0); } -static int ssl3_prf(ssl,secret,usage,r1,r2,out) - ssl_obj *ssl; - Data *secret; - char *usage; - Data *r1; - Data *r2; - Data *out; +static int +ssl3_prf (ssl_obj *ssl, Data *secret, char *usage, Data *r1, Data *r2, Data *out) { MD5_CTX md5; SHA_CTX sha; @@ -951,9 +900,8 @@ static int ssl3_prf(ssl,secret,usage,r1,r2,out) return(0); } -static int ssl_generate_keying_material(ssl,d) - ssl_obj *ssl; - ssl_decoder *d; +static int +ssl_generate_keying_material (ssl_obj *ssl, ssl_decoder *d) { Data *key_block=0,temp; UCHAR _iv_c[8],_iv_s[8]; @@ -1189,10 +1137,8 @@ abort: } // Will update the keys for the particular direction -int ssl_tls13_update_keying_material(ssl,d,direction) - ssl_obj *ssl; - ssl_decoder *d; - int direction; +int +ssl_tls13_update_keying_material (ssl_obj *ssl, ssl_decoder *d, int direction) { Data *secret; ssl_rec_decoder *decoder; @@ -1216,9 +1162,8 @@ int ssl_tls13_update_keying_material(ssl,d,direction) return 0; } -int ssl_tls13_generate_keying_material(ssl,d) - ssl_obj* ssl; - ssl_decoder *d; +int +ssl_tls13_generate_keying_material (ssl_obj *ssl, ssl_decoder *d) { int r,_status; Data out; @@ -1287,9 +1232,8 @@ abort: return r; } -static int ssl_generate_session_hash(ssl,d) - ssl_obj *ssl; - ssl_decoder *d; +static int +ssl_generate_session_hash (ssl_obj *ssl, ssl_decoder *d) { int r,_status,dgi; unsigned int len; @@ -1345,9 +1289,8 @@ static int read_hex_string(char *str, UCHAR *buf, int n) { } return 0; } -static int ssl_read_key_log_file(ssl,d) - ssl_obj *ssl; - ssl_decoder *d; +static int +ssl_read_key_log_file (ssl_obj *ssl, ssl_decoder *d) { int r,_status,n,i; unsigned int t; diff --git a/ssl/sslprint.c b/ssl/sslprint.c index 7e62bbb..d3fbf90 100644 --- a/ssl/sslprint.c +++ b/ssl/sslprint.c @@ -59,10 +59,8 @@ extern decoder HandshakeType_decoder[]; #define BYTES_NEEDED(x) (x<=255)?1:((x<=(1<<16))?2:(x<=(1<<24)?3:4)) -int process_beginning_plaintext(ssl,seg,direction) - ssl_obj *ssl; - segment *seg; - int direction; +int +process_beginning_plaintext (ssl_obj *ssl, segment *seg, int direction) { Data d; if(seg->len==0) @@ -89,9 +87,8 @@ int process_beginning_plaintext(ssl,seg,direction) return(0); } -int process_v2_hello(ssl,seg) - ssl_obj *ssl; - segment *seg; +int +process_v2_hello (ssl_obj *ssl, segment *seg) { int r; int rec_len; @@ -213,13 +210,8 @@ int process_v2_hello(ssl,seg) return(_status); } -int ssl_decode_switch(ssl,dtable,value,dir,seg,data) - ssl_obj *ssl; - decoder *dtable; - int value; - int dir; - segment *seg; - Data *data; +int +ssl_decode_switch (ssl_obj *ssl, decoder *dtable, int value, int dir, segment *seg, Data *data) { while(dtable && dtable->type!=-1 && dtable->name!=NULL){ if(dtable->type == value){ @@ -239,12 +231,8 @@ int ssl_decode_switch(ssl,dtable,value,dir,seg,data) ERETURN(R_NOT_FOUND); } -int ssl_expand_record(ssl,q,direction,data,len) - ssl_obj *ssl; - segment *q; - int direction; - UCHAR *data; - int len; +int +ssl_expand_record (ssl_obj *ssl, segment *q, int direction, UCHAR *data, int len) { int r; Data d; @@ -319,13 +307,8 @@ int ssl_expand_record(ssl,q,direction,data,len) return(0); } -int ssl_decode_uintX(ssl,name,size,p,data,x) - ssl_obj *ssl; - char *name; - int size; - UINT4 p; - Data *data; - UINT4 *x; +int +ssl_decode_uintX (ssl_obj *ssl, char *name, int size, UINT4 p, Data *data, UINT4 *x) { UINT4 v=0; UINT4 _x; @@ -351,13 +334,8 @@ int ssl_decode_uintX(ssl,name,size,p,data,x) return(0); } -int ssl_decode_opaque_array(ssl,name,size,p,data,x) - ssl_obj *ssl; - char *name; - int size; - UINT4 p; - Data *data; - Data *x; +int +ssl_decode_opaque_array (ssl_obj *ssl, char *name, int size, UINT4 p, Data *data, Data *x) { UINT4 len; char n[1000]; @@ -394,11 +372,8 @@ int ssl_decode_opaque_array(ssl,name,size,p,data,x) return(0); } -int ssl_lookup_enum(ssl,dtable,val,ptr) - ssl_obj *ssl; - decoder *dtable; - UINT4 val; - char **ptr; +int +ssl_lookup_enum (ssl_obj *ssl, decoder *dtable, UINT4 val, char **ptr) { while(dtable && dtable->type!=-1){ if(dtable->type == val){ @@ -411,14 +386,8 @@ int ssl_lookup_enum(ssl,dtable,val,ptr) return(R_NOT_FOUND); } -int ssl_decode_enum(ssl,name,size,dtable,p,data,x) - ssl_obj *ssl; - char *name; - int size; - decoder *dtable; - UINT4 p; - Data *data; - UINT4 *x; +int +ssl_decode_enum (ssl_obj *ssl, char *name, int size, decoder *dtable, UINT4 p, Data *data, UINT4 *x) { int r; UINT4 _x; @@ -437,11 +406,8 @@ int ssl_decode_enum(ssl,name,size,dtable,p,data,x) return(0); } -int ssl_print_enum(ssl,name,dtable,value) - ssl_obj *ssl; - char *name; - decoder *dtable; - UINT4 value; +int +ssl_print_enum (ssl_obj *ssl, char *name, decoder *dtable, UINT4 value) { if(name) explain(ssl,"%s ",name); @@ -460,11 +426,8 @@ int ssl_print_enum(ssl,name,dtable,value) return(R_NOT_FOUND); } -int ssl_get_enum_str(ssl,outstr,dtable,value) - ssl_obj *ssl; - char *outstr; - decoder *dtable; - UINT4 value; +int +ssl_get_enum_str (ssl_obj *ssl, char *outstr, decoder *dtable, UINT4 value) { while(dtable && dtable->type!=-1){ if(dtable->type == value){ @@ -496,10 +459,8 @@ int explain(ssl_obj *ssl,char *format,...) return(0); } -int exdump(ssl,name,data) - ssl_obj *ssl; - char *name; - Data *data; +int +exdump (ssl_obj *ssl, char *name, Data *data) { int i; if(!(SSL_print_flags & SSL_PRINT_JSON)) { @@ -528,10 +489,8 @@ int exdump(ssl,name,data) return(0); } -int exstr(ssl,outstr,data) - ssl_obj *ssl; - char *outstr; - Data *data; +int +exstr (ssl_obj *ssl, char *outstr, Data *data) { int i; @@ -548,10 +507,8 @@ int exstr(ssl,outstr,data) return(0); } -int combodump(ssl,name,data) - ssl_obj *ssl; - char *name; - Data *data; +int +combodump (ssl_obj *ssl, char *name, Data *data) { UCHAR *ptr=data->data; int len=data->len; @@ -605,9 +562,8 @@ int combodump(ssl,name,data) return(0); } -int print_data(ssl,d) - ssl_obj *ssl; - Data *d; +int +print_data (ssl_obj *ssl, Data *d) { int i,bit8=0; @@ -661,9 +617,8 @@ int print_data(ssl,d) return(0); } -int ssl_print_direction_indicator(ssl,dir) - ssl_obj *ssl; - int dir; +int +ssl_print_direction_indicator (ssl_obj *ssl, int dir) { struct json_object *jobj; #if 0 @@ -706,9 +661,8 @@ int ssl_print_direction_indicator(ssl,dir) return(0); } -int ssl_print_timestamp(ssl,ts) - ssl_obj *ssl; - struct timeval *ts; +int +ssl_print_timestamp (ssl_obj *ssl, struct timeval *ts) { struct timeval dt; int r; @@ -745,8 +699,8 @@ int ssl_print_timestamp(ssl,ts) } -int ssl_print_record_num(ssl) - ssl_obj *ssl; +int +ssl_print_record_num (ssl_obj *ssl) { struct json_object *jobj; jobj = ssl->cur_json_st; @@ -769,11 +723,8 @@ int ssl_print_record_num(ssl) return(0); } -int ssl_print_cipher_suite(ssl,version,p,val) - ssl_obj *ssl; - int version; - int p; - UINT4 val; +int +ssl_print_cipher_suite (ssl_obj *ssl, int version, int p, UINT4 val) { char *str; char *prefix=version<=0x300?"SSL_":"TLS_"; diff --git a/ssl/sslxprint.c b/ssl/sslxprint.c index 3e0f02a..6d79e9e 100644 --- a/ssl/sslxprint.c +++ b/ssl/sslxprint.c @@ -62,10 +62,8 @@ static int sslx__print_dn PROTO_LIST((ssl_obj *ssl,char *x)); static int sslx__print_serial PROTO_LIST((ssl_obj *ssl,ASN1_INTEGER *a)); #endif -int sslx_print_certificate(ssl,data,pf) - ssl_obj *ssl; - Data *data; - int pf; +int +sslx_print_certificate (ssl_obj *ssl, Data *data, int pf) { #ifdef OPENSSL X509 *x=0; @@ -188,10 +186,8 @@ int sslx_print_certificate(ssl,data,pf) return(_status); } -int sslx_print_dn(ssl,data,pf) - ssl_obj *ssl; - Data *data; - int pf; +int +sslx_print_dn (ssl_obj *ssl, Data *data, int pf) { UCHAR buf[BUFSIZE]; int _status; @@ -224,9 +220,8 @@ int sslx_print_dn(ssl,data,pf) return(_status); } -static int sslx__print_dn(ssl,x) - ssl_obj *ssl; - char *x; +static int +sslx__print_dn (ssl_obj *ssl, char *x) { char *slash; @@ -246,9 +241,8 @@ static int sslx__print_dn(ssl,x) } #ifdef OPENSSL -static int sslx__print_serial(ssl,a) - ssl_obj *ssl; - ASN1_INTEGER *a; +static int +sslx__print_serial (ssl_obj *ssl, ASN1_INTEGER *a) { Data d;