"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "ssl/ssl.enums.c" between
ssldump-0.9b3.tar.gz and ssldump-1.3.tar.gz

About: ssldump is an SSLv3/TLS network protocol analyzer.

ssl.enums.c  (ssldump-0.9b3):ssl.enums.c  (ssldump-1.3)
#include <json-c/json.h>
#include "network.h" #include "network.h"
#include "ssl_h.h" #include "ssl_h.h"
#include "sslprint.h" #include "sslprint.h"
#include "sslxprint.h" #include "sslxprint.h"
#ifdef OPENSSL #ifdef OPENSSL
#include <openssl/ssl.h> #include <openssl/ssl.h>
#endif #endif
#include "ssl.enums.h" #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) static int decode_ContentType_ChangeCipherSpec(ssl,dir,seg,data)
ssl_obj *ssl; ssl_obj *ssl;
int dir; int dir;
segment *seg; segment *seg;
Data *data; Data *data;
{ {
struct json_object *jobj;
jobj = ssl->cur_json_st;
json_object_object_add(jobj, "msg_type", json_object_new_string("ChangeCiphe
rSpec"));
ssl_process_change_cipher_spec(ssl,ssl->decoder,dir); ssl_process_change_cipher_spec(ssl,ssl->decoder,dir);
if(dir==DIR_I2R){ if(dir==DIR_I2R){
ssl->i_state=SSL_ST_SENT_CHANGE_CIPHER_SPEC; ssl->i_state=SSL_ST_SENT_CHANGE_CIPHER_SPEC;
} }
else{ else{
ssl->r_state=SSL_ST_SENT_CHANGE_CIPHER_SPEC; ssl->r_state=SSL_ST_SENT_CHANGE_CIPHER_SPEC;
} }
printf("\n"); LF;
return(0); return(0);
} }
static int decode_ContentType_Alert(ssl,dir,seg,data) static int decode_ContentType_Alert(ssl,dir,seg,data)
ssl_obj *ssl; ssl_obj *ssl;
int dir; int dir;
segment *seg; segment *seg;
Data *data; Data *data;
{ {
int r; int r;
struct json_object *jobj;
if(ssl->record_encryption==REC_CIPHERTEXT){ if(ssl->record_encryption==REC_CIPHERTEXT){
printf("\n"); LF;
return(0); return(0);
} }
if(data->len!=2){ if(data->len!=2){
fprintf(stderr,"Wrong length for alert message: %d\n", fprintf(stderr,"Wrong length for alert message: %d\n",
data->len); data->len);
ERETURN(R_EOD); ERETURN(R_EOD);
} }
jobj = ssl->cur_json_st;
json_object_object_add(jobj, "msg_type", json_object_new_string("Alert"));
P_(P_HL){ P_(P_HL){
printf("\n"); LF;
SSL_DECODE_ENUM(ssl,"level",1,AlertLevel_decoder,P_HL,data,0); SSL_DECODE_ENUM(ssl,"level",1,AlertLevel_decoder,P_HL,data,0);
printf("\n"); LF;
SSL_DECODE_ENUM(ssl,"value",1,AlertDescription_decoder,P_HL,data,0); SSL_DECODE_ENUM(ssl,"value",1,AlertDescription_decoder,P_HL,data,0);
printf("\n"); LF;
} }
else { else {
SSL_DECODE_ENUM(ssl,0,1,AlertLevel_decoder,SSL_PRINT_ALL,data,0); SSL_DECODE_ENUM(ssl,0,1,AlertLevel_decoder,SSL_PRINT_ALL,data,0);
SSL_DECODE_ENUM(ssl,0,1,AlertDescription_decoder,SSL_PRINT_ALL,data,0); SSL_DECODE_ENUM(ssl,0,1,AlertDescription_decoder,SSL_PRINT_ALL,data,0);
printf("\n"); LF;
} }
return(0); return(0);
} }
static int decode_ContentType_Handshake(ssl,dir,seg,data) static int decode_ContentType_Handshake(ssl,dir,seg,data)
ssl_obj *ssl; ssl_obj *ssl;
int dir; int dir;
segment *seg; segment *seg;
Data *data; Data *data;
{ {
extern decoder HandshakeType_decoder[]; extern decoder HandshakeType_decoder[];
int r; int r;
UINT4 t,l; UINT4 t,l;
int rs=0; int rs=0;
Data d; Data d;
struct json_object *jobj;
if(ssl->record_encryption==REC_CIPHERTEXT){ if(ssl->record_encryption==REC_CIPHERTEXT){
printf("\n"); LF;
return(0); return(0);
} }
while(data->len>0){ while(data->len>0){
SSL_DECODE_UINT8(ssl,0,0,data,&t); SSL_DECODE_UINT8(ssl,0,0,data,&t);
SSL_DECODE_UINT24(ssl,0,0,data,&l); SSL_DECODE_UINT24(ssl,0,0,data,&l);
if(data->len<l){ if(data->len<l){
fprintf(stderr,"Error: short handshake length: expected %d got %d\n", fprintf(stderr,"Error: short handshake length: expected %d got %d\n",
l,data->len); l,data->len);
ERETURN(R_EOD); ERETURN(R_EOD);
} }
jobj = ssl->cur_json_st;
json_object_object_add(jobj, "msg_type", json_object_new_string("Handshake
"));
d.data=data->data; d.data=data->data;
d.len=l; d.len=l;
data->len-=l; data->len-=l;
data->data+=l; data->data+=l;
P_(P_HL){ P_(P_HL){
if(!rs){ if(!rs){
printf("\n"); LF;
rs=1; rs=1;
} }
} }
ssl_decode_switch(ssl,HandshakeType_decoder,t,dir,seg,&d); ssl_decode_switch(ssl,HandshakeType_decoder,t,dir,seg,&d);
} }
return(0); return(0);
} }
static int decode_ContentType_application_data(ssl,dir,seg,data) static int decode_ContentType_application_data(ssl,dir,seg,data)
ssl_obj *ssl; ssl_obj *ssl;
int dir; int dir;
segment *seg; segment *seg;
Data *data; Data *data;
{ {
int r; int r;
Data d; Data d;
struct json_object *jobj;
jobj = ssl->cur_json_st;
json_object_object_add(jobj, "msg_type", json_object_new_string("application
data"));
SSL_DECODE_OPAQUE_ARRAY(ssl,"data",data->len,0,data,&d); SSL_DECODE_OPAQUE_ARRAY(ssl,"data",data->len,0,data,&d);
P_(P_AD){ P_(P_AD){
print_data(ssl,&d); print_data(ssl,&d);
} }
else { else {
printf("\n"); LF;
} }
return(0); return(0);
} }
decoder ContentType_decoder[]={ decoder ContentType_decoder[]={
{ {
20, 20,
"ChangeCipherSpec", "ChangeCipherSpec",
decode_ContentType_ChangeCipherSpec decode_ContentType_ChangeCipherSpec
}, },
skipping to change at line 149 skipping to change at line 168
{ {
22, 22,
"Handshake", "Handshake",
decode_ContentType_Handshake decode_ContentType_Handshake
}, },
{ {
23, 23,
"application_data", "application_data",
decode_ContentType_application_data decode_ContentType_application_data
}, },
{0} {-1}
}; };
static int decode_HandshakeType_HelloRequest(ssl,dir,seg,data) static int decode_HandshakeType_HelloRequest(ssl,dir,seg,data)
ssl_obj *ssl; ssl_obj *ssl;
int dir; int dir;
segment *seg; segment *seg;
Data *data; Data *data;
{ {
struct json_object *jobj;
jobj = ssl->cur_json_st;
json_object_object_add(jobj, "handshake_type", json_object_new_string("Hello
Request"));
printf("\n"); LF;
return(0);
} }
static int decode_HandshakeType_ClientHello(ssl,dir,seg,data) static int decode_HandshakeType_ClientHello(ssl,dir,seg,data)
ssl_obj *ssl; ssl_obj *ssl;
int dir; int dir;
segment *seg; segment *seg;
Data *data; Data *data;
{ {
UINT4 vj,vn,cs,cslen,complen,comp; struct json_object *jobj;
jobj = ssl->cur_json_st;
json_object_object_add(jobj, "handshake_type", json_object_new_string("Clien
tHello"));
UINT4 vj,vn,cs,cslen,complen,comp,odd,exlen,ex;
Data session_id,random; Data session_id,random;
int r; int r;
extern decoder cipher_suite_decoder[]; extern decoder cipher_suite_decoder[];
extern decoder compression_method_decoder[]; extern decoder compression_method_decoder[];
extern decoder extension_decoder[];
printf("\n"); LF;
ssl_update_handshake_messages(ssl,data);
SSL_DECODE_UINT8(ssl,0,0,data,&vj); SSL_DECODE_UINT8(ssl,0,0,data,&vj);
SSL_DECODE_UINT8(ssl,0,0,data,&vn); SSL_DECODE_UINT8(ssl,0,0,data,&vn);
P_(P_HL) {explain(ssl,"Version %d.%d ",vj,vn); P_(P_HL) {explain(ssl,"Version %d.%d ",vj,vn);
printf("\n"); LF;
} }
SSL_DECODE_OPAQUE_ARRAY(ssl,"random",32,P_ND,data,&random); SSL_DECODE_OPAQUE_ARRAY(ssl,"random",32,P_ND,data,&random);
ssl_set_client_random(ssl->decoder,random.data,random.len); ssl_set_client_random(ssl->decoder,random.data,random.len);
SSL_DECODE_OPAQUE_ARRAY(ssl,"session_id",-32,0,data,&session_id); SSL_DECODE_OPAQUE_ARRAY(ssl,"session_id",-32,0,data,&session_id);
ssl_set_client_session_id(ssl->decoder,session_id.data,session_id.len); ssl_set_client_session_id(ssl->decoder,session_id.data,session_id.len);
P_(P_HL){ P_(P_HL){
if(session_id.len) if(session_id.len)
exdump(ssl,"resume ",&session_id); exdump(ssl,"resume ",&session_id);
} }
ssl_process_client_session_id(ssl,ssl->decoder,session_id.data,
session_id.len);
P_(P_HL){ P_(P_HL){
SSL_DECODE_UINT16(ssl,"cipher Suites len",0,data,&cslen); SSL_DECODE_UINT16(ssl,"cipher Suites len",0,data,&cslen);
explain(ssl,"cipher suites\n"); explain(ssl,"cipher suites\n");
odd = cslen % 2;
if(odd) {
printf("Wrong cipher suites length, fixing ...\n");
cslen -= odd;
}
for(;cslen;cslen-=2){ for(;cslen;cslen-=2){
ssl_decode_enum(ssl,0,2,cipher_suite_decoder, if(ssl_decode_enum(ssl,0,2,cipher_suite_decoder,
0,data,&cs); 0,data,&cs))
return(1);
ssl_print_cipher_suite(ssl,(vj<<8)|vn,P_HL,cs); ssl_print_cipher_suite(ssl,(vj<<8)|vn,P_HL,cs);
printf("\n"); LF;
} }
} }
SSL_DECODE_UINT8(ssl,"compressionMethod len",0,data,&complen); SSL_DECODE_UINT8(ssl,"compressionMethod len",0,data,&complen);
if(complen){ if(complen){
explain(ssl,"compression methods\n"); explain(ssl,"compression methods\n");
for(;complen;complen--){ for(;complen;complen--){
SSL_DECODE_ENUM(ssl,0,1,compression_method_decoder,P_HL,data,&comp); SSL_DECODE_ENUM(ssl,0,1,compression_method_decoder,P_HL,data,&comp);
printf("\n"); LF;
}
}
SSL_DECODE_UINT16(ssl,"extensions len",0,data,&exlen);
if (exlen) {
explain(ssl , "extensions\n");
while(data->len) {
SSL_DECODE_UINT16(ssl, "extension type", 0, data, &ex);
if (ssl_decode_switch(ssl,extension_decoder,ex,dir,seg,data) == R_NOT_FOU
ND) {
decode_extension(ssl,dir,seg,data);
P_(P_RH){
explain(ssl, "Extension type: %u not yet implemented in ssldump\n", e
x);
}
continue;
}
LF;
} }
} }
return(0); return(0);
} }
static int decode_HandshakeType_ServerHello(ssl,dir,seg,data) static int decode_HandshakeType_ServerHello(ssl,dir,seg,data)
ssl_obj *ssl; ssl_obj *ssl;
int dir; int dir;
segment *seg; segment *seg;
Data *data; Data *data;
{ {
int r; int r;
Data rnd,session_id; Data rnd,session_id;
UINT4 vj,vn; UINT4 vj,vn,exlen,ex;
printf("\n");
extern decoder extension_decoder[];
struct json_object *jobj;
jobj = ssl->cur_json_st;
json_object_object_add(jobj, "handshake_type", json_object_new_string("Serve
rHello"));
LF;
ssl_update_handshake_messages(ssl,data);
SSL_DECODE_UINT8(ssl,0,0,data,&vj); SSL_DECODE_UINT8(ssl,0,0,data,&vj);
SSL_DECODE_UINT8(ssl,0,0,data,&vn); SSL_DECODE_UINT8(ssl,0,0,data,&vn);
ssl->version=vj*256+vn; ssl->version=vj*256+vn;
P_(P_HL) {explain(ssl,"Version %d.%d ",vj,vn); P_(P_HL) {explain(ssl,"Version %d.%d ",vj,vn);
printf("\n"); LF;
} }
SSL_DECODE_OPAQUE_ARRAY(ssl,"random",32,P_ND,data,&rnd); SSL_DECODE_OPAQUE_ARRAY(ssl,"random",32,P_ND,data,&rnd);
ssl_set_server_random(ssl->decoder,rnd.data,rnd.len); ssl_set_server_random(ssl->decoder,rnd.data,rnd.len);
SSL_DECODE_OPAQUE_ARRAY(ssl,"session_id",-32,P_HL,data,&session_id); SSL_DECODE_OPAQUE_ARRAY(ssl,"session_id",-32,P_HL,data,&session_id);
SSL_DECODE_ENUM(ssl,"cipherSuite",2,cipher_suite_decoder, SSL_DECODE_ENUM(ssl,"cipherSuite",2,cipher_suite_decoder,
0,data,&ssl->cipher_suite); 0,data,&ssl->cipher_suite);
P_(P_HL){ P_(P_HL){
explain(ssl,"cipherSuite "); explain(ssl,"cipherSuite ");
ssl_print_cipher_suite(ssl,ssl->version,P_HL,ssl->cipher_suite); ssl_print_cipher_suite(ssl,ssl->version,P_HL,ssl->cipher_suite);
} }
ssl_find_cipher(ssl->cipher_suite,&ssl->cs); ssl_find_cipher(ssl->cipher_suite,&ssl->cs);
ssl_process_server_session_id(ssl,ssl->decoder,session_id.data, ssl_process_server_session_id(ssl,ssl->decoder,session_id.data,
session_id.len); session_id.len);
P_(P_HL) printf("\n"); P_(P_HL) LF;
SSL_DECODE_ENUM(ssl,"compressionMethod",1,compression_method_decoder,P_HL,da ta,0); SSL_DECODE_ENUM(ssl,"compressionMethod",1,compression_method_decoder,P_HL,da ta,0);
P_(P_HL) printf("\n"); P_(P_HL) LF;
SSL_DECODE_UINT16(ssl,"extensions len",0,data,&exlen);
if (exlen) {
explain(ssl , "extensions\n");
while(data->len) {
SSL_DECODE_UINT16(ssl, "extension type", 0, data, &ex);
if (ssl_decode_switch(ssl,extension_decoder,ex,dir,seg,data) == R_NOT_FOU
ND) {
decode_extension(ssl,dir,seg,data);
P_(P_RH){
explain(ssl, "Extension type: %u not yet implemented in ssldump,\n",
ex);
}
continue;
}
LF;
}
}
return(0); return(0);
} }
static int decode_HandshakeType_Certificate(ssl,dir,seg,data) static int decode_HandshakeType_Certificate(ssl,dir,seg,data)
ssl_obj *ssl; ssl_obj *ssl;
int dir; int dir;
segment *seg; segment *seg;
Data *data; Data *data;
{ {
UINT4 len; UINT4 len;
Data cert; Data cert;
int r; int r;
printf("\n"); struct json_object *jobj;
jobj = ssl->cur_json_st;
json_object_object_add(jobj, "handshake_type", json_object_new_string("Certi
ficate"));
LF;
ssl_update_handshake_messages(ssl,data);
SSL_DECODE_UINT24(ssl,"certificates len",0,data,&len); SSL_DECODE_UINT24(ssl,"certificates len",0,data,&len);
json_object_object_add(jobj, "cert_chain", json_object_new_array());
while(len){ while(len){
SSL_DECODE_OPAQUE_ARRAY(ssl,"certificate",-((1<<23)-1), SSL_DECODE_OPAQUE_ARRAY(ssl,"certificate",-((1<<23)-1),
0,data,&cert); 0,data,&cert);
sslx_print_certificate(ssl,&cert,P_ND); sslx_print_certificate(ssl,&cert,P_ND);
len-=(cert.len + 3); len-=(cert.len + 3);
} }
return(0); return(0);
} }
static int decode_HandshakeType_ServerKeyExchange(ssl,dir,seg,data) static int decode_HandshakeType_ServerKeyExchange(ssl,dir,seg,data)
ssl_obj *ssl; ssl_obj *ssl;
int dir; int dir;
segment *seg; segment *seg;
Data *data; Data *data;
{ {
int r; int r;
printf("\n"); struct json_object *jobj;
jobj = ssl->cur_json_st;
json_object_object_add(jobj, "handshake_type", json_object_new_string("Serve
rKeyExchange"));
LF;
ssl_update_handshake_messages(ssl,data);
if(ssl->cs){ if(ssl->cs){
P_(P_ND){ P_(P_ND){
explain(ssl,"params\n"); explain(ssl,"params\n");
} }
INDENT_INCR; INDENT_INCR;
switch(ssl->cs->kex){ switch(ssl->cs->kex){
case KEX_DH: case KEX_DH:
SSL_DECODE_OPAQUE_ARRAY(ssl,"DH_p",-((1<<15)-1),P_ND,data,0); SSL_DECODE_OPAQUE_ARRAY(ssl,"DH_p",-((1<<15)-1),P_ND,data,0);
SSL_DECODE_OPAQUE_ARRAY(ssl,"DH_g",-((1<<15)-1),P_ND,data,0); SSL_DECODE_OPAQUE_ARRAY(ssl,"DH_g",-((1<<15)-1),P_ND,data,0);
skipping to change at line 327 skipping to change at line 418
ssl_obj *ssl; ssl_obj *ssl;
int dir; int dir;
segment *seg; segment *seg;
Data *data; Data *data;
{ {
UINT4 len; UINT4 len;
Data ca; Data ca;
int r; int r;
printf("\n"); struct json_object *jobj;
jobj = ssl->cur_json_st;
json_object_object_add(jobj, "handshake_type", json_object_new_string("Certi
ficateRequest"));
LF;
ssl_update_handshake_messages(ssl,data);
SSL_DECODE_UINT8(ssl,"certificate_types len",0,data,&len); SSL_DECODE_UINT8(ssl,"certificate_types len",0,data,&len);
for(;len;len--){ for(;len;len--){
SSL_DECODE_ENUM(ssl,"certificate_types",1, SSL_DECODE_ENUM(ssl,"certificate_types",1,
client_certificate_type_decoder, P_HL,data,0); client_certificate_type_decoder, P_HL,data,0);
P_(P_HL){ P_(P_HL){
printf("\n"); LF;
} }
}; };
SSL_DECODE_UINT16(ssl,"certificate_authorities len",0,data,&len); SSL_DECODE_UINT16(ssl,"certificate_authorities len",0,data,&len);
while(len){ while(len){
SSL_DECODE_OPAQUE_ARRAY(ssl,"certificate_authorities", SSL_DECODE_OPAQUE_ARRAY(ssl,"certificate_authorities",
-((1<<15)-1),0,data,&ca); -((1<<15)-1),0,data,&ca);
explain(ssl,"certificate_authority\n"); explain(ssl,"certificate_authority\n");
INDENT_INCR; INDENT_INCR;
sslx_print_dn(ssl,&ca,P_HL); sslx_print_dn(ssl,&ca,P_HL);
skipping to change at line 357 skipping to change at line 453
return(0); return(0);
} }
static int decode_HandshakeType_ServerHelloDone(ssl,dir,seg,data) static int decode_HandshakeType_ServerHelloDone(ssl,dir,seg,data)
ssl_obj *ssl; ssl_obj *ssl;
int dir; int dir;
segment *seg; segment *seg;
Data *data; Data *data;
{ {
printf("\n"); struct json_object *jobj;
jobj = ssl->cur_json_st;
json_object_object_add(jobj, "handshake_type", json_object_new_string("Serve
rHelloDone"));
LF;
ssl_update_handshake_messages(ssl,data);
return(0);
} }
static int decode_HandshakeType_CertificateVerify(ssl,dir,seg,data) static int decode_HandshakeType_CertificateVerify(ssl,dir,seg,data)
ssl_obj *ssl; ssl_obj *ssl;
int dir; int dir;
segment *seg; segment *seg;
Data *data; Data *data;
{ {
int r; int r;
printf("\n");
SSL_DECODE_OPAQUE_ARRAY(ssl,"Signature",-(1<<15-1),P_HL,data,0); struct json_object *jobj;
jobj = ssl->cur_json_st;
json_object_object_add(jobj, "handshake_type", json_object_new_string("Certi
ficateVerify"));
LF;
ssl_update_handshake_messages(ssl,data);
SSL_DECODE_OPAQUE_ARRAY(ssl,"Signature",-((1<<15)-1),P_HL,data,0);
return(0); return(0);
} }
static int decode_HandshakeType_ClientKeyExchange(ssl,dir,seg,data) static int decode_HandshakeType_ClientKeyExchange(ssl,dir,seg,data)
ssl_obj *ssl; ssl_obj *ssl;
int dir; int dir;
segment *seg; segment *seg;
Data *data; Data *data;
{ {
int r; int r;
Data pms; Data pms;
printf("\n"); struct json_object *jobj;
jobj = ssl->cur_json_st;
json_object_object_add(jobj, "handshake_type", json_object_new_string("Clien
tKeyExchange"));
LF;
ssl_update_handshake_messages(ssl,data);
if(ssl->cs){ if(ssl->cs){
switch(ssl->cs->kex){ switch(ssl->cs->kex){
case KEX_RSA: case KEX_RSA:
if(ssl->version > 768) { if(ssl->version > 768) {
SSL_DECODE_OPAQUE_ARRAY(ssl,"EncryptedPreMasterSecret",-(1<<15 -1), SSL_DECODE_OPAQUE_ARRAY(ssl,"EncryptedPreMasterSecret",-((1<<1 5)-1),
P_ND,data,&pms); P_ND,data,&pms);
} }
else { else {
SSL_DECODE_OPAQUE_ARRAY(ssl,"EncryptedPreMasterSecret",data->l en,P_ND,data,&pms); SSL_DECODE_OPAQUE_ARRAY(ssl,"EncryptedPreMasterSecret",data->l en,P_ND,data,&pms);
} }
ssl_process_client_key_exchange(ssl, ssl_process_client_key_exchange(ssl,
ssl->decoder,pms.data,pms.len); ssl->decoder,pms.data,pms.len);
break; break;
case KEX_DH: case KEX_DH:
SSL_DECODE_OPAQUE_ARRAY(ssl,"DiffieHellmanClientPublicValue", SSL_DECODE_OPAQUE_ARRAY(ssl,"DiffieHellmanClientPublicValue",
-(1<<15-1),P_HL,data,0); -((1<<7)-1),P_HL,data,0);
ssl_process_client_key_exchange(ssl,
ssl->decoder,NULL,0);
} }
} }
return(0); return(0);
} }
static int decode_HandshakeType_Finished(ssl,dir,seg,data) static int decode_HandshakeType_Finished(ssl,dir,seg,data)
ssl_obj *ssl; ssl_obj *ssl;
int dir; int dir;
segment *seg; segment *seg;
Data *data; Data *data;
{ {
int r; int r;
printf("\n"); struct json_object *jobj;
jobj = ssl->cur_json_st;
json_object_object_add(jobj, "handshake_type", json_object_new_string("Finis
hed"));
LF;
switch(ssl->version){ switch(ssl->version){
case 0x300: case 0x300:
SSL_DECODE_OPAQUE_ARRAY(ssl,"md5_hash",16,P_ND,data,0); SSL_DECODE_OPAQUE_ARRAY(ssl,"md5_hash",16,P_ND,data,0);
SSL_DECODE_OPAQUE_ARRAY(ssl,"sha_hash",20,P_ND,data,0); SSL_DECODE_OPAQUE_ARRAY(ssl,"sha_hash",20,P_ND,data,0);
break; break;
case 0x301: case 0x301:
SSL_DECODE_OPAQUE_ARRAY(ssl,"verify_data",12,P_ND,data,0); SSL_DECODE_OPAQUE_ARRAY(ssl,"verify_data",12,P_ND,data,0);
P_(P_ND) P_(P_ND)
printf("\n"); LF;
break; break;
} }
return (0); return (0);
} }
decoder HandshakeType_decoder[]={ decoder HandshakeType_decoder[]={
{ {
0, 0,
"HelloRequest", "HelloRequest",
skipping to change at line 485 skipping to change at line 604
{ {
16, 16,
"ClientKeyExchange", "ClientKeyExchange",
decode_HandshakeType_ClientKeyExchange decode_HandshakeType_ClientKeyExchange
}, },
{ {
20, 20,
"Finished", "Finished",
decode_HandshakeType_Finished decode_HandshakeType_Finished
}, },
{0} {-1}
}; };
decoder cipher_suite_decoder[]={ decoder cipher_suite_decoder[]={
// https://www.iana.org/assignments/tls-parameters/tls-parameters.txt
{
0,
"TLS_NULL_WITH_NULL_NULL",
0 },
{ {
1, 1,
"TLS_RSA_WITH_NULL_MD5", "TLS_RSA_WITH_NULL_MD5",
0 }, 0 },
{ {
2, 2,
"TLS_RSA_WITH_NULL_SHA", "TLS_RSA_WITH_NULL_SHA",
0 }, 0 },
{ {
3, 3,
skipping to change at line 598 skipping to change at line 722
0 }, 0 },
{ {
26, 26,
"TLS_DH_anon_WITH_DES_CBC_SHA", "TLS_DH_anon_WITH_DES_CBC_SHA",
0 }, 0 },
{ {
27, 27,
"TLS_DH_anon_WITH_3DES_EDE_CBC_SHA", "TLS_DH_anon_WITH_3DES_EDE_CBC_SHA",
0 }, 0 },
{ {
30,
"TLS_KRB5_WITH_DES_CBC_SHA",
0 },
{
31,
"TLS_KRB5_WITH_3DES_EDE_CBC_SHA",
0 },
{
32,
"TLS_KRB5_WITH_RC4_128_SHA",
0 },
{
33,
"TLS_KRB5_WITH_IDEA_CBC_SHA",
0 },
{
34,
"TLS_KRB5_WITH_DES_CBC_MD5",
0 },
{
35,
"TLS_KRB5_WITH_3DES_EDE_CBC_MD5",
0 },
{
36,
"TLS_KRB5_WITH_RC4_128_MD5",
0 },
{
37,
"TLS_KRB5_WITH_IDEA_CBC_MD5",
0 },
{
38,
"TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA",
0 },
{
39,
"TLS_KRB5_EXPORT_WITH_RC2_CBC_40_SHA",
0 },
{
40,
"TLS_KRB5_EXPORT_WITH_RC4_40_SHA",
0 },
{
41,
"TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5",
0 },
{
42,
"TLS_KRB5_EXPORT_WITH_RC2_CBC_40_MD5",
0 },
{
43,
"TLS_KRB5_EXPORT_WITH_RC4_40_MD5",
0 },
{
44,
"TLS_PSK_WITH_NULL_SHA",
0 },
{
45,
"TLS_DHE_PSK_WITH_NULL_SHA",
0 },
{
46,
"TLS_RSA_PSK_WITH_NULL_SHA",
0 },
{
47,
"TLS_RSA_WITH_AES_128_CBC_SHA",
0 },
{
48,
"TLS_DH_DSS_WITH_AES_128_CBC_SHA",
0 },
{
49,
"TLS_DH_RSA_WITH_AES_128_CBC_SHA",
0 },
{
50,
"TLS_DHE_DSS_WITH_AES_128_CBC_SHA",
0 },
{
51,
"TLS_DHE_RSA_WITH_AES_128_CBC_SHA",
0 },
{
52,
"TLS_DH_anon_WITH_AES_128_CBC_SHA",
0 },
{
53,
"TLS_RSA_WITH_AES_256_CBC_SHA",
0 },
{
54,
"TLS_DH_DSS_WITH_AES_256_CBC_SHA",
0 },
{
55,
"TLS_DH_RSA_WITH_AES_256_CBC_SHA",
0 },
{
56,
"TLS_DHE_DSS_WITH_AES_256_CBC_SHA",
0 },
{
57,
"TLS_DHE_RSA_WITH_AES_256_CBC_SHA",
0 },
{
58,
"TLS_DH_anon_WITH_AES_256_CBC_SHA",
0 },
{
59,
"TLS_RSA_WITH_NULL_SHA256",
0 },
{
60,
"TLS_RSA_WITH_AES_128_CBC_SHA256",
0 },
{
61,
"TLS_RSA_WITH_AES_256_CBC_SHA256",
0 },
{
62,
"TLS_DH_DSS_WITH_AES_128_CBC_SHA256",
0 },
{
63,
"TLS_DH_RSA_WITH_AES_128_CBC_SHA256",
0 },
{
64,
"TLS_DHE_DSS_WITH_AES_128_CBC_SHA256",
0 },
{
65,
"TLS_RSA_WITH_CAMELLIA_128_CBC_SHA",
0 },
{
66,
"TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA",
0 },
{
67,
"TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA",
0 },
{
68,
"TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA",
0 },
{
69,
"TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA",
0 },
{
70,
"TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA",
0 },
{
103,
"TLS_DHE_RSA_WITH_AES_128_CBC_SHA256",
0 },
{
104,
"TLS_DH_DSS_WITH_AES_256_CBC_SHA256",
0 },
{
105,
"TLS_DH_RSA_WITH_AES_256_CBC_SHA256",
0 },
{
106,
"TLS_DHE_DSS_WITH_AES_256_CBC_SHA256",
0 },
{
107,
"TLS_DHE_RSA_WITH_AES_256_CBC_SHA256",
0 },
{
108,
"TLS_DH_anon_WITH_AES_128_CBC_SHA256",
0 },
{
109,
"TLS_DH_anon_WITH_AES_256_CBC_SHA256",
0 },
{
132,
"TLS_RSA_WITH_CAMELLIA_256_CBC_SHA",
0 },
{
133,
"TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA",
0 },
{
134,
"TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA",
0 },
{
135,
"TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA",
0 },
{
136,
"TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA",
0 },
{
137,
"TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA",
0 },
{
138,
"TLS_PSK_WITH_RC4_128_SHA",
0 },
{
139,
"TLS_PSK_WITH_3DES_EDE_CBC_SHA",
0 },
{
140,
"TLS_PSK_WITH_AES_128_CBC_SHA",
0 },
{
141,
"TLS_PSK_WITH_AES_256_CBC_SHA",
0 },
{
142,
"TLS_DHE_PSK_WITH_RC4_128_SHA",
0 },
{
143,
"TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA",
0 },
{
144,
"TLS_DHE_PSK_WITH_AES_128_CBC_SHA",
0 },
{
145,
"TLS_DHE_PSK_WITH_AES_256_CBC_SHA",
0 },
{
146,
"TLS_RSA_PSK_WITH_RC4_128_SHA",
0 },
{
147,
"TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA",
0 },
{
148,
"TLS_RSA_PSK_WITH_AES_128_CBC_SHA",
0 },
{
149,
"TLS_RSA_PSK_WITH_AES_256_CBC_SHA",
0 },
{
150,
"TLS_RSA_WITH_SEED_CBC_SHA",
0 },
{
151,
"TLS_DH_DSS_WITH_SEED_CBC_SHA",
0 },
{
152,
"TLS_DH_RSA_WITH_SEED_CBC_SHA",
0 },
{
153,
"TLS_DHE_DSS_WITH_SEED_CBC_SHA",
0 },
{
154,
"TLS_DHE_RSA_WITH_SEED_CBC_SHA",
0 },
{
155,
"TLS_DH_anon_WITH_SEED_CBC_SHA",
0 },
{
156,
"TLS_RSA_WITH_AES_128_GCM_SHA256",
0 },
{
157,
"TLS_RSA_WITH_AES_256_GCM_SHA384",
0 },
{
158,
"TLS_DHE_RSA_WITH_AES_128_GCM_SHA256",
0 },
{
159,
"TLS_DHE_RSA_WITH_AES_256_GCM_SHA384",
0 },
{
160,
"TLS_DH_RSA_WITH_AES_128_GCM_SHA256",
0 },
{
161,
"TLS_DH_RSA_WITH_AES_256_GCM_SHA384",
0 },
{
162,
"TLS_DHE_DSS_WITH_AES_128_GCM_SHA256",
0 },
{
163,
"TLS_DHE_DSS_WITH_AES_256_GCM_SHA384",
0 },
{
164,
"TLS_DH_DSS_WITH_AES_128_GCM_SHA256",
0 },
{
165,
"TLS_DH_DSS_WITH_AES_256_GCM_SHA384",
0 },
{
166,
"TLS_DH_anon_WITH_AES_128_GCM_SHA256",
0 },
{
167,
"TLS_DH_anon_WITH_AES_256_GCM_SHA384",
0 },
{
168,
"TLS_PSK_WITH_AES_128_GCM_SHA256",
0 },
{
169,
"TLS_PSK_WITH_AES_256_GCM_SHA384",
0 },
{
170,
"TLS_DHE_PSK_WITH_AES_128_GCM_SHA256",
0 },
{
171,
"TLS_DHE_PSK_WITH_AES_256_GCM_SHA384",
0 },
{
172,
"TLS_RSA_PSK_WITH_AES_128_GCM_SHA256",
0 },
{
173,
"TLS_RSA_PSK_WITH_AES_256_GCM_SHA384",
0 },
{
174,
"TLS_PSK_WITH_AES_128_CBC_SHA256",
0 },
{
175,
"TLS_PSK_WITH_AES_256_CBC_SHA384",
0 },
{
176,
"TLS_PSK_WITH_NULL_SHA256",
0 },
{
177,
"TLS_PSK_WITH_NULL_SHA384",
0 },
{
178,
"TLS_DHE_PSK_WITH_AES_128_CBC_SHA256",
0 },
{
179,
"TLS_DHE_PSK_WITH_AES_256_CBC_SHA384",
0 },
{
180,
"TLS_DHE_PSK_WITH_NULL_SHA256",
0 },
{
181,
"TLS_DHE_PSK_WITH_NULL_SHA384",
0 },
{
182,
"TLS_RSA_PSK_WITH_AES_128_CBC_SHA256",
0 },
{
183,
"TLS_RSA_PSK_WITH_AES_256_CBC_SHA384",
0 },
{
184,
"TLS_RSA_PSK_WITH_NULL_SHA256",
0 },
{
185,
"TLS_RSA_PSK_WITH_NULL_SHA384",
0 },
{
186,
"TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256",
0 },
{
187,
"TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA256",
0 },
{
188,
"TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA256",
0 },
{
189,
"TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256",
0 },
{
190,
"TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256",
0 },
{
191,
"TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA256",
0 },
{
192,
"TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256",
0 },
{
193,
"TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA256",
0 },
{
194,
"TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA256",
0 },
{
195,
"TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256",
0 },
{
196,
"TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256",
0 },
{
197,
"TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA256",
0 },
{
255,
"TLS_EMPTY_RENEGOTIATION_INFO_SCSV",
0 },
{
4865,
"TLS_AES_128_GCM_SHA256",
0 },
{
4866,
"TLS_AES_256_GCM_SHA384",
0 },
{
4867,
"TLS_CHACHA20_POLY1305_SHA256",
0 },
{
4868,
"TLS_AES_128_CCM_SHA256",
0 },
{
4869,
"TLS_AES_128_CCM_8_SHA256",
0 },
{
22016,
"TLS_FALLBACK_SCSV",
0 },
{
49153,
"TLS_ECDH_ECDSA_WITH_NULL_SHA",
0 },
{
49154,
"TLS_ECDH_ECDSA_WITH_RC4_128_SHA",
0 },
{
49155,
"TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA",
0 },
{
49156,
"TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA",
0 },
{
49157,
"TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA",
0 },
{
49158,
"TLS_ECDHE_ECDSA_WITH_NULL_SHA",
0 },
{
49159,
"TLS_ECDHE_ECDSA_WITH_RC4_128_SHA",
0 },
{
49160,
"TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA",
0 },
{
49161,
"TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA",
0 },
{
49162,
"TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA",
0 },
{
49163,
"TLS_ECDH_RSA_WITH_NULL_SHA",
0 },
{
49164,
"TLS_ECDH_RSA_WITH_RC4_128_SHA",
0 },
{
49165,
"TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA",
0 },
{
49166,
"TLS_ECDH_RSA_WITH_AES_128_CBC_SHA",
0 },
{
49167,
"TLS_ECDH_RSA_WITH_AES_256_CBC_SHA",
0 },
{
49168,
"TLS_ECDHE_RSA_WITH_NULL_SHA",
0 },
{
49169,
"TLS_ECDHE_RSA_WITH_RC4_128_SHA",
0 },
{
49170,
"TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA",
0 },
{
49171,
"TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA",
0 },
{
49172,
"TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA",
0 },
{
49173,
"TLS_ECDH_anon_WITH_NULL_SHA",
0 },
{
49174,
"TLS_ECDH_anon_WITH_RC4_128_SHA",
0 },
{
49175,
"TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA",
0 },
{
49176,
"TLS_ECDH_anon_WITH_AES_128_CBC_SHA",
0 },
{
49177,
"TLS_ECDH_anon_WITH_AES_256_CBC_SHA",
0 },
{
49178,
"TLS_SRP_SHA_WITH_3DES_EDE_CBC_SHA",
0 },
{
49179,
"TLS_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA",
0 },
{
49180,
"TLS_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA",
0 },
{
49181,
"TLS_SRP_SHA_WITH_AES_128_CBC_SHA",
0 },
{
49182,
"TLS_SRP_SHA_RSA_WITH_AES_128_CBC_SHA",
0 },
{
49183,
"TLS_SRP_SHA_DSS_WITH_AES_128_CBC_SHA",
0 },
{
49184,
"TLS_SRP_SHA_WITH_AES_256_CBC_SHA",
0 },
{
49185,
"TLS_SRP_SHA_RSA_WITH_AES_256_CBC_SHA",
0 },
{
49186,
"TLS_SRP_SHA_DSS_WITH_AES_256_CBC_SHA",
0 },
{
49187,
"TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256",
0 },
{
49188,
"TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384",
0 },
{
49189,
"TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256",
0 },
{
49190,
"TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384",
0 },
{
49191,
"TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256",
0 },
{
49192,
"TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384",
0 },
{
49193,
"TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256",
0 },
{
49194,
"TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384",
0 },
{
49195,
"TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256",
0 },
{
49196,
"TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384",
0 },
{
49197,
"TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256",
0 },
{
49198,
"TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384",
0 },
{
49199,
"TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256",
0 },
{
49200,
"TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384",
0 },
{
49201,
"TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256",
0 },
{
49202,
"TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384",
0 },
{
49203,
"TLS_ECDHE_PSK_WITH_RC4_128_SHA",
0 },
{
49204,
"TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA",
0 },
{
49205,
"TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA",
0 },
{
49206,
"TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA",
0 },
{
49207,
"TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256",
0 },
{
49208,
"TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384",
0 },
{
49209,
"TLS_ECDHE_PSK_WITH_NULL_SHA",
0 },
{
49210,
"TLS_ECDHE_PSK_WITH_NULL_SHA256",
0 },
{
49211,
"TLS_ECDHE_PSK_WITH_NULL_SHA384",
0 },
{
49212,
"TLS_RSA_WITH_ARIA_128_CBC_SHA256",
0 },
{
49213,
"TLS_RSA_WITH_ARIA_256_CBC_SHA384",
0 },
{
49214,
"TLS_DH_DSS_WITH_ARIA_128_CBC_SHA256",
0 },
{
49215,
"TLS_DH_DSS_WITH_ARIA_256_CBC_SHA384",
0 },
{
49216,
"TLS_DH_RSA_WITH_ARIA_128_CBC_SHA256",
0 },
{
49217,
"TLS_DH_RSA_WITH_ARIA_256_CBC_SHA384",
0 },
{
49218,
"TLS_DHE_DSS_WITH_ARIA_128_CBC_SHA256",
0 },
{
49219,
"TLS_DHE_DSS_WITH_ARIA_256_CBC_SHA384",
0 },
{
49220,
"TLS_DHE_RSA_WITH_ARIA_128_CBC_SHA256",
0 },
{
49221,
"TLS_DHE_RSA_WITH_ARIA_256_CBC_SHA384",
0 },
{
49222,
"TLS_DH_anon_WITH_ARIA_128_CBC_SHA256",
0 },
{
49223,
"TLS_DH_anon_WITH_ARIA_256_CBC_SHA384",
0 },
{
49224,
"TLS_ECDHE_ECDSA_WITH_ARIA_128_CBC_SHA256",
0 },
{
49225,
"TLS_ECDHE_ECDSA_WITH_ARIA_256_CBC_SHA384",
0 },
{
49226,
"TLS_ECDH_ECDSA_WITH_ARIA_128_CBC_SHA256",
0 },
{
49227,
"TLS_ECDH_ECDSA_WITH_ARIA_256_CBC_SHA384",
0 },
{
49228,
"TLS_ECDHE_RSA_WITH_ARIA_128_CBC_SHA256",
0 },
{
49229,
"TLS_ECDHE_RSA_WITH_ARIA_256_CBC_SHA384",
0 },
{
49230,
"TLS_ECDH_RSA_WITH_ARIA_128_CBC_SHA256",
0 },
{
49231,
"TLS_ECDH_RSA_WITH_ARIA_256_CBC_SHA384",
0 },
{
49232,
"TLS_RSA_WITH_ARIA_128_GCM_SHA256",
0 },
{
49233,
"TLS_RSA_WITH_ARIA_256_GCM_SHA384",
0 },
{
49234,
"TLS_DHE_RSA_WITH_ARIA_128_GCM_SHA256",
0 },
{
49235,
"TLS_DHE_RSA_WITH_ARIA_256_GCM_SHA384",
0 },
{
49236,
"TLS_DH_RSA_WITH_ARIA_128_GCM_SHA256",
0 },
{
49237,
"TLS_DH_RSA_WITH_ARIA_256_GCM_SHA384",
0 },
{
49238,
"TLS_DHE_DSS_WITH_ARIA_128_GCM_SHA256",
0 },
{
49239,
"TLS_DHE_DSS_WITH_ARIA_256_GCM_SHA384",
0 },
{
49240,
"TLS_DH_DSS_WITH_ARIA_128_GCM_SHA256",
0 },
{
49241,
"TLS_DH_DSS_WITH_ARIA_256_GCM_SHA384",
0 },
{
49242,
"TLS_DH_anon_WITH_ARIA_128_GCM_SHA256",
0 },
{
49243,
"TLS_DH_anon_WITH_ARIA_256_GCM_SHA384",
0 },
{
49244,
"TLS_ECDHE_ECDSA_WITH_ARIA_128_GCM_SHA256",
0 },
{
49245,
"TLS_ECDHE_ECDSA_WITH_ARIA_256_GCM_SHA384",
0 },
{
49246,
"TLS_ECDH_ECDSA_WITH_ARIA_128_GCM_SHA256",
0 },
{
49247,
"TLS_ECDH_ECDSA_WITH_ARIA_256_GCM_SHA384",
0 },
{
49248,
"TLS_ECDHE_RSA_WITH_ARIA_128_GCM_SHA256",
0 },
{
49249,
"TLS_ECDHE_RSA_WITH_ARIA_256_GCM_SHA384",
0 },
{
49250,
"TLS_ECDH_RSA_WITH_ARIA_128_GCM_SHA256",
0 },
{
49251,
"TLS_ECDH_RSA_WITH_ARIA_256_GCM_SHA384",
0 },
{
49252,
"TLS_PSK_WITH_ARIA_128_CBC_SHA256",
0 },
{
49253,
"TLS_PSK_WITH_ARIA_256_CBC_SHA384",
0 },
{
49254,
"TLS_DHE_PSK_WITH_ARIA_128_CBC_SHA256",
0 },
{
49255,
"TLS_DHE_PSK_WITH_ARIA_256_CBC_SHA384",
0 },
{
49256,
"TLS_RSA_PSK_WITH_ARIA_128_CBC_SHA256",
0 },
{
49257,
"TLS_RSA_PSK_WITH_ARIA_256_CBC_SHA384",
0 },
{
49258,
"TLS_PSK_WITH_ARIA_128_GCM_SHA256",
0 },
{
49259,
"TLS_PSK_WITH_ARIA_256_GCM_SHA384",
0 },
{
49260,
"TLS_DHE_PSK_WITH_ARIA_128_GCM_SHA256",
0 },
{
49261,
"TLS_DHE_PSK_WITH_ARIA_256_GCM_SHA384",
0 },
{
49262,
"TLS_RSA_PSK_WITH_ARIA_128_GCM_SHA256",
0 },
{
49263,
"TLS_RSA_PSK_WITH_ARIA_256_GCM_SHA384",
0 },
{
49264,
"TLS_ECDHE_PSK_WITH_ARIA_128_CBC_SHA256",
0 },
{
49265,
"TLS_ECDHE_PSK_WITH_ARIA_256_CBC_SHA384",
0 },
{
49266,
"TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256",
0 },
{
49267,
"TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384",
0 },
{
49268,
"TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256",
0 },
{
49269,
"TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384",
0 },
{
49270,
"TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256",
0 },
{
49271,
"TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384",
0 },
{
49272,
"TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256",
0 },
{
49273,
"TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384",
0 },
{
49274,
"TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256",
0 },
{
49275,
"TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384",
0 },
{
49276,
"TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256",
0 },
{
49277,
"TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384",
0 },
{
49278,
"TLS_DH_RSA_WITH_CAMELLIA_128_GCM_SHA256",
0 },
{
49279,
"TLS_DH_RSA_WITH_CAMELLIA_256_GCM_SHA384",
0 },
{
49280,
"TLS_DHE_DSS_WITH_CAMELLIA_128_GCM_SHA256",
0 },
{
49281,
"TLS_DHE_DSS_WITH_CAMELLIA_256_GCM_SHA384",
0 },
{
49282,
"TLS_DH_DSS_WITH_CAMELLIA_128_GCM_SHA256",
0 },
{
49283,
"TLS_DH_DSS_WITH_CAMELLIA_256_GCM_SHA384",
0 },
{
49284,
"TLS_DH_anon_WITH_CAMELLIA_128_GCM_SHA256",
0 },
{
49285,
"TLS_DH_anon_WITH_CAMELLIA_256_GCM_SHA384",
0 },
{
49286,
"TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256",
0 },
{
49287,
"TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384",
0 },
{
49288,
"TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256",
0 },
{
49289,
"TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384",
0 },
{
49290,
"TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256",
0 },
{
49291,
"TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384",
0 },
{
49292,
"TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256",
0 },
{
49293,
"TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384",
0 },
{
49294,
"TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256",
0 },
{
49295,
"TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384",
0 },
{
49296,
"TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256",
0 },
{
49297,
"TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384",
0 },
{
49298,
"TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256",
0 },
{
49299,
"TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384",
0 },
{
49300,
"TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256",
0 },
{
49301,
"TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384",
0 },
{
49302,
"TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256",
0 },
{
49303,
"TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384",
0 },
{
49304,
"TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256",
0 },
{
49305,
"TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384",
0 },
{
49306,
"TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256",
0 },
{
49307,
"TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384",
0 },
{
49308,
"TLS_RSA_WITH_AES_128_CCM",
0 },
{
49309,
"TLS_RSA_WITH_AES_256_CCM",
0 },
{
49310,
"TLS_DHE_RSA_WITH_AES_128_CCM",
0 },
{
49311,
"TLS_DHE_RSA_WITH_AES_256_CCM",
0 },
{
49312,
"TLS_RSA_WITH_AES_128_CCM_8",
0 },
{
49313,
"TLS_RSA_WITH_AES_256_CCM_8",
0 },
{
49314,
"TLS_DHE_RSA_WITH_AES_128_CCM_8",
0 },
{
49315,
"TLS_DHE_RSA_WITH_AES_256_CCM_8",
0 },
{
49316,
"TLS_PSK_WITH_AES_128_CCM",
0 },
{
49317,
"TLS_PSK_WITH_AES_256_CCM",
0 },
{
49318,
"TLS_DHE_PSK_WITH_AES_128_CCM",
0 },
{
49319,
"TLS_DHE_PSK_WITH_AES_256_CCM",
0 },
{
49320,
"TLS_PSK_WITH_AES_128_CCM_8",
0 },
{
49321,
"TLS_PSK_WITH_AES_256_CCM_8",
0 },
{
49322,
"TLS_PSK_DHE_WITH_AES_128_CCM_8",
0 },
{
49323,
"TLS_PSK_DHE_WITH_AES_256_CCM_8",
0 },
{
49324,
"TLS_ECDHE_ECDSA_WITH_AES_128_CCM",
0 },
{
49325,
"TLS_ECDHE_ECDSA_WITH_AES_256_CCM",
0 },
{
49326,
"TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8",
0 },
{
49327,
"TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8",
0 },
{
52392,
"TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256",
0 },
{
52393,
"TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256",
0 },
{
52394,
"TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256",
0 },
{
52395,
"TLS_PSK_WITH_CHACHA20_POLY1305_SHA256",
0 },
{
52396,
"TLS_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256",
0 },
{
52397,
"TLS_DHE_PSK_WITH_CHACHA20_POLY1305_SHA256",
0 },
{
52398,
"TLS_RSA_PSK_WITH_CHACHA20_POLY1305_SHA256",
0 },
// DRAFT-IETF-TLS-ECC
{
71,
"TLS_ECDH_ECDSA_WITH_NULL_SHA",
0 },
{
72,
"TLS_ECDH_ECDSA_WITH_RC4_128_SHA",
0 },
{
73,
"TLS_ECDH_ECDSA_WITH_DES_CBC_SHA",
0 },
{
74,
"TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA",
0 },
{
75,
"TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA",
0 },
{
76,
"TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA",
0 },
{
75,
"TLS_ECDH_ECDSA_EXPORT_WITH_RC4_40_SHA",
0 },
{
76,
"TLS_ECDH_ECDSA_EXPORT_WITH_RC4_56_SHA",
0 },
{
77,
"TLS_ECDH_RSA_WITH_NULL_SHA",
0 },
{
78,
"TLS_ECDH_RSA_WITH_RC4_128_SHA",
0 },
{
79,
"TLS_ECDH_RSA_WITH_DES_CBC_SHA",
0 },
{
80,
"TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA",
0 },
{
81,
"TLS_ECDH_RSA_WITH_AES_128_CBC_SHA",
0 },
{
82,
"TLS_ECDH_RSA_WITH_AES_256_CBC_SHA",
0 },
{
83,
"TLS_ECDH_RSA_EXPORT_WITH_RC4_40_SHA",
0 },
{
84,
"TLS_ECDH_RSA_EXPORT_WITH_RC4_56_SHA",
0 },
{
85,
"TLS_ECDH_anon_NULL_WITH_SHA",
0 },
{
86,
"TLS_ECDH_anon_WITH_RC4_128_SHA",
0 },
{
87,
"TLS_ECDH_anon_WITH_DES_CBC_SHA",
0 },
{
88,
"TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA",
0 },
{
89,
"TLS_ECDH_anon_EXPORT_WITH_DES40_CBC_SHA",
0 },
{
90,
"TLS_ECDH_anon_EXPORT_WITH_RC4_40_SHA",
0 },
// DRAFT-IETF-TLS-56-BIT-CIPHERSUITES
{
96, 96,
"TLS_RSA_EXPORT1024_WITH_RC4_56_MD5", "TLS_RSA_EXPORT1024_WITH_RC4_56_MD5",
0 }, 0 },
{ {
97, 97,
"TLS_RSA_EXPORT1024_WITH_RC2_CBC_56_MD5", "TLS_RSA_EXPORT1024_WITH_RC2_CBC_56_MD5",
0 }, 0 },
{ {
98, 98,
"TLS_RSA_EXPORT1024_WITH_DES_CBC_SHA", "TLS_RSA_EXPORT1024_WITH_DES_CBC_SHA",
skipping to change at line 619 skipping to change at line 2045
{ {
99, 99,
"TLS_DHE_DSS_EXPORT1024_WITH_DES_CBC_SHA", "TLS_DHE_DSS_EXPORT1024_WITH_DES_CBC_SHA",
0 }, 0 },
{ {
100, 100,
"TLS_RSA_EXPORT1024_WITH_RC4_56_SHA", "TLS_RSA_EXPORT1024_WITH_RC4_56_SHA",
0 }, 0 },
{ {
101, 101,
"TLS_DHE_DSS_WITH_RC2_56_CBC_SHA", "TLS_DHE_DSS_EXPORT1024_WITH_RC4_56_SHA",
0 }, 0 },
{ {
102, 102,
"TLS_DHE_DSS_WITH_RC4_128_SHA", "TLS_DHE_DSS_WITH_RC4_128_SHA",
0 }, 0 },
// FIPS SSL (Netscape)
{ {
103, 65278,
"TLS_DHE_DSS_WITH_NULL_SHA", "SSL_RSA_FIPS_WITH_DES_CBC_SHA",
0 }, 0 },
{ {
65279,
"SSL_RSA_FIPS_WITH_3DES_EDE_CBC_SHA",
0 },
// SSL 2.0
{
65664, 65664,
"SSL2_CK_RC4", "SSL2_RC4_128_WITH_MD5",
0 }, 0 },
{ {
131200, 131200,
"SSL2_CK_RC4_EXPORT40", "SSL2_RC4_128_EXPORT40_WITH_MD5",
0 }, 0 },
{ {
196736, 196736,
"SSL2_CK_RC2", "SSL2_RC2_CBC_128_CBC_WITH_MD5",
0 }, 0 },
{ {
262272, 262272,
"SSL2_CK_RC2_EXPORT40", "SSL2_RC2_128_CBC_EXPORT40_WITH_MD5",
0 }, 0 },
{ {
327808, 327808,
"SSL2_CK_IDEA", "SSL2_IDEA_128_CBC_WITH_MD5",
0 }, 0 },
{ {
393280, 393280,
"SSL2_CK_DES", "SSL2_DES_64_CBC_WITH_MD5",
0 }, 0 },
{ {
524416, 393536,
"SSL2_CK_RC464", "SSL2_DES_64_CBC_WITH_SHA",
0 }, 0 },
{ {
458944, 458944,
"SSL2_CK_3DES", "SSL2_DES_192_EDE3_CBC_WITH_MD5",
0 }, 0 },
{ {
74, 459200,
"TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA", "SSL2_DES_192_EDE3_CBC_WITH_SHA",
0 }, 0 },
{ {
72, 524416,
"TLS_ECDH_ECDSA_WITH_RC4_128_SHA", "SSL2_RC4_64_WITH_MD5",
0 }, 0 },
{ {
65408, 2570,
"SSL_RSA_WITH_RC2_CBC_MD5", "GREASE 0x0A0A",
0 }, 0 },
{ {
73, 6682,
"TLS_ECDH_ECDSA_WITH_DES_CBC_SHA", "GREASE 0x1A1A",
0 }, 0 },
{ {
65413, 10794,
"TLS_ECDH_ECDSA_EXPORT_WITH_RC4_56_SHA", "GREASE 0x2A2A",
0 }, 0 },
{ {
65412, 14906,
"TLS_ECDH_ECDSA_EXPORT_WITH_RC4_40_SHA", "GREASE 0x3A3A",
0 },
{
19018,
"GREASE 0x4A4A",
0 },
{
23130,
"GREASE 0x5A5A",
0 },
{
27242,
"GREASE 0x6A6A",
0 },
{
31354,
"GREASE 0x7A7A",
0 },
{
35466,
"GREASE 0x8A8A",
0 },
{
39578,
"GREASE 0x9A9A",
0 },
{
43690,
"GREASE 0xAAAA",
0 },
{
47802,
"GREASE 0xBABA",
0 },
{
51914,
"GREASE 0xCACA",
0 },
{
56026,
"GREASE 0xDADA",
0 },
{
60138,
"GREASE 0xEAEA",
0 },
{
64250,
"GREASE 0xFAFA",
0 }, 0 },
{-1} {-1}
}; };
static int decode_AlertLevel_warning(ssl,dir,seg,data) static int decode_AlertLevel_warning(ssl,dir,seg,data)
ssl_obj *ssl; ssl_obj *ssl;
int dir; int dir;
segment *seg; segment *seg;
Data *data; 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); return(0);
} }
static int decode_AlertLevel_fatal(ssl,dir,seg,data) static int decode_AlertLevel_fatal(ssl,dir,seg,data)
ssl_obj *ssl; ssl_obj *ssl;
int dir; int dir;
segment *seg; segment *seg;
Data *data; Data *data;
{ {
struct json_object *jobj;
jobj = ssl->cur_json_st;
json_object_object_add(jobj, "alert_level", json_object_new_string("fatal"))
;
return(0); return(0);
} }
decoder AlertLevel_decoder[]={ decoder AlertLevel_decoder[]={
{ {
1, 1,
"warning", "warning",
decode_AlertLevel_warning decode_AlertLevel_warning
}, },
{ {
2, 2,
"fatal", "fatal",
decode_AlertLevel_fatal decode_AlertLevel_fatal
}, },
{0} {-1}
}; };
static int decode_AlertDescription_close_notify(ssl,dir,seg,data) static int decode_AlertDescription_close_notify(ssl,dir,seg,data)
ssl_obj *ssl; ssl_obj *ssl;
int dir; int dir;
segment *seg; segment *seg;
Data *data; Data *data;
{ {
return(0); return(0);
} }
skipping to change at line 1018 skipping to change at line 2504
{ {
90, 90,
"user_canceled", "user_canceled",
decode_AlertDescription_user_canceled decode_AlertDescription_user_canceled
}, },
{ {
100, 100,
"no_renegotiation", "no_renegotiation",
decode_AlertDescription_no_renegotiation decode_AlertDescription_no_renegotiation
}, },
{0} {-1}
}; };
decoder compression_method_decoder[]={ decoder compression_method_decoder[]={
{ {
0, 0,
"NULL", "NULL",
0 }, 0 },
{-1} {-1}
}; };
skipping to change at line 1082 skipping to change at line 2568
{ {
3, 3,
"rsa_fixed_dh", "rsa_fixed_dh",
decode_client_certificate_type_rsa_fixed_dh decode_client_certificate_type_rsa_fixed_dh
}, },
{ {
4, 4,
"dss_fixed_dh", "dss_fixed_dh",
decode_client_certificate_type_dss_fixed_dh decode_client_certificate_type_dss_fixed_dh
}, },
{0} {-1}
};
static int decode_extension_server_name(ssl,dir,seg,data)
ssl_obj *ssl;
int dir;
segment *seg;
Data *data;
{
UINT4 t,l;
int r,p;
extern decoder server_name_type_decoder[];
SSL_DECODE_UINT16(ssl,"extension length",0,data,&l);
if(dir==DIR_I2R){
SSL_DECODE_UINT16(ssl,"server name list length",0,data,&l);
LF;
while(l) {
p=data->len;
SSL_DECODE_UINT8(ssl, "server name type", 0, data, &t);
if (ssl_decode_switch(ssl,server_name_type_decoder,t,dir,seg,data) == R_N
OT_FOUND) {
decode_server_name(ssl,dir,seg,data);
P_(P_RH){
explain(ssl, "Server Name type: %u not yet implemented in ssldump\n",
t);
}
continue;
}
l-=(p-data->len);
}
}
else{
data->len-=l;
data->data+=l;
}
return(0);
}
static int decode_extension_encrypt_then_mac(ssl,dir,seg,data)
ssl_obj *ssl;
int dir;
segment *seg;
Data *data;
{
int r,*etm;
UINT4 l;
etm=&ssl->extensions->encrypt_then_mac;
SSL_DECODE_UINT16(ssl,"extension length",0,data,&l);
data->len-=l;
data->data+=l;
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;
{
int r,*ems;
UINT4 l;
ems=&ssl->extensions->extended_master_secret;
SSL_DECODE_UINT16(ssl,"extension length",0,data,&l);
data->len-=l;
data->data+=l;
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;
{
int r;
UINT4 l;
SSL_DECODE_UINT16(ssl,"extension length",0,data,&l);
data->len-=l;
data->data+=l;
return(0);
}
decoder extension_decoder[] = {
{
0,
"server_name",
decode_extension_server_name,
},
{
1,
"max_fragment_length",
decode_extension
},
{
2,
"client_certificate_url",
decode_extension
},
{
3,
"trusted_ca_keys",
decode_extension
},
{
4,
"truncated_hmac",
decode_extension
},
{
5,
"status_request",
decode_extension
},
{
6,
"user_mapping",
decode_extension
},
{
7,
"client_authz",
decode_extension
},
{
8,
"server_authz",
decode_extension
},
{
9,
"cert_type",
decode_extension
},
{
10,
"supported_groups",
decode_extension
},
{
11,
"ec_point_formats",
decode_extension
},
{
12,
"srp",
decode_extension
},
{
13,
"signature_algorithms",
decode_extension
},
{
14,
"use_srtp",
decode_extension
},
{
15,
"heartbeat",
decode_extension
},
{
16,
"application_layer_protocol_negotiation",
decode_extension
},
{
17,
"status_request_v2",
decode_extension
},
{
18,
"signed_certificate_timestamp",
decode_extension
},
{
19,
"client_certificate_type",
decode_extension
},
{
20,
"server_certificate_type",
decode_extension
},
{
21,
"padding",
decode_extension
},
{
22,
"encrypt_then_mac",
decode_extension_encrypt_then_mac
},
{
23,
"extended_master_secret",
decode_extension_extended_master_secret
},
{
24,
"token_binding",
decode_extension
},
{
25,
"cached_info",
decode_extension
},
{
26,
"tls_lts",
decode_extension
},
{
27,
"compress_certificate",
decode_extension
},
{
28,
"record_size_limit",
decode_extension
},
{
29,
"pwd_protect",
decode_extension
},
{
30,
"pwd_clear",
decode_extension
},
{
31,
"password_salt",
decode_extension
},
{
32,
"ticket_pinning",
decode_extension
},
{
33,
"tls_cert_with_extern_psk",
decode_extension
},
{
34,
"delegated_credentials",
decode_extension
},
{
35,
"session_ticket",
decode_extension
},
{
36,
"TLMSP",
decode_extension
},
{
37,
"TLMSP_proxying",
decode_extension
},
{
38,
"TLMSP_delegate",
decode_extension
},
{
39,
"supported_ekt_ciphers",
decode_extension
},
{
41,
"pre_shared_key",
decode_extension
},
{
42,
"early_data",
decode_extension
},
{
43,
"supported_versions",
decode_extension
},
{
44,
"cookie",
decode_extension
},
{
45,
"psk_key_exchange_modes",
decode_extension
},
{
47,
"certificate_authorities",
decode_extension
},
{
48,
"oid_filters",
decode_extension
},
{
49,
"post_handshake_auth",
decode_extension
},
{
50,
"signature_algorithms_cert",
decode_extension
},
{
51,
"key_share",
decode_extension
},
{
52,
"transparency_info",
decode_extension
},
{
53,
"connection_id",
decode_extension
},
{
55,
"external_id_hash",
decode_extension
},
{
56,
"external_session_id",
decode_extension
},
{
13172,
"next_protocol_negotiation",
decode_extension
},
{
0xff01,
"renegotiation_info",
decode_extension
},
{-1}
};
static int decode_server_name_type_host_name(ssl,dir,seg,data)
ssl_obj *ssl;
int dir;
segment *seg;
Data *data;
{
int r;
UINT4 l;
SSL_DECODE_UINT16(ssl,"server name length",0,data,&l);
if(!(NET_print_flags & NET_PRINT_JSON))
printf(": %.*s",l,data->data);
/* Possibly use data->data to set/modify ssl->server_name */
if (l!=0)
{
char* server_name;
server_name = calloc(l+1,sizeof(char));
if (server_name != NULL)
{
if (ssl->server_name) free(ssl->server_name);
if (l > data->len) l = data->len;
memcpy(server_name,data->data,l);
ssl->server_name = server_name;
}
}
data->len-=l;
data->data+=l;
return(0);
}
static int decode_server_name(ssl,dir,seg,data)
ssl_obj *ssl;
int dir;
segment *seg;
Data *data;
{
int r;
UINT4 l;
SSL_DECODE_UINT16(ssl,"server name length",0,data,&l);
data->len-=l;
data->data+=l;
return(0);
}
decoder server_name_type_decoder[]={
{
0,
"host_name",
decode_server_name_type_host_name
},
{-1}
}; };
 End of changes. 72 change blocks. 
65 lines changed or deleted 1996 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)