@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.
package/dist/openpgp.mjs 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
  const globalThis = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
3
3
 
4
4
  function _mergeNamespaces(n, m) {
@@ -1702,7 +1702,7 @@ var config = {
1702
1702
  * @memberof module:config
1703
1703
  * @property {String} versionString A version string to be included in armored messages
1704
1704
  */
1705
- versionString: 'OpenPGP.js 6.0.2-patch.0',
1705
+ versionString: 'OpenPGP.js 6.0.2-patch.1',
1706
1706
  /**
1707
1707
  * @memberof module:config
1708
1708
  * @property {String} commentString A comment string to be included in armored messages
@@ -11330,12 +11330,8 @@ async function generate$6(algo) {
11330
11330
  async function encaps$1(eccAlgo, eccRecipientPublicKey) {
11331
11331
  switch (eccAlgo) {
11332
11332
  case enums.publicKey.pqc_mlkem_x25519: {
11333
- const { ephemeralPublicKey: eccCipherText, sharedSecret: eccSharedSecret } = await generateEphemeralEncryptionMaterial(enums.publicKey.x25519, eccRecipientPublicKey);
11334
- const eccKeyShare = await hash.sha3_256(util.concatUint8Array([
11335
- eccSharedSecret,
11336
- eccCipherText,
11337
- eccRecipientPublicKey
11338
- ]));
11333
+ const { ephemeralPublicKey: eccCipherText, sharedSecret: eccKeyShare } = await generateEphemeralEncryptionMaterial(enums.publicKey.x25519, eccRecipientPublicKey);
11334
+
11339
11335
  return {
11340
11336
  eccCipherText,
11341
11337
  eccKeyShare
@@ -11349,12 +11345,7 @@ async function encaps$1(eccAlgo, eccRecipientPublicKey) {
11349
11345
  async function decaps$1(eccAlgo, eccCipherText, eccSecretKey, eccPublicKey) {
11350
11346
  switch (eccAlgo) {
11351
11347
  case enums.publicKey.pqc_mlkem_x25519: {
11352
- const eccSharedSecret = await recomputeSharedSecret(enums.publicKey.x25519, eccCipherText, eccPublicKey, eccSecretKey);
11353
- const eccKeyShare = await hash.sha3_256(util.concatUint8Array([
11354
- eccSharedSecret,
11355
- eccCipherText,
11356
- eccPublicKey
11357
- ]));
11348
+ const eccKeyShare = await recomputeSharedSecret(enums.publicKey.x25519, eccCipherText, eccPublicKey, eccSecretKey);
11358
11349
  return eccKeyShare;
11359
11350
  }
11360
11351
  default:
@@ -11466,7 +11457,7 @@ async function decrypt$1(algo, eccCipherText, mlkemCipherText, eccSecretKey, ecc
11466
11457
  async function multiKeyCombine(algo, ecdhKeyShare, ecdhCipherText, ecdhPublicKey, mlkemKeyShare, mlkemCipherText, mlkemPublicKey) {
11467
11458
  // LAMPS-aligned and NIST compatible combiner, proposed in: https://mailarchive.ietf.org/arch/msg/openpgp/NMTCy707LICtxIhP3Xt1U5C8MF0/
11468
11459
  // 2a. KDF(mlkemSS || tradSS || tradCT || tradPK || Domain)
11469
- // where Domain is "Domain" for LAMPS, and "mlkemCT || mlkemPK || algId" for OpenPGP
11460
+ // where Domain is "Domain" for LAMPS, and "mlkemCT || mlkemPK || algId || const" for OpenPGP
11470
11461
  const encData = util.concatUint8Array([
11471
11462
  mlkemKeyShare,
11472
11463
  ecdhKeyShare,
@@ -11475,7 +11466,8 @@ async function multiKeyCombine(algo, ecdhKeyShare, ecdhCipherText, ecdhPublicKey
11475
11466
  // domSep
11476
11467
  mlkemCipherText,
11477
11468
  mlkemPublicKey,
11478
- new Uint8Array([algo])
11469
+ new Uint8Array([algo]),
11470
+ util.encodeUTF8('OpenPGPCompositeKDFv1')
11479
11471
  ]);
11480
11472
 
11481
11473
  const kek = await hash.digest(enums.hash.sha3_256, encData);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@protontech/openpgp",
3
3
  "description": "OpenPGP.js is a Javascript implementation of the OpenPGP protocol. This is defined in RFC 4880.",
4
- "version": "6.0.2-patch.0",
4
+ "version": "6.0.2-patch.1",
5
5
  "license": "LGPL-3.0+",
6
6
  "homepage": "https://openpgpjs.org/",
7
7
  "engines": {