Skip to content

Commit 63133f2

Browse files
authored
refactor: revert changes in openpgp.js config (#6073)
1 parent 845c4b7 commit 63133f2

3 files changed

Lines changed: 2 additions & 3 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ export class OpenPGPKey {
523523
if (verifyErr instanceof Error && verifyErr.message === 'Can only verify message with one literal data packet.') {
524524
verifyRes.error = 'FlowCrypt is not equipped to verify this message';
525525
verifyRes.isErrFatal = true; // don't try to re-fetch the message from API
526-
} else if (verifyErr instanceof Error && verifyErr.message.startsWith('Insecure hash algorithm:')) {
526+
} else if (verifyErr instanceof Error && verifyErr.message.startsWith('Insecure message hash algorithm:')) {
527527
verifyRes.error = `${verifyErr.message}. Sender is using old, insecure OpenPGP software.`;
528528
verifyRes.isErrFatal = true; // don't try to re-fetch the message from API
529529
} else if (verifyErr instanceof Error && verifyErr.message === 'Signature is expired') {

extension/js/common/core/crypto/pgp/openpgpjs-custom.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ if (typeof opgp !== 'undefined') {
1515
opgp.config.showVersion = true;
1616
opgp.config.commentString = 'Seamlessly send and receive encrypted email';
1717
opgp.config.showComment = true;
18-
opgp.config.rejectHashAlgorithms = new Set([...opgp.config.rejectHashAlgorithms, opgp.enums.hash.sha1]);
1918
opgp.config.allowUnauthenticatedMessages = true; // we manually check for missing MDC and show loud warning to user (no auto-decrypt)
2019
opgp.config.allowInsecureDecryptionWithSigningKeys = false; // may get later over-written using ClientConfiguration for some clients
2120
// openpgp.config.require_uid_self_cert = false;

test/source/tests/decrypt.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2158,7 +2158,7 @@ XZ8r4OC6sguP/yozWlkG+7dDxsgKQVBENeG6Lw==
21582158
{
21592159
content: ['test'],
21602160
encryption: 'not encrypted',
2161-
signature: 'error verifying signature: Insecure hash algorithm: SHA1. Sender is using old, insecure OpenPGP software.',
2161+
signature: 'error verifying signature: Insecure message hash algorithm: SHA1. Sender is using old, insecure OpenPGP software.',
21622162
},
21632163
authHdr
21642164
);

0 commit comments

Comments
 (0)