diff --git a/extension/js/common/core/mime.ts b/extension/js/common/core/mime.ts index eb770d1046a..2b83e263547 100644 --- a/extension/js/common/core/mime.ts +++ b/extension/js/common/core/mime.ts @@ -33,7 +33,7 @@ export type MimeContent = { export type RichHeaders = Dict; export type SendableMsgBody = { [key: string]: string | undefined; 'text/plain'?: string; 'text/html'?: string; }; export type KeyBlockType = 'publicKey' | 'privateKey'; -export type ReplaceableMsgBlockType = KeyBlockType | 'cryptupVerification' | 'signedMsg' | 'encryptedMsg' | 'encryptedMsgLink'; +export type ReplaceableMsgBlockType = KeyBlockType | 'signedMsg' | 'encryptedMsg' | 'encryptedMsgLink'; export type MsgBlockType = ReplaceableMsgBlockType | 'plainText' | 'decryptedText' | 'plainHtml' | 'decryptedHtml' | 'plainAtt' | 'encryptedAtt' | 'decryptedAtt' | 'encryptedAttLink' | 'decryptErr' | 'verifiedMsg' | 'signedHtml'; export type MsgBlock = { @@ -62,7 +62,7 @@ export class Mime { if (decoded.text) { const blocksFromTextPart = Pgp.armor.detectBlocks(Str.normalize(decoded.text)).blocks; // if there are some encryption-related blocks found in the text section, which we can use, and not look at the html section - if (blocksFromTextPart.find(b => b.type === 'encryptedMsg' || b.type === 'signedMsg' || b.type === 'publicKey' || b.type === 'privateKey' || b.type === 'cryptupVerification')) { + if (blocksFromTextPart.find(b => b.type === 'encryptedMsg' || b.type === 'signedMsg' || b.type === 'publicKey' || b.type === 'privateKey')) { blocks.push(...blocksFromTextPart); // because the html most likely containt the same thing, just harder to parse pgp sections cause it's html } else if (decoded.html) { // if no pgp blocks found in text part and there is html part, prefer html blocks.push(Pgp.internal.msgBlockObj('plainHtml', decoded.html)); diff --git a/extension/js/common/core/pgp.ts b/extension/js/common/core/pgp.ts index 384753c926a..4ac34ce9b3b 100644 --- a/extension/js/common/core/pgp.ts +++ b/extension/js/common/core/pgp.ts @@ -200,7 +200,6 @@ export class Pgp { null: { begin: '-----BEGIN', end: '-----END', replace: false }, publicKey: { begin: '-----BEGIN PGP PUBLIC KEY BLOCK-----', end: '-----END PGP PUBLIC KEY BLOCK-----', replace: true }, privateKey: { begin: '-----BEGIN PGP PRIVATE KEY BLOCK-----', end: '-----END PGP PRIVATE KEY BLOCK-----', replace: true }, - cryptupVerification: { begin: '-----BEGIN CRYPTUP VERIFICATION-----', end: '-----END CRYPTUP VERIFICATION-----', replace: true }, signedMsg: { begin: '-----BEGIN PGP SIGNED MESSAGE-----', middle: '-----BEGIN PGP SIGNATURE-----', end: '-----END PGP SIGNATURE-----', replace: true }, signature: { begin: '-----BEGIN PGP SIGNATURE-----', end: '-----END PGP SIGNATURE-----', replace: false }, encryptedMsg: { begin: '-----BEGIN PGP MESSAGE-----', end: '-----END PGP MESSAGE-----', replace: true }, @@ -229,10 +228,9 @@ export class Pgp { { match: '', word: 'weak', bar: 10, color: 'red', pass: false }, ]; - private static readonly FRIENDLY_BLOCK_TYPE_NAMES: { [type in MsgBlockType]: string } = { + private static readonly FRIENDLY_BLOCK_TYPE_NAMES: { [type in MsgBlockType]: string } = { // todo - remove this, almost useless privateKey: 'Private Key', publicKey: 'Public Key', - cryptupVerification: 'Cryptup Verification', decryptErr: 'Decrypt Error', decryptedAtt: 'Decrypted Attachment', decryptedHtml: 'Decrypted HTML', @@ -333,7 +331,7 @@ export class Pgp { }, }; - public static friendlyMsgBlockTypeName = (type: MsgBlockType) => { + public static friendlyMsgBlockTypeName = (type: MsgBlockType) => { // todo - remove this, just use the block type string return Pgp.FRIENDLY_BLOCK_TYPE_NAMES[type]; } diff --git a/extension/js/common/xss_safe_factory.ts b/extension/js/common/xss_safe_factory.ts index 7d9f587d8e6..154ce9bfca9 100644 --- a/extension/js/common/xss_safe_factory.ts +++ b/extension/js/common/xss_safe_factory.ts @@ -69,10 +69,6 @@ export class XssSafeFactory { return this.frameSrc(this.extUrl('chrome/elements/subscribe.htm'), { verificationEmailText, placement, isAuthErr }); } - srcVerificationDialog = (verificationEmailText: string) => { - return this.frameSrc(this.extUrl('chrome/elements/verification.htm'), { verificationEmailText }); - } - srcAddPubkeyDialog = (emails: string[], placement: Placement) => { return this.frameSrc(this.extUrl('chrome/elements/add_pubkey.htm'), { emails, placement }); } @@ -144,10 +140,6 @@ export class XssSafeFactory { return this.iframe(this.srcSubscribeDialog(verifEmailText, 'embedded', isAuthErr), ['short', 'embedded'], { scrolling: 'no' }); } - embeddedVerification = (verifEmailText: string) => { - return this.iframe(this.srcVerificationDialog(verifEmailText), ['short', 'embedded'], { scrolling: 'no' }); - } - embeddedAtta = (meta: Att, isEncrypted: boolean) => { return Ui.e('span', { class: 'pgp_attachment', html: this.iframe(this.srcPgpAttIframe(meta, isEncrypted)) }); } @@ -270,8 +262,6 @@ export class XssSafeFactory { return factory.embeddedBackup(Pgp.armor.normalize(block.content.toString(), 'privateKey')); } else if (block.type === 'encryptedMsgLink') { return factory.embeddedMsg('', msgId, isOutgoing, senderEmail, true, undefined, block.content.toString()); // here block.content is message short id - } else if (block.type === 'cryptupVerification') { - return factory.embeddedVerification(block.content.toString()); } else if (block.type === 'encryptedAtt') { return block.attMeta ? factory.embeddedAtta(new Att(block.attMeta), true) : '[missing encrypted attachment details]'; } else if (block.type === 'signedHtml') {