Fix for type casting related warnings

This commit is contained in:
William Robinet 2020-10-06 10:38:04 +02:00
parent 11564b1264
commit f2da9fa2d5
5 changed files with 29 additions and 24 deletions

View file

@ -2521,8 +2521,8 @@ static int decode_extension_server_name(ssl,dir,seg,data)
segment *seg; segment *seg;
Data *data; Data *data;
{ {
UINT4 t; UINT4 t,l;
int l,r,p; int r,p;
extern decoder server_name_type_decoder[]; extern decoder server_name_type_decoder[];
@ -2557,7 +2557,8 @@ static int decode_extension_encrypt_then_mac(ssl,dir,seg,data)
segment *seg; segment *seg;
Data *data; Data *data;
{ {
int l,r,*etm; int r,*etm;
UINT4 l;
etm=&ssl->extensions->encrypt_then_mac; etm=&ssl->extensions->encrypt_then_mac;
@ -2574,7 +2575,8 @@ static int decode_extension_extended_master_secret(ssl,dir,seg,data)
segment *seg; segment *seg;
Data *data; Data *data;
{ {
int l,r,*ems; int r,*ems;
UINT4 l;
ems=&ssl->extensions->extended_master_secret; ems=&ssl->extensions->extended_master_secret;
@ -2591,7 +2593,8 @@ static int decode_extension(ssl,dir,seg,data)
segment *seg; segment *seg;
Data *data; Data *data;
{ {
int l,r; int r;
UINT4 l;
SSL_DECODE_UINT16(ssl,"extension length",0,data,&l); SSL_DECODE_UINT16(ssl,"extension length",0,data,&l);
data->len-=l; data->len-=l;
data->data+=l; data->data+=l;
@ -2670,7 +2673,8 @@ static int decode_server_name_type_host_name(ssl,dir,seg,data)
segment *seg; segment *seg;
Data *data; Data *data;
{ {
int l,r; int r;
UINT4 l;
SSL_DECODE_UINT16(ssl,"server name length",0,data,&l); SSL_DECODE_UINT16(ssl,"server name length",0,data,&l);
printf(": %.*s",l,data->data); printf(": %.*s",l,data->data);
@ -2697,7 +2701,8 @@ static int decode_server_name(ssl,dir,seg,data)
segment *seg; segment *seg;
Data *data; Data *data;
{ {
int l,r; int r;
UINT4 l;
SSL_DECODE_UINT16(ssl,"server name length",0,data,&l); SSL_DECODE_UINT16(ssl,"server name length",0,data,&l);
data->len-=l; data->len-=l;
data->data+=l; data->data+=l;

View file

@ -77,7 +77,7 @@ typedef struct ssl_obj_ {
int r_state; int r_state;
int i_state; int i_state;
int version; int version;
int cipher_suite; UINT4 cipher_suite;
char *client_name; char *client_name;
int client_port; int client_port;

View file

@ -490,7 +490,7 @@ static int ssl_create_session_lookup_key(ssl,id,idlen,keyp,keyl)
key+=idlen; key+=idlen;
snprintf((char *)key,l,"%s:%d",ssl->server_name,ssl->server_port); snprintf((char *)key,l,"%s:%d",ssl->server_name,ssl->server_port);
*keyl+=strlen(key); *keyl+=strlen((char *)key);
_status=0; _status=0;
abort: abort:
@ -885,10 +885,10 @@ static int ssl3_prf(ssl,secret,usage,r1,r2,out)
MD5_Update(&md5,secret->data,secret->len); MD5_Update(&md5,secret->data,secret->len);
MD5_Update(&md5,buf,20); MD5_Update(&md5,buf,20);
MD5_Final(outbuf,&md5); MD5_Final((unsigned char *)outbuf,&md5);
tocpy=MIN(out->len-off,16); tocpy=MIN(out->len-off,16);
memcpy(out->data+off,outbuf,tocpy); memcpy(out->data+off,outbuf,tocpy);
CRDUMP("MD5 out",outbuf,16); CRDUMP("MD5 out",(UCHAR *)outbuf,16);
MD5_Init(&md5); MD5_Init(&md5);
} }
@ -1084,7 +1084,7 @@ static int ssl_generate_session_hash(ssl,d)
EVP_DigestInit(dgictx,md); EVP_DigestInit(dgictx,md);
EVP_DigestUpdate(dgictx,d->handshake_messages->data,d->handshake_messages->len); EVP_DigestUpdate(dgictx,d->handshake_messages->data,d->handshake_messages->len);
EVP_DigestFinal(dgictx,d->session_hash->data,&d->session_hash->len); EVP_DigestFinal(dgictx,d->session_hash->data,(unsigned int *) &d->session_hash->len);
break; break;
case SSLV3_VERSION: case SSLV3_VERSION:
@ -1092,7 +1092,7 @@ static int ssl_generate_session_hash(ssl,d)
case TLSV11_VERSION: case TLSV11_VERSION:
EVP_DigestInit(dgictx,EVP_get_digestbyname("MD5")); EVP_DigestInit(dgictx,EVP_get_digestbyname("MD5"));
EVP_DigestUpdate(dgictx,d->handshake_messages->data,d->handshake_messages->len); EVP_DigestUpdate(dgictx,d->handshake_messages->data,d->handshake_messages->len);
EVP_DigestFinal_ex(dgictx,d->session_hash->data,&d->session_hash->len); EVP_DigestFinal_ex(dgictx,d->session_hash->data,(unsigned int *) &d->session_hash->len);
EVP_DigestInit(dgictx,EVP_get_digestbyname("SHA1")); EVP_DigestInit(dgictx,EVP_get_digestbyname("SHA1"));
EVP_DigestUpdate(dgictx,d->handshake_messages->data,d->handshake_messages->len); EVP_DigestUpdate(dgictx,d->handshake_messages->data,d->handshake_messages->len);

View file

@ -93,13 +93,13 @@ int process_v2_hello(ssl,seg)
{ {
int r; int r;
int rec_len; int rec_len;
int cs_len; UINT4 cs_len;
int sid_len; UINT4 sid_len;
int chall_len; UINT4 chall_len;
int ver; UINT4 ver;
Data d; Data d;
Data chall; Data chall;
char random[32]; UCHAR random[32];
if(seg->len==0) if(seg->len==0)
return(SSL_NO_DATA); return(SSL_NO_DATA);
@ -472,7 +472,7 @@ int combodump(ssl,name,data)
char *name; char *name;
Data *data; Data *data;
{ {
char *ptr=data->data; UCHAR *ptr=data->data;
int len=data->len; int len=data->len;
if(name){ if(name){

View file

@ -81,7 +81,7 @@ int sslx_print_certificate(ssl,data,pf)
d=data->data; d=data->data;
if(!(x=d2i_X509(0,&d,data->len))){ if(!(x=d2i_X509(0,(const unsigned char **) &d,data->len))){
explain(ssl,"Bad certificate"); explain(ssl,"Bad certificate");
ABORT(R_BAD_DATA); ABORT(R_BAD_DATA);
} }
@ -114,7 +114,7 @@ int sslx_print_certificate(ssl,data,pf)
ex=X509_get_ext(x,i); ex=X509_get_ext(x,i);
obj=X509_EXTENSION_get_object(ex); obj=X509_EXTENSION_get_object(ex);
i2t_ASN1_OBJECT(buf,sizeof(buf),obj); i2t_ASN1_OBJECT((char *)buf,sizeof(buf),obj);
explain(ssl,"Extension: %s\n",buf); explain(ssl,"Extension: %s\n",buf);
j=X509_EXTENSION_get_critical(ex); j=X509_EXTENSION_get_critical(ex);
@ -173,10 +173,10 @@ int sslx_print_dn(ssl,data,pf)
P_(pf){ P_(pf){
#ifdef OPENSSL #ifdef OPENSSL
P_(P_ASN){ P_(P_ASN){
if(!(n=d2i_X509_NAME(0,&d,data->len))) if(!(n=d2i_X509_NAME(0,(const unsigned char **) &d,data->len)))
ABORT(R_BAD_DATA); ABORT(R_BAD_DATA);
X509_NAME_oneline(n,buf,BUFSIZE); X509_NAME_oneline(n,(char *)buf,BUFSIZE);
sslx__print_dn(ssl,buf); sslx__print_dn(ssl,(char *)buf);
} }
else{ else{
#endif #endif