@protontech/openpgp 6.0.2-patch.0 → 6.0.2-patch.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- /*! OpenPGP.js v6.0.2-patch.0 - 2024-11-27 - this is LGPL licensed code, see LICENSE/our website https://openpgpjs.org/ for more information. */
1
+ /*! OpenPGP.js v6.0.2-patch.1 - 2024-12-13 - this is LGPL licensed code, see LICENSE/our website https://openpgpjs.org/ for more information. */
2
2
  const globalThis = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
3
3
 
4
4
  import { createRequire } from 'module';
@@ -1706,7 +1706,7 @@ var config = {
1706
1706
  * @memberof module:config
1707
1707
  * @property {String} versionString A version string to be included in armored messages
1708
1708
  */
1709
- versionString: 'OpenPGP.js 6.0.2-patch.0',
1709
+ versionString: 'OpenPGP.js 6.0.2-patch.1',
1710
1710
  /**
1711
1711
  * @memberof module:config
1712
1712
  * @property {String} commentString A comment string to be included in armored messages
@@ -11340,12 +11340,8 @@ async function generate$6(algo) {
11340
11340
  async function encaps$1(eccAlgo, eccRecipientPublicKey) {
11341
11341
  switch (eccAlgo) {
11342
11342
  case enums.publicKey.pqc_mlkem_x25519: {
11343
- const { ephemeralPublicKey: eccCipherText, sharedSecret: eccSharedSecret } = await generateEphemeralEncryptionMaterial(enums.publicKey.x25519, eccRecipientPublicKey);
11344
- const eccKeyShare = await hash.sha3_256(util.concatUint8Array([
11345
- eccSharedSecret,
11346
- eccCipherText,
11347
- eccRecipientPublicKey
11348
- ]));
11343
+ const { ephemeralPublicKey: eccCipherText, sharedSecret: eccKeyShare } = await generateEphemeralEncryptionMaterial(enums.publicKey.x25519, eccRecipientPublicKey);
11344
+
11349
11345
  return {
11350
11346
  eccCipherText,
11351
11347
  eccKeyShare
@@ -11359,12 +11355,7 @@ async function encaps$1(eccAlgo, eccRecipientPublicKey) {
11359
11355
  async function decaps$1(eccAlgo, eccCipherText, eccSecretKey, eccPublicKey) {
11360
11356
  switch (eccAlgo) {
11361
11357
  case enums.publicKey.pqc_mlkem_x25519: {
11362
- const eccSharedSecret = await recomputeSharedSecret(enums.publicKey.x25519, eccCipherText, eccPublicKey, eccSecretKey);
11363
- const eccKeyShare = await hash.sha3_256(util.concatUint8Array([
11364
- eccSharedSecret,
11365
- eccCipherText,
11366
- eccPublicKey
11367
- ]));
11358
+ const eccKeyShare = await recomputeSharedSecret(enums.publicKey.x25519, eccCipherText, eccPublicKey, eccSecretKey);
11368
11359
  return eccKeyShare;
11369
11360
  }
11370
11361
  default:
@@ -11476,7 +11467,7 @@ async function decrypt$1(algo, eccCipherText, mlkemCipherText, eccSecretKey, ecc
11476
11467
  async function multiKeyCombine(algo, ecdhKeyShare, ecdhCipherText, ecdhPublicKey, mlkemKeyShare, mlkemCipherText, mlkemPublicKey) {
11477
11468
  // LAMPS-aligned and NIST compatible combiner, proposed in: https://mailarchive.ietf.org/arch/msg/openpgp/NMTCy707LICtxIhP3Xt1U5C8MF0/
11478
11469
  // 2a. KDF(mlkemSS || tradSS || tradCT || tradPK || Domain)
11479
- // where Domain is "Domain" for LAMPS, and "mlkemCT || mlkemPK || algId" for OpenPGP
11470
+ // where Domain is "Domain" for LAMPS, and "mlkemCT || mlkemPK || algId || const" for OpenPGP
11480
11471
  const encData = util.concatUint8Array([
11481
11472
  mlkemKeyShare,
11482
11473
  ecdhKeyShare,
@@ -11485,7 +11476,8 @@ async function multiKeyCombine(algo, ecdhKeyShare, ecdhCipherText, ecdhPublicKey
11485
11476
  // domSep
11486
11477
  mlkemCipherText,
11487
11478
  mlkemPublicKey,
11488
- new Uint8Array([algo])
11479
+ new Uint8Array([algo]),
11480
+ util.encodeUTF8('OpenPGPCompositeKDFv1')
11489
11481
  ]);
11490
11482
 
11491
11483
  const kek = await hash.digest(enums.hash.sha3_256, encData);
package/dist/openpgp.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! OpenPGP.js v6.0.2-patch.0 - 2024-11-27 - this is LGPL licensed code, see LICENSE/our website https://openpgpjs.org/ for more information. */
1
+ /*! OpenPGP.js v6.0.2-patch.1 - 2024-12-13 - this is LGPL licensed code, see LICENSE/our website https://openpgpjs.org/ for more information. */
2
2
  var openpgp = (function (exports) {
3
3
  'use strict';
4
4
 
@@ -1705,7 +1705,7 @@ var openpgp = (function (exports) {
1705
1705
  * @memberof module:config
1706
1706
  * @property {String} versionString A version string to be included in armored messages
1707
1707
  */
1708
- versionString: 'OpenPGP.js 6.0.2-patch.0',
1708
+ versionString: 'OpenPGP.js 6.0.2-patch.1',
1709
1709
  /**
1710
1710
  * @memberof module:config
1711
1711
  * @property {String} commentString A comment string to be included in armored messages
@@ -11333,12 +11333,8 @@ var openpgp = (function (exports) {
11333
11333
  async function encaps$1(eccAlgo, eccRecipientPublicKey) {
11334
11334
  switch (eccAlgo) {
11335
11335
  case enums.publicKey.pqc_mlkem_x25519: {
11336
- const { ephemeralPublicKey: eccCipherText, sharedSecret: eccSharedSecret } = await generateEphemeralEncryptionMaterial(enums.publicKey.x25519, eccRecipientPublicKey);
11337
- const eccKeyShare = await hash.sha3_256(util.concatUint8Array([
11338
- eccSharedSecret,
11339
- eccCipherText,
11340
- eccRecipientPublicKey
11341
- ]));
11336
+ const { ephemeralPublicKey: eccCipherText, sharedSecret: eccKeyShare } = await generateEphemeralEncryptionMaterial(enums.publicKey.x25519, eccRecipientPublicKey);
11337
+
11342
11338
  return {
11343
11339
  eccCipherText,
11344
11340
  eccKeyShare
@@ -11352,12 +11348,7 @@ var openpgp = (function (exports) {
11352
11348
  async function decaps$1(eccAlgo, eccCipherText, eccSecretKey, eccPublicKey) {
11353
11349
  switch (eccAlgo) {
11354
11350
  case enums.publicKey.pqc_mlkem_x25519: {
11355
- const eccSharedSecret = await recomputeSharedSecret(enums.publicKey.x25519, eccCipherText, eccPublicKey, eccSecretKey);
11356
- const eccKeyShare = await hash.sha3_256(util.concatUint8Array([
11357
- eccSharedSecret,
11358
- eccCipherText,
11359
- eccPublicKey
11360
- ]));
11351
+ const eccKeyShare = await recomputeSharedSecret(enums.publicKey.x25519, eccCipherText, eccPublicKey, eccSecretKey);
11361
11352
  return eccKeyShare;
11362
11353
  }
11363
11354
  default:
@@ -11469,7 +11460,7 @@ var openpgp = (function (exports) {
11469
11460
  async function multiKeyCombine(algo, ecdhKeyShare, ecdhCipherText, ecdhPublicKey, mlkemKeyShare, mlkemCipherText, mlkemPublicKey) {
11470
11461
  // LAMPS-aligned and NIST compatible combiner, proposed in: https://mailarchive.ietf.org/arch/msg/openpgp/NMTCy707LICtxIhP3Xt1U5C8MF0/
11471
11462
  // 2a. KDF(mlkemSS || tradSS || tradCT || tradPK || Domain)
11472
- // where Domain is "Domain" for LAMPS, and "mlkemCT || mlkemPK || algId" for OpenPGP
11463
+ // where Domain is "Domain" for LAMPS, and "mlkemCT || mlkemPK || algId || const" for OpenPGP
11473
11464
  const encData = util.concatUint8Array([
11474
11465
  mlkemKeyShare,
11475
11466
  ecdhKeyShare,
@@ -11478,7 +11469,8 @@ var openpgp = (function (exports) {
11478
11469
  // domSep
11479
11470
  mlkemCipherText,
11480
11471
  mlkemPublicKey,
11481
- new Uint8Array([algo])
11472
+ new Uint8Array([algo]),
11473
+ util.encodeUTF8('OpenPGPCompositeKDFv1')
11482
11474
  ]);
11483
11475
 
11484
11476
  const kek = await hash.digest(enums.hash.sha3_256, encData);