Skip to content

Commit a79c0e9

Browse files
authored
Merge branch 'master' into issue-5858-add-secure-compose-action-menus-live-test
2 parents 7198346 + aa27485 commit a79c0e9

File tree

14 files changed

+121
-100
lines changed

14 files changed

+121
-100
lines changed

conf/tsconfig.content_scripts.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"paths": {
1919
"dompurify": ["types/purify.d.ts"],
2020
"openpgp": ["../node_modules/openpgp/openpgp.d.ts"],
21-
"@openpgp/web-stream-tools": ["../node_modules/@openpgp/web-stream-tools/types/index.v4.9.d.ts"],
21+
"@openpgp/web-stream-tools": ["../node_modules/@openpgp/web-stream-tools/lib/index.d.ts"],
2222
"squire-rte": ["../node_modules/squire-rte/dist/types/Squire.d.ts"],
2323
"undici-types": ["../node_modules/undici-types/index.d.ts", "COMMENT"]
2424
},

conf/tsconfig.test.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"outDir": "../build/test",
1313
"skipLibCheck": true,
1414
"paths": {
15-
"@openpgp/web-stream-tools": ["../node_modules/@openpgp/web-stream-tools/types/index.v4.9.d.ts", "../build/streams/streams.js"]
15+
"@openpgp/web-stream-tools": ["../node_modules/@openpgp/web-stream-tools/lib/index.d.ts", "../build/generic-extension-wip/lib/streams_common.js"]
1616
}
1717
},
1818
"files": [

conf/webpack.config.js

Lines changed: 37 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,44 @@
22
//bundle the web version of @openpgp/web-stream-tools for content script
33
const path = require('path');
44

5-
module.exports = {
6-
mode: 'production',
7-
entry: {
8-
main: '../build/generic-extension-wip/lib/streams/streams.js',
9-
},
10-
output: {
11-
library: {
12-
name: 'Stream',
13-
type: 'var',
5+
module.exports = [
6+
{
7+
mode: 'production',
8+
entry: {
9+
main: '../build/generic-extension-wip/lib/streams/streams.js',
10+
},
11+
output: {
12+
library: {
13+
name: 'Stream',
14+
type: 'var',
15+
},
16+
path: path.resolve('../build/generic-extension-wip/lib'),
17+
filename: 'streams_web.js', // <--- Will be compiled to this single file
18+
},
19+
resolve: {
20+
fallback: {
21+
stream: false,
22+
},
23+
extensions: ['.js'],
1424
},
15-
path: path.resolve('../build/generic-extension-wip/lib'),
16-
filename: 'streams_web.js', // <--- Will be compiled to this single file
1725
},
18-
resolve: {
19-
fallback: {
20-
stream: false,
26+
{
27+
mode: 'production',
28+
entry: {
29+
main: '../build/generic-extension-wip/lib/streams/streams.js',
30+
},
31+
output: {
32+
library: {
33+
type: 'commonjs',
34+
},
35+
path: path.resolve('../build/generic-extension-wip/lib'),
36+
filename: 'streams_common.js', // <--- Will be compiled to this single file
37+
},
38+
resolve: {
39+
fallback: {
40+
stream: false,
41+
},
42+
extensions: ['.js'],
2143
},
22-
extensions: ['.js'],
2344
},
24-
};
45+
];

extension/js/common/core/crypto/pgp/openpgp-key.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ export class OpenPGPKey {
445445
const opt: OpenPGP.KeyOptions = { userIDs, passphrase };
446446
if (variant === 'curve25519') {
447447
opt.type = 'ecc';
448-
opt.curve = 'curve25519';
448+
opt.curve = 'curve25519Legacy';
449449
} else if (variant === 'rsa2048') {
450450
opt.type = 'rsa';
451451
opt.rsaBits = 2048;
@@ -744,6 +744,7 @@ export class OpenPGPKey {
744744
// todo: we can make it faster by manually collecting expirations from signatures?
745745
...(await Promise.all(key.subkeys.map(async subkey => OpenPGPKey.getExpirationAsDateOrUndefined(await subkey.getExpirationTime()))))
746746
.filter(Boolean)
747+
747748
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
748749
.map(expirationTime => expirationTime!.getTime())
749750
.filter(expiration => !primaryKeyExpiration || expiration < primaryKeyExpiration)

extension/js/common/core/crypto/pgp/pgp-armor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,6 @@ export class PgpArmor {
165165
}
166166

167167
public static armor(messagetype: OpenPGP.enums.armor, body: object): string {
168-
return opgp.armor(messagetype, body, undefined, undefined, undefined, opgp.config);
168+
return opgp.armor(messagetype, body, undefined, undefined, undefined, false, opgp.config);
169169
}
170170
}

package-lock.json

Lines changed: 12 additions & 41 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"graceful-fs": "4.1.13"
77
},
88
"devDependencies": {
9-
"@openpgp/web-stream-tools": "^0.0.13",
9+
"@openpgp/web-stream-tools": "^0.1.3",
1010
"@types/chai": "4.3.19",
1111
"@types/chai-as-promised": "7.1.8",
1212
"@types/chrome": "0.0.284",
@@ -29,7 +29,7 @@
2929
"lint-staged": "^15.2.10",
3030
"mailparser": "3.7.1",
3131
"mkdirp": "3.0.1",
32-
"openpgp": "5.11.2",
32+
"openpgp": "6.0.0",
3333
"pdfjs-dist": "4.8.69",
3434
"prettier": "^3.3.3",
3535
"puppeteer": "23.9.0",

test/source/mock/attester/attester-key-constants.ts

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,22 @@ export const somePubkey = `-----BEGIN PGP PUBLIC KEY BLOCK-----
3333
Version: CryptUP 3.2.0 Easy Gmail Encryption https://cryptup.org
3434
Comment: Seamlessly send, receive and search encrypted email
3535
36-
xsBNBFU0WMgBCACZSzijeN4YozhjmHU7BGWzW7ZbY6GGtJinByt8OnEnQ9TX
37-
9zrAxbyr0grPE4On7nd3uepwNxJbk5LlaCwHNkpX39xKgDgCskRO9CfeqOIO
38-
4l5Wjj4XldrgLSOGJe8Vmimo9UKmqsP5v8fR3mMyIqQbtE4G+Vq/J9A3uabr
39-
f0XYVsBdBvVoJkQ83gtQrZoTA/zihNmtLXH9pTwtX8FJcqgFK6RgvfAh2jCz
40-
DhT+reI50ZcuHRvVRxvrL172DFSQsLSdj8PcewS1J89knH4sjjBC/kwbLa0n
41-
tod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qIlql
45+
HKheCt8vB/4pLL2aMJwDgi8Qhmxfllz9mXTOn+h3LequV3ou8gDNSwByLbSrcZvd
46+
M4rlqjezQ9/Y+itALjQ3/jwhHMh4M5sDc7BXaO82eQzrpBywgLTY2km1RQ9BaoxT
47+
PQwkBDSt2Zp/XhBwYXiMtxw/d90Cu99fnitXFFZz3lkCq4zn3BeCAJmL3CHotCLe
48+
clmE7C16Y/w6t5+2AXej+lNpmBvQt2cXzDWeNxcZhJInW1MuIdUQFT8rEQ1H/r83
49+
t1RcQH6LuwetOysrY5a9DjH09mHizyt9KFu+jPP//pTXlWE0d2JX9buvkLTsm8IX
50+
jg/j+T6eFDW23ZST+PeNj4pFukc+feDa
51+
=kM8e
5152
-----END PGP PUBLIC KEY BLOCK-----`;
5253

5354
export const testMatchPubKey = `-----BEGIN PGP PUBLIC KEY BLOCK-----

test/source/tests/browser-unit-tests/unit-AttUI.js

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,27 @@ BROWSER_UNIT_TEST_NAME(`collectEncryptAtts preserves utf attachment names`);
3333
await new Promise(resolve => setTimeout(resolve, 1000)); // the above method is actually async and needs some time
3434
attachmentUi.addFile(new File([content], utfName));
3535
await new Promise(resolve => setTimeout(resolve, 1000)); // again it seems to need some time to crunch the new file
36-
const pubkey =
37-
'-----BEGIN PGP PUBLIC KEY BLOCK-----\nVersion: CryptUP 3.2.0 Easy Gmail Encryption https://cryptup.org\nComment: Seamlessly send, receive and search encrypted email\n\nxsBNBFU0WMgBCACZSzijeN4YozhjmHU7BGWzW7ZbY6GGtJinByt8OnEnQ9TX\n9zrAxbyr0grPE4On7nd3uepwNxJbk5LlaCwHNkpX39xKgDgCskRO9CfeqOIO\n4l5Wjj4XldrgLSOGJe8Vmimo9UKmqsP5v8fR3mMyIqQbtE4G+Vq/J9A3uabr\nf0XYVsBdBvVoJkQ83gtQrZoTA/zihNmtLXH9pTwtX8FJcqgFK6RgvfAh2jCz\nDhT+reI50ZcuHRvVRxvrL172DFSQsLSdj8PcewS1J89knH4sjjBC/kwbLa0n\ntod/gBPWw/uetaOJna43wNueUKKOl2kAXE4sw6ESIrlFDynJ4g05T9yxABEB\nAAHNIlRvbSBKYW1lcyBIb2x1YiA8dG9tQGJpdG9hc2lzLm5ldD7CwFwEEAEI\nABAFAlU0WM8JEA1WiOvzECvnAAAB4gf8DaIzZACUqkGEoI19HyBPtcrJT4mx\nhKZ/Wts0C6TGj/OQXevDI+h2jQTYf8+fOqCdQev2Kwh/8mQV6wQqmN9uiVXO\n5F4vAbWNfEve6mCVB5gi296mFf6kx04xC7VVYAJ3FUR72BplE/0+cwv9Nx2r\nJh3QGFhoPaFMPtCAk0TgKcO0UkcBwXNzAV5Pgz0MT1COTWBXEej4yOrqdWoP\nA6fEpV8aLaFnAt+zh3cw4A7SNAO9omGAUZeBl4Pz1IlN2lC2grc2zpqoxo8o\n3W49JYTfExeCNVWhlSU74f6bpN6CMdSdrh5phOr+ffQQhEhkNblUgSZe6tKa\nVFI1MhkJ6Xhrug==\n=+de8\n-----END PGP PUBLIC KEY BLOCK-----';
36+
const pubkey = `-----BEGIN PGP PUBLIC KEY BLOCK-----
37+
Version: CryptUP 3.2.0 Easy Gmail Encryption https://cryptup.org
38+
Comment: Seamlessly send, receive and search encrypted email
39+
40+
41+
mQENBGc9gogBCACzdC8asczNuVebgn4rQ87hBnpJcWRnYOjCFdL1mSsh6CT787kr
42+
AWdMr5xvNzCThv7n1uhWcdw4vdE87IRRiLTlx56HjkLkq/YyDC+rzf2kEVFSHpQn
43+
l0gAZrExcm7QSU3RkiyLeIhZl5TWnlk7swW4St85wurP+bEOn9hv0Csl5sNTVDYv
44+
jP02ewdm3VCe6y0s3euWo1FCOYtIx0K4IQyyghgHR94LYOtXa9nPbYLJr87Gqtto
45+
OK5yPB//ZN2t3tYwpAgpDWNQzFu/Jl0bREQFP1bVrZHhfy65UWwsxhP8REzdtl6Y
46+
t/EUM+74SC6pyEcVqCnJS8m3BmJUjGlrplT1ABEBAAG0IlRvbSBKYW1lcyBIb2x1
47+
YiA8dG9tQGJpdG9hc2lzLm5ldD6JAVEEEwEIADsWIQSMTB/Md581dynRlOzqIlql
48+
HKheCgUCZz2CiAIbLwULCQgHAgIiAgYVCgkICwIEFgIDAQIeBwIXgAAKCRDqIlql
49+
HKheCt8vB/4pLL2aMJwDgi8Qhmxfllz9mXTOn+h3LequV3ou8gDNSwByLbSrcZvd
50+
M4rlqjezQ9/Y+itALjQ3/jwhHMh4M5sDc7BXaO82eQzrpBywgLTY2km1RQ9BaoxT
51+
PQwkBDSt2Zp/XhBwYXiMtxw/d90Cu99fnitXFFZz3lkCq4zn3BeCAJmL3CHotCLe
52+
clmE7C16Y/w6t5+2AXej+lNpmBvQt2cXzDWeNxcZhJInW1MuIdUQFT8rEQ1H/r83
53+
t1RcQH6LuwetOysrY5a9DjH09mHizyt9KFu+jPP//pTXlWE0d2JX9buvkLTsm8IX
54+
jg/j+T6eFDW23ZST+PeNj4pFukc+feDa
55+
=kM8e
56+
-----END PGP PUBLIC KEY BLOCK-----`;
3857
const pubkeyResult = { pubkey: await KeyUtil.parse(pubkey), email: '[email protected]', isMine: false };
3958
// test
4059
const [att] = await attachmentUi.collectEncryptAttachments([pubkeyResult]);

test/source/tests/compose.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2153,8 +2153,8 @@ export const defineComposeTests = (testVariant: TestVariant, testWithBrowser: Te
21532153
await attachment.waitAndClick('@download-attachment');
21542154
await attachment.waitAndClick('@decrypt-error-details');
21552155
const decryptErrorDetails = await inboxPage.getFrame(['attachment_preview.htm']);
2156-
await decryptErrorDetails.waitForContent('@error-details', 'Error: Session key decryption failed'); // stack
2157-
await decryptErrorDetails.waitForContent('@error-details', '"type": "key_mismatch"'); // DecryptError
2156+
await decryptErrorDetails.waitForContent('@error-details', 'Error: No decryption key packets found'); // stack
2157+
await decryptErrorDetails.waitForContent('@error-details', '"type": "other"'); // DecryptError
21582158
})
21592159
);
21602160

@@ -2566,11 +2566,11 @@ export const defineComposeTests = (testVariant: TestVariant, testWithBrowser: Te
25662566
// contains original key
25672567
await SettingsPageRecipe.checkContactKey(contactsFrame, 'OPENPGP', 'ACTIVE', 'AB8C F86E 3715 7C3F 290D 7200 7ED4 3D79 E961 7655');
25682568
// contains newly fetched key
2569-
await SettingsPageRecipe.checkContactKey(contactsFrame, 'OPENPGP', 'ACTIVE', '8B8A 05A2 216E E6E4 C5EE 3D54 0D56 88EB F310 2BE7');
2570-
await contactsFrame.waitAndClick(`@action-show-pubkey-8B8A05A2216EE6E4C5EE3D540D5688EBF3102BE7-openpgp`, {
2569+
await SettingsPageRecipe.checkContactKey(contactsFrame, 'OPENPGP', 'ACTIVE', '8C4C 1FCC 779F 3577 29D1 94EC EA22 5AA5 1CA8 5E0A');
2570+
await contactsFrame.waitAndClick(`@action-show-pubkey-8C4C1FCC779F357729D194ECEA225AA51CA85E0A-openpgp`, {
25712571
confirmGone: true,
25722572
});
2573-
await contactsFrame.waitForContent('@container-pubkey-details', 'Fingerprint: 8B8A 05A2 216E E6E4 C5EE 3D54 0D56 88EB F310 2BE7');
2573+
await contactsFrame.waitForContent('@container-pubkey-details', 'Fingerprint: 8C4C 1FCC 779F 3577 29D1 94EC EA22 5AA5 1CA8 5E0A');
25742574
await contactsFrame.waitForContent('@container-pubkey-details', 'Users: [email protected]');
25752575
})
25762576
);
@@ -2692,10 +2692,10 @@ export const defineComposeTests = (testVariant: TestVariant, testWithBrowser: Te
26922692
await contactsFrame.waitAll('@page-contacts');
26932693
await contactsFrame.waitAndClick(`@action-show-email-${recipientEmail.replace(/[^a-z0-9]+/g, '')}`);
26942694
// Check protonMailCompatKey key
2695-
await contactsFrame.waitAndClick(`@action-show-pubkey-8B8A05A2216EE6E4C5EE3D540D5688EBF3102BE7-openpgp`, {
2695+
await contactsFrame.waitAndClick(`@action-show-pubkey-8C4C1FCC779F357729D194ECEA225AA51CA85E0A-openpgp`, {
26962696
confirmGone: true,
26972697
});
2698-
await contactsFrame.waitForContent('@container-pubkey-details', 'Fingerprint: 8B8A 05A2 216E E6E4 C5EE 3D54 0D56 88EB F310 2BE7');
2698+
await contactsFrame.waitForContent('@container-pubkey-details', 'Fingerprint: 8C4C 1FCC 779F 3577 29D1 94EC EA22 5AA5 1CA8 5E0A');
26992699
await contactsFrame.waitForContent('@container-pubkey-details', 'Users: [email protected]');
27002700
// Check somePubkey
27012701
await contactsFrame.waitAndClick('@action-back-to-contact-list', { confirmGone: true });
@@ -2806,10 +2806,10 @@ export const defineComposeTests = (testVariant: TestVariant, testWithBrowser: Te
28062806
await contactsFrame.waitAll('@page-contacts');
28072807
// Check test.ldap.timeout@gmail.com
28082808
await contactsFrame.waitAndClick(`@action-show-email-${recipients.to.replace(/[^a-z0-9]+/g, '')}`);
2809-
await contactsFrame.waitAny(`@action-show-pubkey-8B8A05A2216EE6E4C5EE3D540D5688EBF3102BE7-openpgp`);
2809+
await contactsFrame.waitAny(`@action-show-pubkey-8C4C1FCC779F357729D194ECEA225AA51CA85E0A-openpgp`);
28102810
// Check test.flowcrypt.pubkey.timeout@gmail.com
28112811
await contactsFrame.waitAndClick(`@action-show-email-${recipients.cc.replace(/[^a-z0-9]+/g, '')}`);
2812-
await contactsFrame.waitAny(`@action-show-pubkey-8B8A05A2216EE6E4C5EE3D540D5688EBF3102BE7-openpgp`);
2812+
await contactsFrame.waitAny(`@action-show-pubkey-8C4C1FCC779F357729D194ECEA225AA51CA85E0A-openpgp`);
28132813
})
28142814
);
28152815

0 commit comments

Comments
 (0)