|
12 | 12 | *
|
13 | 13 | * aesgcm: The version that is widely deployed with WebPush (as of 2016-11).
|
14 | 14 | * 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. |
18 | 15 | */
|
19 | 16 |
|
20 | 17 | var crypto = require('crypto');
|
21 | 18 | var base64 = require('urlsafe-base64');
|
22 | 19 |
|
23 | 20 | var AES_GCM = 'aes-128-gcm';
|
24 |
| -var PAD_SIZE = { 'aes128gcm': 1, 'aesgcm': 2, 'aesgcm128': 1 }; |
| 21 | +var PAD_SIZE = { 'aes128gcm': 1, 'aesgcm': 2 }; |
25 | 22 | var TAG_LENGTH = 16;
|
26 | 23 | var KEY_LENGTH = 16;
|
27 | 24 | var NONCE_LENGTH = 12;
|
@@ -213,12 +210,7 @@ function deriveKeyAndNonce(header, mode, lookupKeyCallback) {
|
213 | 210 | var keyInfo;
|
214 | 211 | var nonceInfo;
|
215 | 212 | 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') { |
222 | 214 | // old
|
223 | 215 | var s = extractSecretAndContext(header, mode, lookupKeyCallback);
|
224 | 216 | keyInfo = info('aesgcm', s.context);
|
@@ -360,13 +352,13 @@ function decryptRecord(key, counter, buffer, header, last) {
|
360 | 352 | * size, which are described in the draft. Binary values are base64url encoded.
|
361 | 353 | *
|
362 | 354 | * |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 |
364 | 356 | * disappear in a future release). If omitted, assume aes128gcm.
|
365 | 357 | *
|
366 | 358 | * If |params.key| is specified, that value is used as the key.
|
367 | 359 | *
|
368 | 360 | * 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 , |
370 | 362 | * |params.dh| needs to be provided with the public key of the sender.
|
371 | 363 | *
|
372 | 364 | * The |params.privateKey| includes the private key of the receiver.
|
@@ -455,7 +447,7 @@ function writeHeader(header) {
|
455 | 447 | * size, which are described in the draft.
|
456 | 448 | *
|
457 | 449 | * |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 |
459 | 451 | * disappear in a future release). If omitted, assume aes128gcm.
|
460 | 452 | *
|
461 | 453 | * If |params.key| is specified, that value is used as the key.
|
|
0 commit comments