Skip to content

Commit 049a96d

Browse files
committed
Merge pull request #18 from marco-c/support_firefox_intermediate_standard
Support Firefox intermediate standard
2 parents 8b88ea8 + 35d6d7c commit 049a96d

4 files changed

Lines changed: 15 additions & 6 deletions

File tree

nodejs/ece.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff 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);

nodejs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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",

python/http_ece/__init__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff 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

python/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
setup(
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=[],

0 commit comments

Comments
 (0)