Merge pull request #17 from mathewmarcus/fix_extension_bug

correctly handle case where server hello does not request extension s…
This commit is contained in:
Alexandre Dulaunoy 2018-07-05 09:32:42 +02:00 committed by GitHub
commit 9f5d85eec0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View file

@ -2498,7 +2498,7 @@ static int decode_extension_encrypt_then_mac(ssl,dir,seg,data)
data->len-=l; data->len-=l;
data->data+=l; data->data+=l;
*etm=dir==DIR_I2R?1:*etm==1; dir==DIR_I2R?*etm=1:++*etm;
return(0); return(0);
} }
static int decode_extension_extended_master_secret(ssl,dir,seg,data) static int decode_extension_extended_master_secret(ssl,dir,seg,data)
@ -2515,7 +2515,7 @@ static int decode_extension_extended_master_secret(ssl,dir,seg,data)
data->len-=l; data->len-=l;
data->data+=l; data->data+=l;
*ems=dir==DIR_I2R?1:*ems==1; dir==DIR_I2R?*ems=1:++*ems;
return(0); return(0);
} }
static int decode_extension(ssl,dir,seg,data) static int decode_extension(ssl,dir,seg,data)

View file

@ -180,7 +180,7 @@ int ssl_decode_rec_data(ssl,d,ct,version,in,inl,out,outl)
CRDUMP("Ciphertext",in,inl); CRDUMP("Ciphertext",in,inl);
if(ssl->extensions->encrypt_then_mac){ if(ssl->extensions->encrypt_then_mac==2){
*outl=inl; *outl=inl;
/* First strip off the MAC */ /* First strip off the MAC */

View file

@ -857,7 +857,7 @@ static int ssl_generate_keying_material(ssl,d)
if(r=r_data_alloc(&d->MS,48)) if(r=r_data_alloc(&d->MS,48))
ABORT(r); ABORT(r);
if (ssl->extensions->extended_master_secret) { if (ssl->extensions->extended_master_secret==2) {
if(r=ssl_generate_session_hash(ssl,d)) if(r=ssl_generate_session_hash(ssl,d))
ABORT(r); ABORT(r);