Skip to content

Commit

Permalink
fix failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
martgil committed Aug 24, 2024
1 parent b719396 commit fd54d62
Show file tree
Hide file tree
Showing 12 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion extension/chrome/dev/export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { Catch } from '../../js/common/platform/catch.js';
import { Gmail } from '../../js/common/api/email-provider/gmail/gmail.js';
import { Time } from '../../js/common/browser/time.js';
import { Url } from '../../js/common/core/common.js';
import { openpgp } from '../../js/common/core/crypto/pgp/openpgpjs-custom.js';
import { opgp as openpgp } from '../../js/common/core/crypto/pgp/openpgpjs-custom.js';

Catch.try(async () => {
const uncheckedUrlParams = Url.parse(['acctEmail']);
Expand Down
2 changes: 1 addition & 1 deletion extension/chrome/elements/compose.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { Ui } from '../../js/common/browser/ui.js';
import { PromiseCancellation, Url } from '../../js/common/core/common.js';
import { View } from '../../js/common/view.js';
import { XssSafeFactory } from '../../js/common/xss-safe-factory.js';
import { openpgp } from '../../js/common/core/crypto/pgp/openpgpjs-custom.js';
import { opgp as openpgp } from '../../js/common/core/crypto/pgp/openpgpjs-custom.js';
import { ComposeAttachmentsModule } from './compose-modules/compose-attachments-module.js';
import { ComposeDraftModule } from './compose-modules/compose-draft-module.js';
import { ComposeErrModule } from './compose-modules/compose-err-module.js';
Expand Down
2 changes: 1 addition & 1 deletion extension/chrome/settings/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { Gmail } from '../../js/common/api/email-provider/gmail/gmail.js';
import { Google } from '../../js/common/api/email-provider/gmail/google.js';
import { KeyImportUi } from '../../js/common/ui/key-import-ui.js';
import { Lang } from '../../js/common/lang.js';
import { openpgp } from '../../js/common/core/crypto/pgp/openpgpjs-custom.js';
import { opgp as openpgp } from '../../js/common/core/crypto/pgp/openpgpjs-custom.js';
import { ClientConfiguration } from '../../js/common/client-configuration.js';
import { Settings } from '../../js/common/settings.js';
import { SetupCreateKeyModule } from './setup/setup-create-key.js';
Expand Down
2 changes: 1 addition & 1 deletion extension/js/common/api/key-server/wkd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { ApiErr } from '../shared/api-error.js';
import { Buf } from '../../core/buf.js';
import { PubkeysSearchResult } from './../pub-lookup.js';
import { WKD_API_HOST } from '../../core/const.js';
import { openpgp } from '../../core/crypto/pgp/openpgpjs-custom.js';
import { opgp as openpgp } from '../../core/crypto/pgp/openpgpjs-custom.js';
import { ArmoredKeyIdentityWithEmails, KeyUtil } from '../../core/crypto/key.js';

export class Wkd extends Api {
Expand Down
4 changes: 2 additions & 2 deletions extension/js/common/core/crypto/key.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Buf } from '../buf.js';
import { Catch } from '../../platform/catch.js';
import { MsgBlockParser } from '../msg-block-parser.js';
import { PgpArmor } from './pgp/pgp-armor.js';
import { openpgp } from './pgp/openpgpjs-custom.js';
import { opgp as openpgp } from './pgp/openpgpjs-custom.js';
import { OpenPGPKey } from './pgp/openpgp-key.js';
import type * as OpenPGP from 'openpgp';
import { SmimeKey } from './smime/smime-key.js';
Expand Down Expand Up @@ -204,7 +204,7 @@ export class KeyUtil {
allErr: Error[] = [];
let uncheckedOpgpKeyCount = 0;
try {
const keys = await openpgp.readKeys({ binaryKeys: key }); // todo: opgp.readKey ?
const keys = await openpgp.readKeys({ binaryKeys: key }); // todo: openpgp.readKey ?
uncheckedOpgpKeyCount = keys.length;
for (const key of keys) {
try {
Expand Down
2 changes: 1 addition & 1 deletion extension/js/common/core/crypto/pgp/msg-util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Key, KeyInfoWithIdentity, KeyInfoWithIdentityAndOptionalPp, KeyUtil } f
import { ReplaceableMsgBlockType } from '../../msg-block.js';
import { Buf } from '../../buf.js';
import { PgpArmor, PreparedForDecrypt } from './pgp-armor.js';
import { openpgp } from './openpgpjs-custom.js';
import { opgp as openpgp } from './openpgpjs-custom.js';
import type * as OpenPGP from 'openpgp';
import { KeyCache } from '../../../platform/key-cache.js';
import { SmimeKey, SmimeMsg } from '../smime/smime-key.js';
Expand Down
2 changes: 1 addition & 1 deletion extension/js/common/core/crypto/pgp/openpgp-key.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* ©️ 2016 - present FlowCrypt a.s. Limitations apply. Contact [email protected] */
import { Key, PrvPacket, KeyAlgo, KeyUtil, UnexpectedKeyTypeError, PubkeyInfo } from '../key.js';
import { openpgp } from './openpgpjs-custom.js';
import { opgp as openpgp } from './openpgpjs-custom.js';
import { Catch } from '../../../platform/catch.js';
import { Str, Value } from '../../common.js';
import { Buf } from '../../buf.js';
Expand Down
16 changes: 8 additions & 8 deletions extension/js/common/core/crypto/pgp/openpgpjs-custom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
import { VERSION } from '../../const.js';
import { requireOpenpgp } from '../../../platform/require.js';

export const openpgp = requireOpenpgp();
export const opgp = requireOpenpgp();

if (typeof openpgp !== 'undefined') {
if (typeof opgp !== 'undefined') {
// in certain environments, eg pgp_block.htm or web content script, openpgp is not included
openpgp.config.versionString = `FlowCrypt Email Encryption ${VERSION}`;
openpgp.config.showVersion = true;
openpgp.config.commentString = 'Seamlessly send and receive encrypted email';
openpgp.config.showComment = true;
openpgp.config.allowUnauthenticatedMessages = true; // we manually check for missing MDC and show loud warning to user (no auto-decrypt)
openpgp.config.allowInsecureDecryptionWithSigningKeys = false; // may get later over-written using ClientConfiguration for some clients
opgp.config.versionString = `FlowCrypt Email Encryption ${VERSION}`;
opgp.config.showVersion = true;
opgp.config.commentString = 'Seamlessly send and receive encrypted email';
opgp.config.showComment = true;
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;
}
2 changes: 1 addition & 1 deletion extension/js/common/core/crypto/pgp/pgp-armor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Buf } from '../../buf.js';
import { ReplaceableMsgBlockType } from '../../msg-block.js';
import { Str } from '../../common.js';
import type * as OpenPGP from 'openpgp';
import { openpgp } from './openpgpjs-custom.js';
import { opgp as openpgp } from './openpgpjs-custom.js';
import * as Stream from '@openpgp/web-stream-tools';
import { SmimeKey, ENVELOPED_DATA_OID } from '../smime/smime-key.js';

Expand Down
2 changes: 1 addition & 1 deletion extension/js/common/ui/key-import-ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { PgpPwd } from '../core/crypto/pgp/pgp-password.js';
import { Settings } from '../settings.js';
import { Ui } from '../browser/ui.js';
import { Url, Str } from '../core/common.js';
import { openpgp } from '../core/crypto/pgp/openpgpjs-custom.js';
import { opgp as openpgp } from '../core/crypto/pgp/openpgpjs-custom.js';
import { OpenPGPKey } from '../core/crypto/pgp/openpgp-key.js';
import { KeyStore } from '../platform/store/key-store.js';
import { isCustomerUrlFesUsed } from '../helpers.js';
Expand Down
2 changes: 1 addition & 1 deletion test/source/tests/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { PageRecipe } from './page-recipe/abstract-page-recipe';
import { BrowserHandle, ControllablePage } from '../browser';
import { OauthPageRecipe } from './page-recipe/oauth-page-recipe';
import { AvaContext } from './tooling';
import { openpgp } from '../core/crypto/pgp/openpgpjs-custom';
import { opgp as openpgp } from '../core/crypto/pgp/openpgpjs-custom';
import { expiredPubkey, hasPubKey, protonMailCompatKey, singlePubKeyAttesterConfig, somePubkey } from '../mock/attester/attester-key-constants';
import { ConfigurationProvider, HttpClientErr, Status } from '../mock/lib/api';
import { prvNoSubmit } from '../mock/key-manager/key-manager-constants';
Expand Down
2 changes: 1 addition & 1 deletion test/source/tests/unit-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { UnreportableError } from '../platform/catch.js';
import { Buf } from '../core/buf';
import { OpenPGPKey } from '../core/crypto/pgp/openpgp-key';
import { DecryptError, DecryptSuccess, MsgUtil } from '../core/crypto/pgp/msg-util';
import { openpgp } from '../core/crypto/pgp/openpgpjs-custom';
import { opgp as openpgp } from '../core/crypto/pgp/openpgpjs-custom';
import { Attachment } from '../core/attachment.js';
import { GoogleData, GmailMsg } from '../mock/google/google-data';
import { testConstants } from './tooling/consts';
Expand Down

0 comments on commit fd54d62

Please sign in to comment.