added struct to store extensions

This commit is contained in:
mathewmarcus 2018-06-22 07:18:39 -05:00
parent 1a7113a0ec
commit 5d804ef1a4
3 changed files with 11 additions and 3 deletions

View file

@ -2481,7 +2481,7 @@ static int decode_extension_extended_master_secret(ssl,dir,seg,data)
{ {
int l,r,*ems; int l,r,*ems;
ems=&ssl->decoder->extended_master_secret; ems=&ssl->extensions->extended_master_secret;
SSL_DECODE_UINT16(ssl,"extension length",0,data,&l); SSL_DECODE_UINT16(ssl,"extension length",0,data,&l);
data->len-=l; data->len-=l;

View file

@ -265,6 +265,9 @@ static int create_ssl_analyzer(handle,ctx,conn,objp,i_addr,i_port,r_addr,r_port,
if(r=ssl_decoder_create(&obj->decoder,obj->ssl_ctx)) if(r=ssl_decoder_create(&obj->decoder,obj->ssl_ctx))
ABORT(r); ABORT(r);
if (!(obj->extensions=malloc(sizeof(ssl_extensions))))
ABORT(R_NO_MEMORY);
*objp=(proto_obj *)obj; *objp=(proto_obj *)obj;
@ -291,7 +294,8 @@ static int destroy_ssl_analyzer(objp)
free_r_queue(obj->r2i_queue); free_r_queue(obj->r2i_queue);
ssl_decoder_destroy(&obj->decoder); ssl_decoder_destroy(&obj->decoder);
free(obj->client_name); free(obj->client_name);
free(obj->server_name); free(obj->server_name);
free(obj->extensions);
free(*objp); free(*objp);
*objp=0; *objp=0;

View file

@ -67,6 +67,10 @@ typedef struct d_queue_ {
int offset; /*How far into the first segment this record starts*/ int offset; /*How far into the first segment this record starts*/
} r_queue; } r_queue;
typedef struct ssl_extensions_ {
int extended_master_secret;
} ssl_extensions;
typedef struct ssl_obj_ { typedef struct ssl_obj_ {
tcp_conn *conn; tcp_conn *conn;
int r_state; int r_state;
@ -86,7 +90,7 @@ typedef struct ssl_obj_ {
struct timeval time_last; struct timeval time_last;
ssl_decode_ctx *ssl_ctx; ssl_decode_ctx *ssl_ctx;
ssl_decoder *decoder; ssl_decoder *decoder;
ssl_extensions extensions; ssl_extensions *extensions;
int process_ciphertext; int process_ciphertext;