File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -142,8 +142,13 @@ function deriveKeyAndNonce(params, mode) {
142142 var keyInfo ;
143143 var nonceInfo ;
144144 if ( padSize === 1 ) {
145- keyInfo = 'Content-Encoding: aesgcm128' ;
146- nonceInfo = 'Content-Encoding: nonce' ;
145+ if ( params . authSecret ) {
146+ keyInfo = info ( 'aesgcm128' , s . context ) ;
147+ nonceInfo = info ( 'nonce' , s . context ) ;
148+ } else {
149+ keyInfo = 'Content-Encoding: aesgcm128' ;
150+ nonceInfo = 'Content-Encoding: nonce' ;
151+ }
147152 } else if ( padSize === 2 ) {
148153 keyInfo = info ( 'aesgcm' , s . context ) ;
149154 nonceInfo = info ( 'nonce' , s . context ) ;
Original file line number Diff line number Diff line change 11{
22 "name" : " http_ece" ,
3- "version" : " 0.4.4 " ,
3+ "version" : " 0.4.5 " ,
44 "description" : " Encrypted Content-Encoding for HTTP" ,
55 "homepage" : " https://github.com/martinthomson/encrypted-content-encoding" ,
66 "bugs" : " https://github.com/martinthomson/encrypted-content-encoding/issues" ,
Original file line number Diff line number Diff line change @@ -67,8 +67,12 @@ def lengthPrefix(key):
6767 keyinfo = buildInfo (b"aesgcm" , context )
6868 nonceinfo = buildInfo (b"nonce" , context )
6969 elif padSize == 1 :
70- keyinfo = b"Content-Encoding: aesgcm128"
71- nonceinfo = b"Content-Encoding: nonce"
70+ if authSecret is not None :
71+ keyinfo = buildInfo (b"aesgcm128" , context )
72+ nonceinfo = buildInfo (b"nonce" , context )
73+ else :
74+ keyinfo = b"Content-Encoding: aesgcm128"
75+ nonceinfo = b"Content-Encoding: nonce"
7276 else :
7377 raise Exception (u"unable to set context for padSize=" + str (padSize ))
7478
Original file line number Diff line number Diff line change 33
44setup (
55 name = 'http_ece' ,
6- version = '0.4.4 ' ,
6+ version = '0.4.5 ' ,
77 author = 'Martin Thomson' ,
88 author_email = 'martin.thomson@gmail.com' ,
99 scripts = [],
You can’t perform that action at this time.
0 commit comments