diff --git a/extension/js/common/core/crypto/pgp/openpgp-key.ts b/extension/js/common/core/crypto/pgp/openpgp-key.ts index b84ef7f893a..9b2e41af415 100644 --- a/extension/js/common/core/crypto/pgp/openpgp-key.ts +++ b/extension/js/common/core/crypto/pgp/openpgp-key.ts @@ -529,7 +529,7 @@ export class OpenPGPKey { if (verifyErr instanceof Error && verifyErr.message === 'Can only verify message with one literal data packet.') { verifyRes.error = 'FlowCrypt is not equipped to verify this message'; verifyRes.isErrFatal = true; // don't try to re-fetch the message from API - } else if (verifyErr instanceof Error && verifyErr.message.startsWith('Insecure message hash algorithm:')) { + } else if (verifyErr instanceof Error && verifyErr.message.startsWith('Insecure hash algorithm:')) { verifyRes.error = `${verifyErr.message}. Sender is using old, insecure OpenPGP software.`; verifyRes.isErrFatal = true; // don't try to re-fetch the message from API } else if (verifyErr instanceof Error && verifyErr.message === 'Signature is expired') { diff --git a/extension/js/common/core/crypto/pgp/openpgpjs-custom.ts b/extension/js/common/core/crypto/pgp/openpgpjs-custom.ts index 253d91affa8..c499d4ba704 100644 --- a/extension/js/common/core/crypto/pgp/openpgpjs-custom.ts +++ b/extension/js/common/core/crypto/pgp/openpgpjs-custom.ts @@ -13,6 +13,7 @@ if (typeof opgp !== 'undefined') { opgp.config.showVersion = true; opgp.config.commentString = 'Seamlessly send and receive encrypted email'; opgp.config.showComment = true; + opgp.config.rejectHashAlgorithms = new Set([...opgp.config.rejectHashAlgorithms, opgp.enums.hash.sha1]); opgp.config.allowUnauthenticatedMessages = true; // we manually check for missing MDC and show loud warning to user (no auto-decrypt) opgp.config.allowInsecureDecryptionWithSigningKeys = false; // may get later over-written using ClientConfiguration for some clients // openpgp.config.require_uid_self_cert = false; diff --git a/test/source/tests/decrypt.ts b/test/source/tests/decrypt.ts index 2157f69bd92..b4525f09b92 100644 --- a/test/source/tests/decrypt.ts +++ b/test/source/tests/decrypt.ts @@ -2158,7 +2158,7 @@ XZ8r4OC6sguP/yozWlkG+7dDxsgKQVBENeG6Lw== { content: ['test'], encryption: 'not encrypted', - signature: 'error verifying signature: Insecure message hash algorithm: SHA1. Sender is using old, insecure OpenPGP software.', + signature: 'error verifying signature: Insecure hash algorithm: SHA1. Sender is using old, insecure OpenPGP software.', }, authHdr );