Skip to content

Commit d248683

Browse files
[refs #23] Remove aesgcm128
ece.js supported multiple versions of the draft . But the aesgcm128 was outdated as it used to be compatible with firefox 45 which has changed since then . So i removed all instances of aesgcm128 from the js file .
1 parent aadda00 commit d248683

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

nodejs/ece.js

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,13 @@
1212
*
1313
* aesgcm: The version that is widely deployed with WebPush (as of 2016-11).
1414
* This version is selected by default, unless you specify a |padSize| of 1.
15-
*
16-
* aesgcm128: This version is old and will be removed in an upcoming release.
17-
* This version is selected by providing a |padSize| parameter of 1.
1815
*/
1916

2017
var crypto = require('crypto');
2118
var base64 = require('urlsafe-base64');
2219

2320
var AES_GCM = 'aes-128-gcm';
24-
var PAD_SIZE = { 'aes128gcm': 1, 'aesgcm': 2, 'aesgcm128': 1 };
21+
var PAD_SIZE = { 'aes128gcm': 1, 'aesgcm': 2 };
2522
var TAG_LENGTH = 16;
2623
var KEY_LENGTH = 16;
2724
var NONCE_LENGTH = 12;
@@ -213,12 +210,7 @@ function deriveKeyAndNonce(header, mode, lookupKeyCallback) {
213210
var keyInfo;
214211
var nonceInfo;
215212
var secret;
216-
if (header.version === 'aesgcm128') {
217-
// really old
218-
keyInfo = 'Content-Encoding: aesgcm128';
219-
nonceInfo = 'Content-Encoding: nonce';
220-
secret = extractSecretAndContext(header, mode, lookupKeyCallback).secret;
221-
} else if (header.version === 'aesgcm') {
213+
if (header.version === 'aesgcm') {
222214
// old
223215
var s = extractSecretAndContext(header, mode, lookupKeyCallback);
224216
keyInfo = info('aesgcm', s.context);
@@ -360,13 +352,13 @@ function decryptRecord(key, counter, buffer, header, last) {
360352
* size, which are described in the draft. Binary values are base64url encoded.
361353
*
362354
* |params.version| contains the version of encoding to use: aes128gcm is the latest,
363-
* but aesgcm and aesgcm128 are also accepted (though the latter two might
355+
* but aesgcm is also accepted (though the latter might
364356
* disappear in a future release). If omitted, assume aes128gcm.
365357
*
366358
* If |params.key| is specified, that value is used as the key.
367359
*
368360
* If the version is aes128gcm, the keyid is extracted from the header and used
369-
* as the ECDH public key of the sender. For version aesgcm and aesgcm128,
361+
* as the ECDH public key of the sender. For version aesgcm ,
370362
* |params.dh| needs to be provided with the public key of the sender.
371363
*
372364
* The |params.privateKey| includes the private key of the receiver.
@@ -455,7 +447,7 @@ function writeHeader(header) {
455447
* size, which are described in the draft.
456448
*
457449
* |params.version| contains the version of encoding to use: aes128gcm is the latest,
458-
* but aesgcm and aesgcm128 are also accepted (though the latter two might
450+
* but aesgcm is also accepted (though the latter two might
459451
* disappear in a future release). If omitted, assume aes128gcm.
460452
*
461453
* If |params.key| is specified, that value is used as the key.

0 commit comments

Comments
 (0)