Convert old-style function definitions

This commit is contained in:
William Robinet 2023-08-14 10:57:16 +02:00
parent 4799524de1
commit 00a631a28d
No known key found for this signature in database
GPG key ID: 003FA3DF74C7A949
25 changed files with 440 additions and 878 deletions

View file

@ -68,9 +68,8 @@ struct network_handler_ {
proto_ctx *ctx; proto_ctx *ctx;
}; };
int network_handler_create(mod,handlerp) int
proto_mod *mod; network_handler_create (proto_mod *mod, n_handler **handlerp)
n_handler **handlerp;
{ {
int r,_status; int r,_status;
n_handler *handler=0; n_handler *handler=0;
@ -91,9 +90,8 @@ int network_handler_create(mod,handlerp)
return(_status); return(_status);
} }
int network_handler_destroy(mod,handlerp) int
proto_mod *mod; network_handler_destroy (proto_mod *mod, n_handler **handlerp)
n_handler **handlerp;
{ {
n_handler *handler=0; n_handler *handler=0;
if(!handlerp || !*handlerp) if(!handlerp || !*handlerp)
@ -107,12 +105,8 @@ int network_handler_destroy(mod,handlerp)
return(0); return(0);
} }
int network_process_packet(handler,timestamp,data,length,af) int
n_handler *handler; network_process_packet (n_handler *handler, struct timeval *timestamp, UCHAR *data, int length, int af)
struct timeval *timestamp;
UCHAR *data;
int length;
int af;
{ {
int r; int r;
int hlen; int hlen;
@ -208,9 +202,8 @@ int network_process_packet(handler,timestamp,data,length,af)
return(0); return(0);
} }
int packet_copy(in,out) int
packet *in; packet_copy (packet *in, packet **out)
packet **out;
{ {
int _status; int _status;
@ -240,8 +233,8 @@ int packet_copy(in,out)
return(_status); return(_status);
} }
int packet_destroy(p) int
packet *p; packet_destroy (packet *p)
{ {
if(!p) if(!p)
return(0); return(0);
@ -251,10 +244,8 @@ int packet_destroy(p)
return(0); return(0);
} }
int timestamp_diff(t1,t0,diff) int
struct timeval *t1; timestamp_diff (struct timeval *t1, struct timeval *t0, struct timeval *diff)
struct timeval *t0;
struct timeval *diff;
{ {
long d; long d;
@ -280,9 +271,8 @@ int timestamp_diff(t1,t0,diff)
int lookuphostname(so_st,namep) int
struct sockaddr_storage *so_st; lookuphostname (struct sockaddr_storage *so_st, char **namep)
char **namep;
{ {
int r = 1; int r = 1;
*namep = calloc(1, NI_MAXHOST); *namep = calloc(1, NI_MAXHOST);
@ -304,9 +294,8 @@ int lookuphostname(so_st,namep)
return(0); return(0);
} }
int addrtotext(so_st,namep) int
struct sockaddr_storage *so_st; addrtotext (struct sockaddr_storage *so_st, char **namep)
char **namep;
{ {
*namep = calloc(1, NI_MAXHOST); *namep = calloc(1, NI_MAXHOST);
void *addr = NULL; void *addr = NULL;

View file

@ -47,12 +47,8 @@
#include "network.h" #include "network.h"
int create_proto_handler(mod,ctx,handlerp,conn,first_packet) int
proto_mod *mod; create_proto_handler (proto_mod *mod, proto_ctx *ctx, proto_handler **handlerp, tcp_conn *conn, struct timeval *first_packet)
proto_ctx *ctx;
proto_handler **handlerp;
tcp_conn *conn;
struct timeval *first_packet;
{ {
int r,_status; int r,_status;
proto_handler *handler=0; proto_handler *handler=0;
@ -74,8 +70,8 @@ int create_proto_handler(mod,ctx,handlerp,conn,first_packet)
return(_status); return(_status);
} }
int destroy_proto_handler(handlerp) int
proto_handler **handlerp; destroy_proto_handler (proto_handler **handlerp)
{ {
if(!handlerp || !*handlerp) if(!handlerp || !*handlerp)
return(0); return(0);

View file

@ -63,8 +63,8 @@ extern int conn_ttl;
static int zero_conn PROTO_LIST((tcp_conn *conn)); static int zero_conn PROTO_LIST((tcp_conn *conn));
static int zero_conn(conn) static int
tcp_conn *conn; zero_conn (tcp_conn *conn)
{ {
memset(conn,0,sizeof(tcp_conn)); memset(conn,0,sizeof(tcp_conn));
return(0); return(0);
@ -131,8 +131,8 @@ int tcp_create_conn(tcp_conn **connp,struct sockaddr_storage *i_addr,
return(0); return(0);
} }
int tcp_destroy_conn(conn) int
tcp_conn *conn; tcp_destroy_conn (tcp_conn *conn)
{ {
conn_struct *c=conn->backptr; conn_struct *c=conn->backptr;
@ -161,7 +161,8 @@ int tcp_destroy_conn(conn)
return(0); return(0);
} }
int clean_old_conn() { int
clean_old_conn (void) {
conn_struct *conn; conn_struct *conn;
tcp_conn *tcpconn; tcp_conn *tcpconn;
struct timeval dt; struct timeval dt;
@ -184,7 +185,8 @@ int clean_old_conn() {
return i; return i;
} }
int destroy_all_conn() { int
destroy_all_conn (void) {
int i = 0; int i = 0;
while(first_conn) { while(first_conn) {
i++; i++;
@ -193,8 +195,8 @@ int destroy_all_conn() {
return i; return i;
} }
int free_tcp_segment_queue(seg) int
segment *seg; free_tcp_segment_queue (segment *seg)
{ {
segment *tmp; segment *tmp;
@ -208,9 +210,8 @@ int free_tcp_segment_queue(seg)
return(0); return(0);
} }
int copy_tcp_segment_queue(out,in) int
segment **out; copy_tcp_segment_queue (segment **out, segment *in)
segment *in;
{ {
int r,_status; int r,_status;
segment *base=0; segment *base=0;

View file

@ -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)); static int print_tcp_packet PROTO_LIST((packet *p));
int STRIM PROTO_LIST((UINT4 _seq,segment *s)); int STRIM PROTO_LIST((UINT4 _seq,segment *s));
int process_tcp_packet(handler,ctx,p) int
proto_mod *handler; process_tcp_packet (proto_mod *handler, proto_ctx *ctx, packet *p)
proto_ctx *ctx;
packet *p;
{ {
int r,_status; int r,_status;
int direction; int direction;
@ -165,11 +163,8 @@ int process_tcp_packet(handler,ctx,p)
return(_status); return(_status);
} }
static int new_connection(handler,ctx,p,connp) static int
proto_mod *handler; new_connection (proto_mod *handler, proto_ctx *ctx, packet *p, tcp_conn **connp)
proto_ctx *ctx;
packet *p;
tcp_conn **connp;
{ {
int r,_status; int r,_status;
tcp_conn *conn=0; 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) static int
tcp_conn *conn; process_data_segment (tcp_conn *conn, proto_mod *handler, packet *p, stream_data *stream, int direction)
proto_mod *handler;
packet *p;
stream_data *stream;
int direction;
{ {
int r,_status; int r,_status;
tcp_seq seq,right_edge; tcp_seq seq,right_edge;
@ -393,8 +384,8 @@ static int process_data_segment(conn,handler,p,stream,direction)
return(_status); return(_status);
} }
static int print_tcp_packet(p) static int
packet *p; print_tcp_packet (packet *p)
{ {
char *src=0,*dst=0; char *src=0,*dst=0;
@ -441,9 +432,8 @@ static int print_tcp_packet(p)
return(0); return(0);
} }
int STRIM(_seq,s) int
UINT4 _seq; STRIM (UINT4 _seq, segment *s)
segment *s;
{ {
int l; int l;
int off; int off;

View file

@ -62,10 +62,8 @@ int debug(int class,char *format,...)
return(0); return(0);
} }
int xdump(name,data,len) int
char *name; xdump (char *name, UCHAR *data, int len)
UCHAR *data;
int len;
{ {
int i; int i;

View file

@ -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, static int copy_assoc_chain PROTO_LIST((r_assoc_el **newp,
r_assoc_el *old)); r_assoc_el *old));
int r_assoc_create(assocp) int
r_assoc **assocp; r_assoc_create (r_assoc **assocp)
{ {
r_assoc *assoc=0; r_assoc *assoc=0;
int _status; int _status;
@ -108,8 +108,8 @@ int r_assoc_create(assocp)
return(_status); return(_status);
} }
int r_assoc_destroy(assocp) int
r_assoc **assocp; r_assoc_destroy (r_assoc **assocp)
{ {
r_assoc *assoc; r_assoc *assoc;
int i; int i;
@ -127,8 +127,8 @@ int r_assoc_destroy(assocp)
return(0); return(0);
} }
static int destroy_assoc_chain(chain) static int
r_assoc_el *chain; destroy_assoc_chain (r_assoc_el *chain)
{ {
r_assoc_el *nxt; r_assoc_el *nxt;
@ -147,9 +147,8 @@ static int destroy_assoc_chain(chain)
return(0); return(0);
} }
static int copy_assoc_chain(newp,old) static int
r_assoc_el **newp; copy_assoc_chain (r_assoc_el **newp, r_assoc_el *old)
r_assoc_el *old;
{ {
r_assoc_el *new=0,*ptr,*tmp; r_assoc_el *new=0,*ptr,*tmp;
int r,_status; int r,_status;
@ -197,11 +196,8 @@ static int copy_assoc_chain(newp,old)
return(_status); return(_status);
} }
static int r_assoc_fetch_bucket(assoc,key,len,bucketp) static int
r_assoc *assoc; r_assoc_fetch_bucket (r_assoc *assoc, char *key, int len, r_assoc_el **bucketp)
char *key;
int len;
r_assoc_el **bucketp;
{ {
UINT4 hash_value; UINT4 hash_value;
r_assoc_el *bucket; r_assoc_el *bucket;
@ -218,11 +214,8 @@ static int r_assoc_fetch_bucket(assoc,key,len,bucketp)
return(R_NOT_FOUND); return(R_NOT_FOUND);
} }
int r_assoc_fetch(assoc,key,len,datap) int
r_assoc *assoc; r_assoc_fetch (r_assoc *assoc, char *key, int len, void **datap)
char *key;
int len;
void **datap;
{ {
r_assoc_el *bucket; r_assoc_el *bucket;
int r; int r;
@ -292,9 +285,8 @@ int r_assoc_insert(assoc,key,len,data,copy,destroy,how)
return(_status); return(_status);
} }
int r_assoc_copy(newp,old) int
r_assoc **newp; r_assoc_copy (r_assoc **newp, r_assoc *old)
r_assoc *old;
{ {
int r,_status,i; int r,_status,i;
r_assoc *new; r_assoc *new;
@ -320,9 +312,8 @@ int r_assoc_copy(newp,old)
return(_status); return(_status);
} }
int r_assoc_init_iter(assoc,iter) int
r_assoc *assoc; r_assoc_init_iter (r_assoc *assoc, r_assoc_iterator *iter)
r_assoc_iterator *iter;
{ {
int i; int i;
@ -344,11 +335,8 @@ int r_assoc_init_iter(assoc,iter)
return(0); return(0);
} }
int r_assoc_iter(iter,key,keyl,val) int
r_assoc_iterator *iter; r_assoc_iter (r_assoc_iterator *iter, void **key, int *keyl, void **val)
void **key;
int *keyl;
void **val;
{ {
int i; int i;
r_assoc_el *ret; r_assoc_el *ret;
@ -386,8 +374,8 @@ int r_assoc_iter(iter,key,keyl,val)
} }
/* Delete the last returned value*/ /* Delete the last returned value*/
int r_assoc_iter_delete(iter) int
r_assoc_iterator *iter; r_assoc_iter_delete (r_assoc_iterator *iter)
{ {
/* First unhook it from the list*/ /* First unhook it from the list*/
if(!iter->prev->prev){ 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 /*This is a hack from AMS. Supposedly, it's pretty good for strings, even
though it doesn't take into account all the data*/ though it doesn't take into account all the data*/
UINT4 hash_compute(key,len,bits) UINT4
char *key; hash_compute (char *key, int len, int bits)
int len;
int bits;
{ {
UINT4 h=0; UINT4 h=0;

View file

@ -48,7 +48,8 @@
#include <r_common.h> #include <r_common.h>
#include <r_assoc.h> #include <r_assoc.h>
int main() int
main (void)
{ {
char test_vector[1024],*v; char test_vector[1024],*v;
int rnd,ct,r; int rnd,ct,r;
@ -94,8 +95,8 @@ int main()
exit(0); exit(0);
} }
int fetch_test(assoc) int
r_assoc *assoc; fetch_test (r_assoc *assoc)
{ {
int ct; int ct;
char vec[4],*v; char vec[4],*v;

View file

@ -12,9 +12,8 @@
#include <r_common.h> #include <r_common.h>
#include "r_bitfield.h" #include "r_bitfield.h"
int r_bitfield_create(setp,size) int
r_bitfield **setp; r_bitfield_create (r_bitfield **setp, UINT4 size)
UINT4 size;
{ {
r_bitfield *set=0; r_bitfield *set=0;
int _status; int _status;
@ -40,8 +39,8 @@ int r_bitfield_create(setp,size)
return(_status); return(_status);
} }
int r_bitfield_destroy(setp) int
r_bitfield **setp; r_bitfield_destroy (r_bitfield **setp)
{ {
r_bitfield *set; r_bitfield *set;
@ -57,9 +56,8 @@ int r_bitfield_destroy(setp)
return(0); return(0);
} }
int r_bitfield_set(set,bit) int
r_bitfield *set; r_bitfield_set (r_bitfield *set, int bit)
int bit;
{ {
int word=(bit-set->base)/32; int word=(bit-set->base)/32;
int bbit=(bit-set->base)%32; int bbit=(bit-set->base)%32;
@ -90,9 +88,8 @@ int r_bitfield_set(set,bit)
return(_status); return(_status);
} }
int r_bitfield_isset(set,bit) int
r_bitfield *set; r_bitfield_isset (r_bitfield *set, int bit)
int bit;
{ {
int word=(bit-set->base)/32; int word=(bit-set->base)/32;
int bbit=(bit-set->base)%32; int bbit=(bit-set->base)%32;

View file

@ -48,10 +48,8 @@
#include <r_common.h> #include <r_common.h>
#include <r_data.h> #include <r_data.h>
int r_data_create(dp,d,l) int
Data **dp; r_data_create (Data **dp, UCHAR *d, int l)
UCHAR *d;
int l;
{ {
Data *d_=0; Data *d_=0;
int _status; int _status;
@ -74,9 +72,8 @@ int r_data_create(dp,d,l)
return(_status); return(_status);
} }
int r_data_alloc(dp,l) int
Data **dp; r_data_alloc (Data **dp, int l)
int l;
{ {
Data *d_=0; Data *d_=0;
int _status; int _status;
@ -97,10 +94,8 @@ int r_data_alloc(dp,l)
return(_status); return(_status);
} }
int r_data_make(dp,d,l) int
Data *dp; r_data_make (Data *dp, UCHAR *d, int l)
UCHAR *d;
int l;
{ {
if(!(dp->data=(UCHAR *)malloc(l))) if(!(dp->data=(UCHAR *)malloc(l)))
ERETURN(R_NO_MEMORY); ERETURN(R_NO_MEMORY);
@ -111,8 +106,8 @@ int r_data_make(dp,d,l)
return(0); return(0);
} }
int r_data_destroy(dp) int
Data **dp; r_data_destroy (Data **dp)
{ {
if(!dp || !*dp) if(!dp || !*dp)
return(0); return(0);
@ -126,9 +121,8 @@ int r_data_destroy(dp)
return(0); return(0);
} }
int r_data_copy(dst,src) int
Data *dst; r_data_copy (Data *dst, Data *src)
Data *src;
{ {
if(!(dst->data=(UCHAR *)malloc(src->len))) if(!(dst->data=(UCHAR *)malloc(src->len)))
ERETURN(R_NO_MEMORY); ERETURN(R_NO_MEMORY);
@ -136,8 +130,8 @@ int r_data_copy(dst,src)
return(0); return(0);
} }
int r_data_zfree(d) int
Data *d; r_data_zfree (Data *d)
{ {
if(!d) if(!d)
return(0); return(0);
@ -148,9 +142,8 @@ int r_data_zfree(d)
return(0); return(0);
} }
int r_data_compare(d1,d2) int
Data *d1; r_data_compare (Data *d1, Data *d2)
Data *d2;
{ {
if(d1->len<d2->len) if(d1->len<d2->len)
return(-1); return(-1);

View file

@ -61,8 +61,8 @@ struct r_list_ {
struct r_list_el_ *last; struct r_list_el_ *last;
}; };
int r_list_create(listp) int
r_list **listp; r_list_create (r_list **listp)
{ {
r_list *list=0; r_list *list=0;
int _status; int _status;
@ -79,8 +79,8 @@ int r_list_create(listp)
return(_status); return(_status);
} }
int r_list_destroy(listp) int
r_list **listp; r_list_destroy (r_list **listp)
{ {
r_list *list; r_list *list;
r_list_el *el; r_list_el *el;
@ -107,9 +107,8 @@ int r_list_destroy(listp)
return(0); return(0);
} }
int r_list_copy(outp,in) int
r_list**outp; r_list_copy (r_list **outp, r_list *in)
r_list *in;
{ {
r_list *out=0; r_list *out=0;
r_list_el *el,*el2,*last=0; r_list_el *el,*el2,*last=0;
@ -204,9 +203,8 @@ int r_list_append(list,value,copy,destroy)
return(_status); return(_status);
} }
int r_list_init_iter(list,iter) int
r_list *list; r_list_init_iter (r_list *list, r_list_iterator *iter)
r_list_iterator *iter;
{ {
iter->list=list; iter->list=list;
iter->ptr=list->first; iter->ptr=list->first;
@ -214,9 +212,8 @@ int r_list_init_iter(list,iter)
return(0); return(0);
} }
int r_list_iter(iter,val) int
r_list_iterator *iter; r_list_iter (r_list_iterator *iter, void **val)
void **val;
{ {
if(!iter->ptr) if(!iter->ptr)
return(R_EOD); return(R_EOD);

View file

@ -49,8 +49,8 @@
#ifndef HAVE_STRDUP #ifndef HAVE_STRDUP
char *strdup(str) char *
char *str; strdup (char *str)
{ {
int len=strlen(str); int len=strlen(str);
char *n; char *n;

View file

@ -84,10 +84,8 @@ int gettimeofday(struct timeval *tv, struct timezone *tzp)
} }
#endif #endif
/*Note that t1 must be > t0 */ /*Note that t1 must be > t0 */
int r_timeval_diff(t1,t0,diff) int
struct timeval *t1; r_timeval_diff (struct timeval *t1, struct timeval *t0, struct timeval *diff)
struct timeval *t0;
struct timeval *diff;
{ {
long d; long d;
@ -111,10 +109,8 @@ int r_timeval_diff(t1,t0,diff)
return(0); return(0);
} }
int r_timeval_add(t1,t2,sum) int
struct timeval *t1; r_timeval_add (struct timeval *t1, struct timeval *t2, struct timeval *sum)
struct timeval *t2;
struct timeval *sum;
{ {
long tv_sec,tv_usec,d; long tv_sec,tv_usec,d;
@ -135,8 +131,8 @@ int r_timeval_add(t1,t2,sum)
return(0); return(0);
} }
UINT8 r_timeval2int(tv) UINT8
struct timeval *tv; r_timeval2int (struct timeval *tv)
{ {
UINT8 r=0; UINT8 r=0;
@ -147,7 +143,8 @@ UINT8 r_timeval2int(tv)
return r; return r;
} }
UINT8 r_gettimeint() UINT8
r_gettimeint (void)
{ {
struct timeval tv; struct timeval tv;

View file

@ -23,8 +23,8 @@ typedef struct {
static void *r_thread_real_create PROTO_LIST((void *arg)); static void *r_thread_real_create PROTO_LIST((void *arg));
static void *r_thread_real_create(arg) static void *
void *arg; r_thread_real_create (void *arg)
{ {
helper *h; helper *h;
@ -61,19 +61,22 @@ int r_thread_fork(func,arg,id)
return(_status); return(_status);
} }
int r_thread_yield() int
r_thread_yield (void)
{ {
pthread_yield(); pthread_yield();
} }
int r_thread_exit() int
r_thread_exit (void)
{ {
thread_count--; thread_count--;
pthread_exit(0); pthread_exit(0);
return(0); return(0);
} }
int r_thread_wait_last() int
r_thread_wait_last (void)
{ {
do { do {
pthread_yield(); pthread_yield();
@ -84,8 +87,8 @@ int r_thread_wait_last()
return(0); return(0);
} }
int r_rwlock_create(lockp) int
r_rwlock **lockp; r_rwlock_create (r_rwlock **lockp)
{ {
pthread_rwlock_t *lock; pthread_rwlock_t *lock;
int r; int r;
@ -100,8 +103,8 @@ int r_rwlock_create(lockp)
return(0); return(0);
} }
int r_rwlock_destroy(lock) int
r_rwlock **lock; r_rwlock_destroy (r_rwlock **lock)
{ {
pthread_rwlock_t *plock; pthread_rwlock_t *plock;
@ -115,9 +118,8 @@ int r_rwlock_destroy(lock)
return(0); return(0);
} }
int r_rwlock_lock(lock,action) int
r_rwlock *lock; r_rwlock_lock (r_rwlock *lock, int action)
int action;
{ {
pthread_rwlock_t *plock; pthread_rwlock_t *plock;
int r,_status; int r,_status;

View file

@ -77,8 +77,8 @@ static int create_null_analyzer(void *handle, proto_ctx *ctx, tcp_conn *conn,
return(0); return(0);
} }
int destroy_null_analyzer(objp) int
proto_obj **objp; destroy_null_analyzer (proto_obj **objp)
{ {
null_analyzer *obj; null_analyzer *obj;
@ -94,10 +94,8 @@ int destroy_null_analyzer(objp)
return(0); return(0);
} }
int data_null_analyzer(_obj,seg,direction) int
proto_obj *_obj; data_null_analyzer (proto_obj *_obj, segment *seg, int direction)
segment *seg;
int direction;
{ {
#ifdef DEBUG #ifdef DEBUG
null_analyzer *obj=(null_analyzer *)_obj; null_analyzer *obj=(null_analyzer *)_obj;
@ -124,10 +122,8 @@ int data_null_analyzer(_obj,seg,direction)
return(0); return(0);
} }
int fin_null_analyzer(_obj,p,direction) int
proto_obj *_obj; fin_null_analyzer (proto_obj *_obj, packet *p, int direction)
packet *p;
int direction;
{ {
#ifdef DEBUG #ifdef DEBUG
null_analyzer *obj=(null_analyzer *)_obj; null_analyzer *obj=(null_analyzer *)_obj;

View file

@ -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_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 uint8_t content_pcap_dst_ether[ETHER_ADDR_LEN] = {0x02, 0x00, 0x00, 0x22, 0x22, 0x22};
static int init_pcap_logger(data) static int
void *data; init_pcap_logger (void *data)
{ {
char *pcap_outfile = (char *) data; char *pcap_outfile = (char *) data;
pcap_fd = open(pcap_outfile, O_RDWR|O_CREAT, DFLT_FILEMODE); pcap_fd = open(pcap_outfile, O_RDWR|O_CREAT, DFLT_FILEMODE);
@ -47,7 +47,8 @@ static int init_pcap_logger(data)
return 0; return 0;
} }
static int deinit_pcap_logger() static int
deinit_pcap_logger (void)
{ {
fdatasync(pcap_fd); fdatasync(pcap_fd);
close(pcap_fd); close(pcap_fd);
@ -85,8 +86,8 @@ static int create_pcap_logger(proto_obj **objp, struct sockaddr_storage *i_addr,
return(_status); return(_status);
} }
static int destroy_pcap_logger(objp) static int
proto_obj **objp; destroy_pcap_logger (proto_obj **objp)
{ {
logpkt_ctx_t *pcap_obj; logpkt_ctx_t *pcap_obj;
@ -101,11 +102,8 @@ static int destroy_pcap_logger(objp)
return(0); return(0);
} }
static int data_pcap_logger(_obj,data,len,dir) static int
proto_obj *_obj; data_pcap_logger (proto_obj *_obj, unsigned char *data, unsigned int len, int dir)
unsigned char *data;
unsigned int len;
int dir;
{ {
logpkt_ctx_t *pcap_obj = (logpkt_ctx_t *)_obj; logpkt_ctx_t *pcap_obj = (logpkt_ctx_t *)_obj;
int direction; int direction;
@ -119,11 +117,8 @@ static int data_pcap_logger(_obj,data,len,dir)
return status; return status;
} }
int close_pcap_logger(_obj,data,len,dir) int
proto_obj *_obj; close_pcap_logger (proto_obj *_obj, unsigned char *data, unsigned int len, int dir)
unsigned char *data;
unsigned int len;
int dir;
{ {
logpkt_ctx_t *pcap_obj = (logpkt_ctx_t *)_obj; logpkt_ctx_t *pcap_obj = (logpkt_ctx_t *)_obj;
int direction; int direction;

View file

@ -1024,7 +1024,8 @@ ECHO;
* EOB_ACT_END_OF_FILE - end of file * 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 *dest = yy_current_buffer->yy_ch_buf;
register char *source = yytext_ptr; 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 */ /* 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 yy_state_type yy_current_state;
register char *yy_cp; register char *yy_cp;
@ -1636,7 +1638,8 @@ int new_state;
#ifndef YY_NO_POP_STATE #ifndef YY_NO_POP_STATE
static void yy_pop_state() static void
yy_pop_state (void)
{ {
if ( --yy_start_stack_ptr < 0 ) if ( --yy_start_stack_ptr < 0 )
YY_FATAL_ERROR( "start-condition stack underflow" ); YY_FATAL_ERROR( "start-condition stack underflow" );
@ -1647,7 +1650,8 @@ static void yy_pop_state()
#ifndef YY_NO_TOP_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]; return yy_start_stack[yy_start_stack_ptr - 1];
} }
@ -1760,7 +1764,8 @@ void *ptr;
} }
#if YY_MAIN #if YY_MAIN
int main() int
main (void)
{ {
yylex(); yylex();
return 0; return 0;
@ -1768,7 +1773,8 @@ int main()
#endif #endif
#line 60 "ssl.l" #line 60 "ssl.l"
int mkname() int
mkname (void)
{ {
#if 0 #if 0
printf("%s\n",yytext); printf("%s\n",yytext);

View file

@ -62,9 +62,8 @@ int verr_exit(char *fmt,...)
} }
int main(argc,argv) int
int argc; main (int argc, char **argv)
char **argv;
{ {
char name[100]; char name[100];
FILE *in; FILE *in;
@ -86,12 +85,13 @@ int main(argc,argv)
extern int yylineno; extern int yylineno;
int yywrap() int
yywrap (void)
{ {
;} ;}
int yyerror(s) int
char *s; yyerror (char *s)
{ {
printf("Parse error %s at line %d\n",s,yylineno); printf("Parse error %s at line %d\n",s,yylineno);
exit(1); exit(1);

View file

@ -1,27 +1,18 @@
#include "network.h" #include "network.h"
#include "ssl.h" #include "ssl.h"
#include "sslprint.h" #include "sslprint.h"
static int decode_ContentType_change_cipher_spec(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_ContentType_change_cipher_spec (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
return(0); return(0);
} }
static int decode_ContentType_alert(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_ContentType_alert (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
return(0); return(0);
} }
static int decode_ContentType_handshake(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_ContentType_handshake (ssl_obj *ssl, int dir, segment *seg, Data *data)
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); ssl_decode_switch(ssl,HandshakeType_decoder,t,dir,seg,data);
} }
static int decode_ContentType_application_data(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_ContentType_application_data (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
return(0); return(0);
} }
@ -73,19 +61,13 @@ decoder ContentType_decoder[]={
{-1} {-1}
}; };
static int decode_HandshakeType_hello_request(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_HandshakeType_hello_request (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
return(0); return(0);
} }
static int decode_HandshakeType_client_hello(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_HandshakeType_client_hello (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
@ -128,11 +110,8 @@ static int decode_HandshakeType_client_hello(ssl,dir,seg,data)
return(0); return(0);
} }
static int decode_HandshakeType_server_hello(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_HandshakeType_server_hello (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
@ -153,59 +132,38 @@ static int decode_HandshakeType_server_hello(ssl,dir,seg,data)
return(0); return(0);
} }
static int decode_HandshakeType_certificate(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_HandshakeType_certificate (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
return(0); return(0);
} }
static int decode_HandshakeType_server_key_exchange(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_HandshakeType_server_key_exchange (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
return(0); return(0);
} }
static int decode_HandshakeType_certificate_request(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_HandshakeType_certificate_request (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
return(0); return(0);
} }
static int decode_HandshakeType_server_hello_done(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_HandshakeType_server_hello_done (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
return(0); return(0);
} }
static int decode_HandshakeType_certificate_verify(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_HandshakeType_certificate_verify (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
return(0); return(0);
} }
static int decode_HandshakeType_client_key_exchange(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_HandshakeType_client_key_exchange (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
return(0); return(0);
} }
static int decode_HandshakeType_finished(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_HandshakeType_finished (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
return(0); return(0);
} }

View file

@ -233,9 +233,8 @@ static SSL_CipherSuite CipherSuites[]={
{-1} {-1}
}; };
int ssl_find_cipher(num,cs) int
int num; ssl_find_cipher (int num, SSL_CipherSuite **cs)
SSL_CipherSuite **cs;
{ {
SSL_CipherSuite *c; SSL_CipherSuite *c;

View file

@ -10,11 +10,8 @@
#include "ssl.enums.h" #include "ssl.enums.h"
static int decode_extension(ssl_obj *ssl, int dir, segment *seg, Data *data); 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_server_name(ssl_obj *ssl, int dir, segment *seg, Data *data);
static int decode_ContentType_ChangeCipherSpec(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_ContentType_ChangeCipherSpec (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
struct json_object *jobj; struct json_object *jobj;
@ -35,11 +32,8 @@ static int decode_ContentType_ChangeCipherSpec(ssl,dir,seg,data)
return(0); return(0);
} }
static int decode_ContentType_Alert(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_ContentType_Alert (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
int r; int r;
@ -74,11 +68,8 @@ static int decode_ContentType_Alert(ssl,dir,seg,data)
return(0); return(0);
} }
static int decode_ContentType_Handshake(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_ContentType_Handshake (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
@ -122,11 +113,8 @@ static int decode_ContentType_Handshake(ssl,dir,seg,data)
return(0); return(0);
} }
static int decode_ContentType_application_data(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_ContentType_application_data (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
@ -172,11 +160,8 @@ decoder ContentType_decoder[]={
{-1} {-1}
}; };
static int decode_HandshakeType_HelloRequest(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_HandshakeType_HelloRequest (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
struct json_object *jobj; struct json_object *jobj;
jobj = ssl->cur_json_st; jobj = ssl->cur_json_st;
@ -187,11 +172,8 @@ static int decode_HandshakeType_HelloRequest(ssl,dir,seg,data)
return(0); return(0);
} }
static int decode_HandshakeType_ClientHello(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_HandshakeType_ClientHello (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
struct json_object *jobj; struct json_object *jobj;
jobj = ssl->cur_json_st; jobj = ssl->cur_json_st;
@ -375,11 +357,8 @@ static int decode_HandshakeType_ClientHello(ssl,dir,seg,data)
return(0); return(0);
} }
static int decode_HandshakeType_ServerHello(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_HandshakeType_ServerHello (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
int r; int r;
@ -520,11 +499,8 @@ static int decode_HandshakeType_ServerHello(ssl,dir,seg,data)
return(0); return(0);
} }
static int decode_HandshakeType_Certificate(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_HandshakeType_Certificate (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
UINT4 len,exlen,ex; UINT4 len,exlen,ex;
Data cert; Data cert;
@ -569,11 +545,8 @@ static int decode_HandshakeType_Certificate(ssl,dir,seg,data)
} }
static int decode_HandshakeType_SessionTicket(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_HandshakeType_SessionTicket (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
int r; int r;
UINT4 exlen, ex, val; 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) static int
ssl_obj *ssl; decode_HandshakeType_EncryptedExtensions (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
int r; int r;
UINT4 exlen, ex; 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) static int
ssl_obj *ssl; decode_HandshakeType_ServerKeyExchange (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
@ -666,11 +633,8 @@ static int decode_HandshakeType_ServerKeyExchange(ssl,dir,seg,data)
return(0); return(0);
} }
static int decode_HandshakeType_CertificateRequest(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_HandshakeType_CertificateRequest (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
@ -706,11 +670,8 @@ static int decode_HandshakeType_CertificateRequest(ssl,dir,seg,data)
return(0); return(0);
} }
static int decode_HandshakeType_ServerHelloDone(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_HandshakeType_ServerHelloDone (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
struct json_object *jobj; struct json_object *jobj;
@ -722,11 +683,8 @@ static int decode_HandshakeType_ServerHelloDone(ssl,dir,seg,data)
return(0); return(0);
} }
static int decode_HandshakeType_CertificateVerify(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_HandshakeType_CertificateVerify (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
@ -746,11 +704,8 @@ static int decode_HandshakeType_CertificateVerify(ssl,dir,seg,data)
return(0); return(0);
} }
static int decode_HandshakeType_ClientKeyExchange(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_HandshakeType_ClientKeyExchange (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
@ -789,11 +744,8 @@ static int decode_HandshakeType_ClientKeyExchange(ssl,dir,seg,data)
return(0); return(0);
} }
static int decode_HandshakeType_Finished(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_HandshakeType_Finished (ssl_obj *ssl, int dir, segment *seg, Data *data)
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) static int
ssl_obj *ssl; decode_HandshakeType_KeyUpdate (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
LF; LF;
ssl_tls13_update_keying_material(ssl, ssl->decoder, dir); ssl_tls13_update_keying_material(ssl, ssl->decoder, dir);
@ -2463,22 +2412,16 @@ decoder cipher_suite_decoder[]={
{-1} {-1}
}; };
static int decode_AlertLevel_warning(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_AlertLevel_warning (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
struct json_object *jobj; struct json_object *jobj;
jobj = ssl->cur_json_st; jobj = ssl->cur_json_st;
json_object_object_add(jobj, "alert_level", json_object_new_string("warning")); json_object_object_add(jobj, "alert_level", json_object_new_string("warning"));
return(0); return(0);
} }
static int decode_AlertLevel_fatal(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_AlertLevel_fatal (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
struct json_object *jobj; struct json_object *jobj;
jobj = ssl->cur_json_st; jobj = ssl->cur_json_st;
@ -2499,187 +2442,118 @@ decoder AlertLevel_decoder[]={
{-1} {-1}
}; };
static int decode_AlertDescription_close_notify(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_AlertDescription_close_notify (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
return(0); return(0);
} }
static int decode_AlertDescription_unexpected_message(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_AlertDescription_unexpected_message (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
return(0); return(0);
} }
static int decode_AlertDescription_bad_record_mac(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_AlertDescription_bad_record_mac (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
return(0); return(0);
} }
static int decode_AlertDescription_decryption_failed(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_AlertDescription_decryption_failed (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
return(0); return(0);
} }
static int decode_AlertDescription_record_overflow(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_AlertDescription_record_overflow (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
return(0); return(0);
} }
static int decode_AlertDescription_decompression_failure(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_AlertDescription_decompression_failure (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
return(0); return(0);
} }
static int decode_AlertDescription_handshake_failure(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_AlertDescription_handshake_failure (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
return(0); return(0);
} }
static int decode_AlertDescription_bad_certificate(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_AlertDescription_bad_certificate (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
return(0); return(0);
} }
static int decode_AlertDescription_unsupported_certificate(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_AlertDescription_unsupported_certificate (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
return(0); return(0);
} }
static int decode_AlertDescription_certificate_revoked(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_AlertDescription_certificate_revoked (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
return(0); return(0);
} }
static int decode_AlertDescription_certificate_expired(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_AlertDescription_certificate_expired (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
return(0); return(0);
} }
static int decode_AlertDescription_certificate_unknown(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_AlertDescription_certificate_unknown (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
return(0); return(0);
} }
static int decode_AlertDescription_illegal_parameter(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_AlertDescription_illegal_parameter (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
return(0); return(0);
} }
static int decode_AlertDescription_unknown_ca(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_AlertDescription_unknown_ca (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
return(0); return(0);
} }
static int decode_AlertDescription_access_denied(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_AlertDescription_access_denied (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
return(0); return(0);
} }
static int decode_AlertDescription_decode_error(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_AlertDescription_decode_error (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
return(0); return(0);
} }
static int decode_AlertDescription_decrypt_error(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_AlertDescription_decrypt_error (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
return(0); return(0);
} }
static int decode_AlertDescription_export_restriction(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_AlertDescription_export_restriction (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
return(0); return(0);
} }
static int decode_AlertDescription_protocol_version(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_AlertDescription_protocol_version (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
return(0); return(0);
} }
static int decode_AlertDescription_insufficient_security(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_AlertDescription_insufficient_security (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
return(0); return(0);
} }
static int decode_AlertDescription_internal_error(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_AlertDescription_internal_error (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
return(0); return(0);
} }
static int decode_AlertDescription_user_canceled(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_AlertDescription_user_canceled (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
return(0); return(0);
} }
static int decode_AlertDescription_no_renegotiation(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_AlertDescription_no_renegotiation (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
return(0); return(0);
} }
@ -2810,35 +2684,23 @@ decoder compression_method_decoder[]={
{-1} {-1}
}; };
static int decode_client_certificate_type_rsa_sign(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_client_certificate_type_rsa_sign (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
return(0); return(0);
} }
static int decode_client_certificate_type_dss_sign(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_client_certificate_type_dss_sign (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
return(0); return(0);
} }
static int decode_client_certificate_type_rsa_fixed_dh(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_client_certificate_type_rsa_fixed_dh (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
return(0); return(0);
} }
static int decode_client_certificate_type_dss_fixed_dh(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_client_certificate_type_dss_fixed_dh (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
return(0); return(0);
} }
@ -2866,11 +2728,8 @@ decoder client_certificate_type_decoder[]={
{-1} {-1}
}; };
static int decode_extension_server_name(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_extension_server_name (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
UINT4 t,l; UINT4 t,l;
int r,p; int r,p;
@ -2902,11 +2761,8 @@ static int decode_extension_server_name(ssl,dir,seg,data)
} }
return(0); return(0);
} }
static int decode_extension_encrypt_then_mac(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_extension_encrypt_then_mac (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
int r,*etm; int r,*etm;
UINT4 l; UINT4 l;
@ -2920,11 +2776,8 @@ static int decode_extension_encrypt_then_mac(ssl,dir,seg,data)
dir==DIR_I2R?*etm=1:++*etm; dir==DIR_I2R?*etm=1:++*etm;
return(0); return(0);
} }
static int decode_extension_extended_master_secret(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_extension_extended_master_secret (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
int r,*ems; int r,*ems;
UINT4 l; UINT4 l;
@ -2938,11 +2791,8 @@ static int decode_extension_extended_master_secret(ssl,dir,seg,data)
dir==DIR_I2R?*ems=1:++*ems; dir==DIR_I2R?*ems=1:++*ems;
return(0); return(0);
} }
static int decode_extension(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_extension (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
int r; int r;
UINT4 l; UINT4 l;
@ -2965,11 +2815,8 @@ decoder supported_groups_decoder[] = {
{0x0104,"ffdhe8192",0}, {0x0104,"ffdhe8192",0},
}; };
// Extension #10 supported_groups (renamed from "elliptic_curves") // Extension #10 supported_groups (renamed from "elliptic_curves")
static int decode_extension_supported_groups(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_extension_supported_groups (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
int r,p; int r,p;
UINT4 l,g; UINT4 l,g;
@ -3007,11 +2854,8 @@ decoder ec_point_formats_decoder[] = {
{2,"ansiX962_compressed_char2",0,} {2,"ansiX962_compressed_char2",0,}
}; };
// Extension #11 ec_point_formats // Extension #11 ec_point_formats
static int decode_extension_ec_point_formats(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_extension_ec_point_formats (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
int r,p; int r,p;
UINT4 l,f; UINT4 l,f;
@ -3044,11 +2888,8 @@ static int decode_extension_ec_point_formats(ssl,dir,seg,data)
return(0); return(0);
} }
static int decode_extension_supported_versions(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_extension_supported_versions (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
int r; int r;
UINT4 len, version; UINT4 len, version;
@ -3070,11 +2911,8 @@ decoder tls13_certificate_types[] = {
{2,"raw public key",0}, {2,"raw public key",0},
{3,"1609 dot 2",0} {3,"1609 dot 2",0}
}; };
static int decode_extension_client_certificate_type(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_extension_client_certificate_type (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
int r; int r;
UINT4 len, certificate_type; 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 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) static int
ssl_obj *ssl; decode_extension_server_certificate_type (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
int r; int r;
UINT4 len, certificate_type; UINT4 len, certificate_type;
@ -3394,11 +3229,8 @@ decoder extension_decoder[] = {
{-1} {-1}
}; };
static int decode_server_name_type_host_name(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_server_name_type_host_name (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
int r; int r;
UINT4 l; UINT4 l;
@ -3424,11 +3256,8 @@ static int decode_server_name_type_host_name(ssl,dir,seg,data)
data->data+=l; data->data+=l;
return(0); return(0);
} }
static int decode_server_name(ssl,dir,seg,data) static int
ssl_obj *ssl; decode_server_name (ssl_obj *ssl, int dir, segment *seg, Data *data)
int dir;
segment *seg;
Data *data;
{ {
int r; int r;
UINT4 l; UINT4 l;

View file

@ -162,8 +162,8 @@ flag_struct flags[]={
{0} {0}
}; };
int parse_ssl_flag(flag) int
int flag; parse_ssl_flag (int flag)
{ {
flag_struct *fl; flag_struct *fl;
@ -181,8 +181,8 @@ int parse_ssl_flag(flag)
return(0); return(0);
} }
static int parse_ssl_flags(str) static int
char *str; parse_ssl_flags (char *str)
{ {
char *x,*y; char *x,*y;
flag_struct *fl; flag_struct *fl;
@ -214,9 +214,8 @@ static int parse_ssl_flags(str)
return(0); return(0);
} }
static int create_ssl_ctx(handle,ctxp) static int
void *handle; create_ssl_ctx (void *handle, proto_ctx **ctxp)
proto_ctx **ctxp;
{ {
ssl_decode_ctx *ctx=0; ssl_decode_ctx *ctx=0;
int r,_status; int r,_status;
@ -230,9 +229,8 @@ static int create_ssl_ctx(handle,ctxp)
return(_status); return(_status);
} }
static int destroy_ssl_ctx(handle,ctxp) static int
void *handle; destroy_ssl_ctx (void *handle, proto_ctx **ctxp)
proto_ctx **ctxp;
{ {
ssl_decode_ctx *ctx=0; ssl_decode_ctx *ctx=0;
ctx=(ssl_decode_ctx *) *ctxp; ctx=(ssl_decode_ctx *) *ctxp;
@ -292,8 +290,8 @@ static int create_ssl_analyzer(void *handle, proto_ctx *ctx, tcp_conn *conn,
return(_status); return(_status);
} }
static int destroy_ssl_analyzer(objp) static int
proto_obj **objp; destroy_ssl_analyzer (proto_obj **objp)
{ {
ssl_obj *obj; ssl_obj *obj;
@ -321,8 +319,8 @@ static int destroy_ssl_analyzer(objp)
} }
static int free_r_queue(q) static int
r_queue *q; free_r_queue (r_queue *q)
{ {
FREE(q->data); FREE(q->data);
if(q->q) free_tcp_segment_queue(q->q); if(q->q) free_tcp_segment_queue(q->q);
@ -330,8 +328,8 @@ static int free_r_queue(q)
return(0); return(0);
} }
static int create_r_queue(qp) static int
r_queue **qp; create_r_queue (r_queue **qp)
{ {
r_queue *q=0; r_queue *q=0;
int _status; int _status;
@ -355,13 +353,8 @@ static int create_r_queue(qp)
return(_status); return(_status);
} }
static int read_ssl_record(obj,q,seg,offset,lastp,offsetp) static int
ssl_obj *obj; read_ssl_record (ssl_obj *obj, r_queue *q, segment *seg, int offset, segment **lastp, int *offsetp)
r_queue *q;
segment *seg;
int offset;
segment **lastp;
int *offsetp;
{ {
segment *last=seg; 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) static int
r_queue *q; read_data (r_queue *q, segment *seg, int offset, segment **lastp, int *offsetp)
segment *seg;
int offset;
segment **lastp;
int *offsetp;
{ {
int tocpy=0,r,_status; int tocpy=0,r,_status;
#ifdef DEBUG #ifdef DEBUG
@ -477,10 +466,8 @@ static int read_data(q,seg,offset,lastp,offsetp)
return(_status); return(_status);
} }
static int data_ssl_analyzer(_obj,seg,direction) static int
proto_obj *_obj; data_ssl_analyzer (proto_obj *_obj, segment *seg, int direction)
segment *seg;
int direction;
{ {
int _status,r; int _status,r;
r_queue *q; r_queue *q;
@ -555,12 +542,8 @@ static int data_ssl_analyzer(_obj,seg,direction)
return(_status); return(_status);
} }
static int print_ssl_header(obj,direction,q,data,len) static int
ssl_obj *obj; print_ssl_header (ssl_obj *obj, int direction, segment *q, UCHAR *data, int len)
int direction;
segment *q;
UCHAR *data;
int len;
{ {
int ct=0; int ct=0;
segment *s; segment *s;
@ -583,12 +566,8 @@ static int print_ssl_header(obj,direction,q,data,len)
return(0); return(0);
} }
static int print_ssl_record(obj,direction,q,data,len) static int
ssl_obj *obj; print_ssl_record (ssl_obj *obj, int direction, segment *q, UCHAR *data, int len)
int direction;
segment *q;
UCHAR *data;
int len;
{ {
int r; int r;
@ -614,10 +593,8 @@ static int print_ssl_record(obj,direction,q,data,len)
return(0); return(0);
} }
int close_ssl_analyzer(_obj,p,dir) int
proto_obj *_obj; close_ssl_analyzer (proto_obj *_obj, packet *p, int dir)
packet *p;
int dir;
{ {
ssl_obj *ssl=(ssl_obj *)_obj; ssl_obj *ssl=(ssl_obj *)_obj;
char *what; char *what;

View file

@ -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)); int ver,UCHAR *data,UINT4 datalen,UCHAR *iv,UINT4 ivlen,UCHAR *mac));
static int fmt_seq PROTO_LIST((UINT4 num,UCHAR *buf)); static int fmt_seq PROTO_LIST((UINT4 num,UCHAR *buf));
int ssl_create_rec_decoder(dp,ssl,mk,sk,iv) int
ssl_rec_decoder **dp; ssl_create_rec_decoder (ssl_rec_decoder **dp, ssl_obj *ssl, UCHAR *mk, UCHAR *sk, UCHAR *iv)
ssl_obj *ssl;
UCHAR *mk;
UCHAR *sk;
UCHAR *iv;
{ {
int r,_status; int r,_status;
ssl_rec_decoder *dec=0; ssl_rec_decoder *dec=0;
@ -168,8 +164,8 @@ int ssl_create_rec_decoder(dp,ssl,mk,sk,iv)
return(_status); return(_status);
} }
int ssl_destroy_rec_decoder(dp) int
ssl_rec_decoder **dp; ssl_destroy_rec_decoder (ssl_rec_decoder **dp)
{ {
ssl_rec_decoder *d; ssl_rec_decoder *d;
@ -195,25 +191,16 @@ int ssl_destroy_rec_decoder(dp)
#define MSB(a) ((a>>8)&0xff) #define MSB(a) ((a>>8)&0xff)
#define LSB(a) (a&0xff) #define LSB(a) (a&0xff)
int tls13_update_rec_key(d,newkey,newiv) int
ssl_rec_decoder *d; tls13_update_rec_key (ssl_rec_decoder *d, UCHAR *newkey, UCHAR *newiv)
UCHAR *newkey;
UCHAR *newiv;
{ {
d->write_key->data = newkey; d->write_key->data = newkey;
d->implicit_iv->data = newiv; d->implicit_iv->data = newiv;
d->seq = 0; d->seq = 0;
} }
int tls13_decode_rec_data(ssl,d,ct,version,in,inl,out,outl) int
ssl_obj *ssl; tls13_decode_rec_data (ssl_obj *ssl, ssl_rec_decoder *d, int ct, int version, UCHAR *in, int inl, UCHAR *out, int *outl)
ssl_rec_decoder *d;
int ct;
int version;
UCHAR *in;
int inl;
UCHAR *out;
int *outl;
{ {
int pad,i; int pad,i;
int r,encpadl,x,_status=0; int r,encpadl,x,_status=0;
@ -284,15 +271,8 @@ abort:
return _status; return _status;
} }
int ssl_decode_rec_data(ssl,d,ct,version,in,inl,out,outl) int
ssl_obj *ssl; ssl_decode_rec_data (ssl_obj *ssl, ssl_rec_decoder *d, int ct, int version, UCHAR *in, int inl, UCHAR *out, int *outl)
ssl_rec_decoder *d;
int ct;
int version;
UCHAR *in;
int inl;
UCHAR *out;
int *outl;
{ {
#ifdef OPENSSL #ifdef OPENSSL
int pad; 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 /* This should go to 2^128, but we're never really going to see
more than 2^64, so we cheat*/ more than 2^64, so we cheat*/
static int fmt_seq(num,buf) static int
UINT4 num; fmt_seq (UINT4 num, UCHAR *buf)
UCHAR *buf;
{ {
UINT4 netnum; UINT4 netnum;
@ -439,15 +418,8 @@ static int fmt_seq(num,buf)
return(0); return(0);
} }
static int tls_check_mac(d,ct,ver,data,datalen,iv,ivlen,mac) static int
ssl_rec_decoder *d; tls_check_mac (ssl_rec_decoder *d, int ct, int ver, UCHAR *data, UINT4 datalen, UCHAR *iv, UINT4 ivlen, UCHAR *mac)
int ct;
int ver;
UCHAR *data;
UINT4 datalen;
UCHAR *iv;
UINT4 ivlen;
UCHAR *mac;
{ {
HMAC_CTX *hm = HMAC_CTX_new(); HMAC_CTX *hm = HMAC_CTX_new();
if(!hm) if(!hm)
@ -489,13 +461,8 @@ static int tls_check_mac(d,ct,ver,data,datalen,iv,ivlen,mac)
return(0); return(0);
} }
int ssl3_check_mac(d,ct,ver,data,datalen,mac) int
ssl_rec_decoder *d; ssl3_check_mac (ssl_rec_decoder *d, int ct, int ver, UCHAR *data, UINT4 datalen, UCHAR *mac)
int ct;
int ver;
UCHAR *data;
UINT4 datalen;
UCHAR *mac;
{ {
EVP_MD_CTX *mc = EVP_MD_CTX_new(); EVP_MD_CTX *mc = EVP_MD_CTX_new();
const EVP_MD *md; const EVP_MD *md;

View file

@ -139,11 +139,8 @@ static int password_cb(char *buf,int num,int rwflag,void *userdata)
return(strlen(ssl_password)); return(strlen(ssl_password));
} }
int ssl_decode_ctx_create(dp,keyfile,pass,keylogfile) int
ssl_decode_ctx **dp; ssl_decode_ctx_create (ssl_decode_ctx **dp, char *keyfile, char *pass, char *keylogfile)
char *keyfile;
char *pass;
char *keylogfile;
{ {
#ifdef OPENSSL #ifdef OPENSSL
ssl_decode_ctx *d=0; ssl_decode_ctx *d=0;
@ -197,8 +194,8 @@ int ssl_decode_ctx_create(dp,keyfile,pass,keylogfile)
#endif #endif
} }
int ssl_decode_ctx_destroy(dp) int
ssl_decode_ctx **dp; ssl_decode_ctx_destroy (ssl_decode_ctx **dp)
{ {
#ifdef OPENSSL #ifdef OPENSSL
ssl_decode_ctx *d = *dp; ssl_decode_ctx *d = *dp;
@ -217,9 +214,8 @@ int ssl_decode_ctx_destroy(dp)
return(0); return(0);
} }
int ssl_decoder_create(dp,ctx) int
ssl_decoder **dp; ssl_decoder_create (ssl_decoder **dp, ssl_decode_ctx *ctx)
ssl_decode_ctx *ctx;
{ {
int _status; int _status;
@ -241,8 +237,8 @@ int ssl_decoder_create(dp,ctx)
#endif #endif
} }
int ssl_decoder_destroy(dp) int
ssl_decoder **dp; ssl_decoder_destroy (ssl_decoder **dp)
{ {
#ifdef OPENSSL #ifdef OPENSSL
ssl_decoder *d; ssl_decoder *d;
@ -267,10 +263,8 @@ int ssl_decoder_destroy(dp)
return(0); return(0);
} }
int ssl_set_client_random(d,msg,len) int
ssl_decoder *d; ssl_set_client_random (ssl_decoder *d, UCHAR *msg, int len)
UCHAR *msg;
int len;
{ {
#ifdef OPENSSL #ifdef OPENSSL
int r; int r;
@ -282,10 +276,8 @@ int ssl_set_client_random(d,msg,len)
return(0); return(0);
} }
int ssl_set_server_random(d,msg,len) int
ssl_decoder *d; ssl_set_server_random (ssl_decoder *d, UCHAR *msg, int len)
UCHAR *msg;
int len;
{ {
#ifdef OPENSSL #ifdef OPENSSL
int r; int r;
@ -297,10 +289,8 @@ int ssl_set_server_random(d,msg,len)
return(0); return(0);
} }
int ssl_set_client_session_id(d,msg,len) int
ssl_decoder *d; ssl_set_client_session_id (ssl_decoder *d, UCHAR *msg, int len)
UCHAR *msg;
int len;
{ {
#ifdef OPENSSL #ifdef OPENSSL
int r; int r;
@ -314,11 +304,8 @@ int ssl_set_client_session_id(d,msg,len)
return(0); return(0);
} }
int ssl_process_server_session_id(ssl,d,msg,len) int
ssl_obj *ssl; ssl_process_server_session_id (ssl_obj *ssl, ssl_decoder *d, UCHAR *msg, int len)
ssl_decoder *d;
UCHAR *msg;
int len;
{ {
#ifdef OPENSSL #ifdef OPENSSL
int r,_status; int r,_status;
@ -359,11 +346,8 @@ int ssl_process_server_session_id(ssl,d,msg,len)
#endif #endif
} }
int ssl_process_client_session_id(ssl,d,msg,len) int
ssl_obj *ssl; ssl_process_client_session_id (ssl_obj *ssl, ssl_decoder *d, UCHAR *msg, int len)
ssl_decoder *d;
UCHAR *msg;
int len;
{ {
#ifdef OPENSSL #ifdef OPENSSL
int _status; 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) int
ssl_obj *ssl; ssl_process_change_cipher_spec (ssl_obj *ssl, ssl_decoder *d, int direction)
ssl_decoder *d;
int direction;
{ {
#ifdef OPENSSL #ifdef OPENSSL
if (ssl->version!=TLSV13_VERSION){ if (ssl->version!=TLSV13_VERSION){
@ -431,13 +413,8 @@ int ssl_process_change_cipher_spec(ssl,d,direction)
#endif #endif
return(0); return(0);
} }
int ssl_decode_record(ssl,dec,direction,ct,version,d) int
ssl_obj *ssl; ssl_decode_record (ssl_obj *ssl, ssl_decoder *dec, int direction, int ct, int version, Data *d)
ssl_decoder *dec;
int direction;
int ct;
int version;
Data *d;
{ {
ssl_rec_decoder *rd; ssl_rec_decoder *rd;
UCHAR *out; UCHAR *out;
@ -493,9 +470,8 @@ int ssl_decode_record(ssl,dec,direction,ct,version,d)
#endif #endif
} }
int ssl_update_handshake_messages(ssl,data) int
ssl_obj *ssl; ssl_update_handshake_messages (ssl_obj *ssl, Data *data)
Data *data;
{ {
#ifdef OPENSSL #ifdef OPENSSL
Data *hms; 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) static int
ssl_obj *ssl; ssl_create_session_lookup_key (ssl_obj *ssl, UCHAR *id, UINT4 idlen, UCHAR **keyp, UINT4 *keyl)
UCHAR *id;
UINT4 idlen;
UCHAR **keyp;
UINT4 *keyl;
{ {
UCHAR *key=0; UCHAR *key=0;
UINT4 l; 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 /* Look up the session id in the session cache and generate
the appropriate keying material */ the appropriate keying material */
int ssl_restore_session(ssl,d) int
ssl_obj *ssl; ssl_restore_session (ssl_obj *ssl, ssl_decoder *d)
ssl_decoder *d;
{ {
UCHAR *lookup_key=0; UCHAR *lookup_key=0;
void *msv; void *msv;
@ -599,9 +570,8 @@ int ssl_restore_session(ssl,d)
/* Look up the session id in the session cache and generate /* Look up the session id in the session cache and generate
the appropriate keying material */ the appropriate keying material */
int ssl_save_session(ssl,d) int
ssl_obj *ssl; ssl_save_session (ssl_obj *ssl, ssl_decoder *d)
ssl_decoder *d;
{ {
#ifdef OPENSSL #ifdef OPENSSL
UCHAR *lookup_key=0; UCHAR *lookup_key=0;
@ -634,11 +604,8 @@ int ssl_save_session(ssl,d)
/* This only works with RSA because the other cipher suites /* This only works with RSA because the other cipher suites
offer PFS. Yuck. */ offer PFS. Yuck. */
int ssl_process_client_key_exchange(ssl,d,msg,len) int
ssl_obj *ssl; ssl_process_client_key_exchange (ssl_obj *ssl, ssl_decoder *d, UCHAR *msg, int len)
ssl_decoder *d;
UCHAR *msg;
int len;
{ {
#ifdef OPENSSL #ifdef OPENSSL
int r,_status; 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) static int
ssl_obj *ssl; tls_prf (ssl_obj *ssl, Data *secret, char *usage, Data *rnd1, Data *rnd2, Data *out)
Data *secret;
char *usage;
Data *rnd1;
Data *rnd2;
Data *out;
{ {
int r,_status; int r,_status;
Data *md5_out=0,*sha_out=0; 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) static int
ssl_obj *ssl; tls12_prf (ssl_obj *ssl, Data *secret, char *usage, Data *rnd1, Data *rnd2, Data *out)
Data *secret;
char *usage;
Data *rnd1;
Data *rnd2;
Data *out;
{ {
const EVP_MD *md; 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) static int
ssl_obj *ssl; ssl3_generate_export_iv (ssl_obj *ssl, Data *r1, Data *r2, Data *out)
Data *r1;
Data *r2;
Data *out;
{ {
MD5_CTX md5; MD5_CTX md5;
UCHAR tmp[16]; UCHAR tmp[16];
@ -880,13 +834,8 @@ static int ssl3_generate_export_iv(ssl,r1,r2,out)
return(0); return(0);
} }
static int ssl3_prf(ssl,secret,usage,r1,r2,out) static int
ssl_obj *ssl; ssl3_prf (ssl_obj *ssl, Data *secret, char *usage, Data *r1, Data *r2, Data *out)
Data *secret;
char *usage;
Data *r1;
Data *r2;
Data *out;
{ {
MD5_CTX md5; MD5_CTX md5;
SHA_CTX sha; SHA_CTX sha;
@ -951,9 +900,8 @@ static int ssl3_prf(ssl,secret,usage,r1,r2,out)
return(0); return(0);
} }
static int ssl_generate_keying_material(ssl,d) static int
ssl_obj *ssl; ssl_generate_keying_material (ssl_obj *ssl, ssl_decoder *d)
ssl_decoder *d;
{ {
Data *key_block=0,temp; Data *key_block=0,temp;
UCHAR _iv_c[8],_iv_s[8]; UCHAR _iv_c[8],_iv_s[8];
@ -1189,10 +1137,8 @@ abort:
} }
// Will update the keys for the particular direction // Will update the keys for the particular direction
int ssl_tls13_update_keying_material(ssl,d,direction) int
ssl_obj *ssl; ssl_tls13_update_keying_material (ssl_obj *ssl, ssl_decoder *d, int direction)
ssl_decoder *d;
int direction;
{ {
Data *secret; Data *secret;
ssl_rec_decoder *decoder; ssl_rec_decoder *decoder;
@ -1216,9 +1162,8 @@ int ssl_tls13_update_keying_material(ssl,d,direction)
return 0; return 0;
} }
int ssl_tls13_generate_keying_material(ssl,d) int
ssl_obj* ssl; ssl_tls13_generate_keying_material (ssl_obj *ssl, ssl_decoder *d)
ssl_decoder *d;
{ {
int r,_status; int r,_status;
Data out; Data out;
@ -1287,9 +1232,8 @@ abort:
return r; return r;
} }
static int ssl_generate_session_hash(ssl,d) static int
ssl_obj *ssl; ssl_generate_session_hash (ssl_obj *ssl, ssl_decoder *d)
ssl_decoder *d;
{ {
int r,_status,dgi; int r,_status,dgi;
unsigned int len; unsigned int len;
@ -1345,9 +1289,8 @@ static int read_hex_string(char *str, UCHAR *buf, int n) {
} }
return 0; return 0;
} }
static int ssl_read_key_log_file(ssl,d) static int
ssl_obj *ssl; ssl_read_key_log_file (ssl_obj *ssl, ssl_decoder *d)
ssl_decoder *d;
{ {
int r,_status,n,i; int r,_status,n,i;
unsigned int t; unsigned int t;

View file

@ -59,10 +59,8 @@ extern decoder HandshakeType_decoder[];
#define BYTES_NEEDED(x) (x<=255)?1:((x<=(1<<16))?2:(x<=(1<<24)?3:4)) #define BYTES_NEEDED(x) (x<=255)?1:((x<=(1<<16))?2:(x<=(1<<24)?3:4))
int process_beginning_plaintext(ssl,seg,direction) int
ssl_obj *ssl; process_beginning_plaintext (ssl_obj *ssl, segment *seg, int direction)
segment *seg;
int direction;
{ {
Data d; Data d;
if(seg->len==0) if(seg->len==0)
@ -89,9 +87,8 @@ int process_beginning_plaintext(ssl,seg,direction)
return(0); return(0);
} }
int process_v2_hello(ssl,seg) int
ssl_obj *ssl; process_v2_hello (ssl_obj *ssl, segment *seg)
segment *seg;
{ {
int r; int r;
int rec_len; int rec_len;
@ -213,13 +210,8 @@ int process_v2_hello(ssl,seg)
return(_status); return(_status);
} }
int ssl_decode_switch(ssl,dtable,value,dir,seg,data) int
ssl_obj *ssl; ssl_decode_switch (ssl_obj *ssl, decoder *dtable, int value, int dir, segment *seg, Data *data)
decoder *dtable;
int value;
int dir;
segment *seg;
Data *data;
{ {
while(dtable && dtable->type!=-1 && dtable->name!=NULL){ while(dtable && dtable->type!=-1 && dtable->name!=NULL){
if(dtable->type == value){ if(dtable->type == value){
@ -239,12 +231,8 @@ int ssl_decode_switch(ssl,dtable,value,dir,seg,data)
ERETURN(R_NOT_FOUND); ERETURN(R_NOT_FOUND);
} }
int ssl_expand_record(ssl,q,direction,data,len) int
ssl_obj *ssl; ssl_expand_record (ssl_obj *ssl, segment *q, int direction, UCHAR *data, int len)
segment *q;
int direction;
UCHAR *data;
int len;
{ {
int r; int r;
Data d; Data d;
@ -319,13 +307,8 @@ int ssl_expand_record(ssl,q,direction,data,len)
return(0); return(0);
} }
int ssl_decode_uintX(ssl,name,size,p,data,x) int
ssl_obj *ssl; ssl_decode_uintX (ssl_obj *ssl, char *name, int size, UINT4 p, Data *data, UINT4 *x)
char *name;
int size;
UINT4 p;
Data *data;
UINT4 *x;
{ {
UINT4 v=0; UINT4 v=0;
UINT4 _x; UINT4 _x;
@ -351,13 +334,8 @@ int ssl_decode_uintX(ssl,name,size,p,data,x)
return(0); return(0);
} }
int ssl_decode_opaque_array(ssl,name,size,p,data,x) int
ssl_obj *ssl; ssl_decode_opaque_array (ssl_obj *ssl, char *name, int size, UINT4 p, Data *data, Data *x)
char *name;
int size;
UINT4 p;
Data *data;
Data *x;
{ {
UINT4 len; UINT4 len;
char n[1000]; char n[1000];
@ -394,11 +372,8 @@ int ssl_decode_opaque_array(ssl,name,size,p,data,x)
return(0); return(0);
} }
int ssl_lookup_enum(ssl,dtable,val,ptr) int
ssl_obj *ssl; ssl_lookup_enum (ssl_obj *ssl, decoder *dtable, UINT4 val, char **ptr)
decoder *dtable;
UINT4 val;
char **ptr;
{ {
while(dtable && dtable->type!=-1){ while(dtable && dtable->type!=-1){
if(dtable->type == val){ if(dtable->type == val){
@ -411,14 +386,8 @@ int ssl_lookup_enum(ssl,dtable,val,ptr)
return(R_NOT_FOUND); return(R_NOT_FOUND);
} }
int ssl_decode_enum(ssl,name,size,dtable,p,data,x) int
ssl_obj *ssl; ssl_decode_enum (ssl_obj *ssl, char *name, int size, decoder *dtable, UINT4 p, Data *data, UINT4 *x)
char *name;
int size;
decoder *dtable;
UINT4 p;
Data *data;
UINT4 *x;
{ {
int r; int r;
UINT4 _x; UINT4 _x;
@ -437,11 +406,8 @@ int ssl_decode_enum(ssl,name,size,dtable,p,data,x)
return(0); return(0);
} }
int ssl_print_enum(ssl,name,dtable,value) int
ssl_obj *ssl; ssl_print_enum (ssl_obj *ssl, char *name, decoder *dtable, UINT4 value)
char *name;
decoder *dtable;
UINT4 value;
{ {
if(name) explain(ssl,"%s ",name); if(name) explain(ssl,"%s ",name);
@ -460,11 +426,8 @@ int ssl_print_enum(ssl,name,dtable,value)
return(R_NOT_FOUND); return(R_NOT_FOUND);
} }
int ssl_get_enum_str(ssl,outstr,dtable,value) int
ssl_obj *ssl; ssl_get_enum_str (ssl_obj *ssl, char *outstr, decoder *dtable, UINT4 value)
char *outstr;
decoder *dtable;
UINT4 value;
{ {
while(dtable && dtable->type!=-1){ while(dtable && dtable->type!=-1){
if(dtable->type == value){ if(dtable->type == value){
@ -496,10 +459,8 @@ int explain(ssl_obj *ssl,char *format,...)
return(0); return(0);
} }
int exdump(ssl,name,data) int
ssl_obj *ssl; exdump (ssl_obj *ssl, char *name, Data *data)
char *name;
Data *data;
{ {
int i; int i;
if(!(SSL_print_flags & SSL_PRINT_JSON)) { if(!(SSL_print_flags & SSL_PRINT_JSON)) {
@ -528,10 +489,8 @@ int exdump(ssl,name,data)
return(0); return(0);
} }
int exstr(ssl,outstr,data) int
ssl_obj *ssl; exstr (ssl_obj *ssl, char *outstr, Data *data)
char *outstr;
Data *data;
{ {
int i; int i;
@ -548,10 +507,8 @@ int exstr(ssl,outstr,data)
return(0); return(0);
} }
int combodump(ssl,name,data) int
ssl_obj *ssl; combodump (ssl_obj *ssl, char *name, Data *data)
char *name;
Data *data;
{ {
UCHAR *ptr=data->data; UCHAR *ptr=data->data;
int len=data->len; int len=data->len;
@ -605,9 +562,8 @@ int combodump(ssl,name,data)
return(0); return(0);
} }
int print_data(ssl,d) int
ssl_obj *ssl; print_data (ssl_obj *ssl, Data *d)
Data *d;
{ {
int i,bit8=0; int i,bit8=0;
@ -661,9 +617,8 @@ int print_data(ssl,d)
return(0); return(0);
} }
int ssl_print_direction_indicator(ssl,dir) int
ssl_obj *ssl; ssl_print_direction_indicator (ssl_obj *ssl, int dir)
int dir;
{ {
struct json_object *jobj; struct json_object *jobj;
#if 0 #if 0
@ -706,9 +661,8 @@ int ssl_print_direction_indicator(ssl,dir)
return(0); return(0);
} }
int ssl_print_timestamp(ssl,ts) int
ssl_obj *ssl; ssl_print_timestamp (ssl_obj *ssl, struct timeval *ts)
struct timeval *ts;
{ {
struct timeval dt; struct timeval dt;
int r; int r;
@ -745,8 +699,8 @@ int ssl_print_timestamp(ssl,ts)
} }
int ssl_print_record_num(ssl) int
ssl_obj *ssl; ssl_print_record_num (ssl_obj *ssl)
{ {
struct json_object *jobj; struct json_object *jobj;
jobj = ssl->cur_json_st; jobj = ssl->cur_json_st;
@ -769,11 +723,8 @@ int ssl_print_record_num(ssl)
return(0); return(0);
} }
int ssl_print_cipher_suite(ssl,version,p,val) int
ssl_obj *ssl; ssl_print_cipher_suite (ssl_obj *ssl, int version, int p, UINT4 val)
int version;
int p;
UINT4 val;
{ {
char *str; char *str;
char *prefix=version<=0x300?"SSL_":"TLS_"; char *prefix=version<=0x300?"SSL_":"TLS_";

View file

@ -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)); static int sslx__print_serial PROTO_LIST((ssl_obj *ssl,ASN1_INTEGER *a));
#endif #endif
int sslx_print_certificate(ssl,data,pf) int
ssl_obj *ssl; sslx_print_certificate (ssl_obj *ssl, Data *data, int pf)
Data *data;
int pf;
{ {
#ifdef OPENSSL #ifdef OPENSSL
X509 *x=0; X509 *x=0;
@ -188,10 +186,8 @@ int sslx_print_certificate(ssl,data,pf)
return(_status); return(_status);
} }
int sslx_print_dn(ssl,data,pf) int
ssl_obj *ssl; sslx_print_dn (ssl_obj *ssl, Data *data, int pf)
Data *data;
int pf;
{ {
UCHAR buf[BUFSIZE]; UCHAR buf[BUFSIZE];
int _status; int _status;
@ -224,9 +220,8 @@ int sslx_print_dn(ssl,data,pf)
return(_status); return(_status);
} }
static int sslx__print_dn(ssl,x) static int
ssl_obj *ssl; sslx__print_dn (ssl_obj *ssl, char *x)
char *x;
{ {
char *slash; char *slash;
@ -246,9 +241,8 @@ static int sslx__print_dn(ssl,x)
} }
#ifdef OPENSSL #ifdef OPENSSL
static int sslx__print_serial(ssl,a) static int
ssl_obj *ssl; sslx__print_serial (ssl_obj *ssl, ASN1_INTEGER *a)
ASN1_INTEGER *a;
{ {
Data d; Data d;