@wireapp/core 32.1.2 → 33.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -3,60 +3,51 @@
3
3
  "./src/main/cryptography/AssetCryptography/crypto.node": "./src/main/cryptography/AssetCryptography/crypto.browser.js"
4
4
  },
5
5
  "dependencies": {
6
- "@wireapp/api-client": "^20.6.10",
7
- "@wireapp/commons": "^4.4.7",
6
+ "@wireapp/api-client": "^20.7.0",
7
+ "@wireapp/commons": "^4.4.9",
8
8
  "@wireapp/core-crypto": "0.5.2",
9
9
  "@wireapp/cryptobox": "12.8.0",
10
- "@wireapp/promise-queue": "^1.3.1",
11
- "@wireapp/store-engine-dexie": "^1.7.7",
10
+ "@wireapp/promise-queue": "^1.3.3",
11
+ "@wireapp/protocol-messaging": "1.39.0",
12
+ "@wireapp/store-engine-dexie": "^1.7.9",
12
13
  "axios": "^0.27.2",
13
- "bazinga64": "5.11.7",
14
+ "bazinga64": "5.11.9",
14
15
  "hash.js": "1.1.7",
15
- "http-status-codes": "2.1.4",
16
- "idb": "7.0.2",
16
+ "http-status-codes": "2.2.0",
17
+ "idb": "7.1.0",
17
18
  "logdown": "3.3.1",
18
19
  "long": "4.0.0",
19
- "protobufjs": "6.11.3",
20
20
  "uuidjs": "4.2.12"
21
21
  },
22
22
  "devDependencies": {
23
23
  "@babel/core": "^7.19.1",
24
24
  "@babel/preset-env": "^7.19.1",
25
25
  "@babel/preset-typescript": "^7.18.6",
26
+ "@faker-js/faker": "^7.6.0",
26
27
  "@open-wc/webpack-import-meta-loader": "0.4.7",
27
28
  "@types/babel__core": "^7",
28
- "@types/faker": "5.5.7",
29
- "@types/jest": "29.0.3",
30
- "@types/karma": "6.3.3",
29
+ "@types/jest": "29.2.0",
31
30
  "@types/long": "4.0.1",
32
- "@types/node": "^14.18.29",
31
+ "@types/node": "^18.11.2",
33
32
  "@types/tough-cookie": "4.0.2",
34
33
  "@wireapp/commons": "workspace:^",
35
- "@wireapp/protocol-messaging": "1.38.0",
36
34
  "@wireapp/store-engine-dexie": "workspace:^",
37
- "commander": "8.0.0",
35
+ "commander": "9.4.1",
38
36
  "cross-env": "7.0.3",
39
- "dotenv-defaults": "2.0.2",
40
- "fake-indexeddb": "3.1.8",
41
- "faker": "5.5.3",
37
+ "dotenv-defaults": "5.0.2",
38
+ "fake-indexeddb": "4.0.0",
42
39
  "istanbul": "1.1.0-alpha.1",
43
- "jest": "29.0.3",
40
+ "jest": "29.2.1",
44
41
  "jest-babel": "1.0.1",
45
- "jest-jasmine2": "29.0.3",
42
+ "jest-jasmine2": "29.2.1",
46
43
  "jest-websocket-mock": "2.4.0",
47
- "karma": "6.4.1",
48
- "karma-chrome-launcher": "3.1.1",
49
- "karma-jasmine": "4.0.2",
50
- "karma-jasmine-diff-reporter": "2.0.1",
51
- "karma-sourcemap-loader": "0.3.8",
52
- "karma-spec-reporter": "0.0.34",
53
44
  "mock-socket": "9.1.5",
54
45
  "nock": "13.2.9",
55
46
  "nyc": "15.1.0",
56
47
  "rimraf": "3.0.2",
57
- "typescript": "4.8.3",
48
+ "typescript": "4.8.4",
58
49
  "webpack": "4.46.0",
59
- "webpack-cli": "4.7.2"
50
+ "webpack-cli": "4.10.0"
60
51
  },
61
52
  "description": "Wire for Web's communication core.",
62
53
  "files": [
@@ -82,6 +73,6 @@
82
73
  "test": "jest",
83
74
  "watch": "tsc ---watch"
84
75
  },
85
- "version": "32.1.2",
86
- "gitHead": "4f3941eb17937ca87986d4832d7bdd304a1e2dca"
76
+ "version": "33.0.0",
77
+ "gitHead": "cc1de9547f2528a14d3d23937a154f58476d2faf"
87
78
  }
@@ -312,8 +312,8 @@ class Account extends events_1.EventEmitter {
312
312
  const coreCryptoKeyId = 'corecrypto-key';
313
313
  const { CoreCrypto } = await Promise.resolve().then(() => __importStar(require('@wireapp/core-crypto')));
314
314
  const dbName = this.generateSecretsDbName(context);
315
- const secretStore = mlsConfig.secretsCrypto
316
- ? await (0, encryptedStore_1.createCustomEncryptedStore)(dbName, mlsConfig.secretsCrypto)
315
+ const secretStore = mlsConfig.systemCrypto
316
+ ? await (0, encryptedStore_1.createCustomEncryptedStore)(dbName, mlsConfig.systemCrypto)
317
317
  : await (0, encryptedStore_1.createEncryptedStore)(dbName);
318
318
  let key = await secretStore.getsecretValue(coreCryptoKeyId);
319
319
  let isNewMLSDevice = false;
@@ -3,6 +3,6 @@ import { EncryptedAsset } from './EncryptedAsset';
3
3
  interface EncryptOptions extends CipherOptions {
4
4
  plainText: Uint8Array;
5
5
  }
6
- export declare const decryptAsset: ({ cipherText, keyBytes, sha256, }: EncryptedAsset) => Promise<Uint8Array>;
6
+ export declare const decryptAsset: ({ cipherText, keyBytes, sha256: referenceSha256, }: EncryptedAsset) => Promise<Uint8Array>;
7
7
  export declare const encryptAsset: ({ plainText, algorithm }: EncryptOptions) => Promise<EncryptedAsset>;
8
8
  export {};
@@ -18,7 +18,7 @@ export interface MLSConfig<T = any> {
18
18
  * encrypt/decrypt function pair that will be called before storing/fetching secrets in the secrets database.
19
19
  * If not provided will use the built in encryption mechanism
20
20
  */
21
- secretsCrypto?: SecretCrypto<T>;
21
+ systemCrypto?: SecretCrypto<T>;
22
22
  /**
23
23
  * path on the public server to the core crypto wasm file.
24
24
  * This file will be downloaded lazily when corecrypto is needed.
@@ -71,6 +71,7 @@ const NotificationDatabaseRepository_1 = require("./NotificationDatabaseReposito
71
71
  const protocol_messaging_1 = require("@wireapp/protocol-messaging");
72
72
  const bazinga64_1 = require("bazinga64");
73
73
  const TaskScheduler_1 = require("../util/TaskScheduler/TaskScheduler");
74
+ const mls_1 = require("../mls");
74
75
  const LowPrecisionTaskScheduler_1 = require("../util/LowPrecisionTaskScheduler/LowPrecisionTaskScheduler");
75
76
  const keyPackagesStatusStore_1 = require("../mls/keyPackagesStatusStore/keyPackagesStatusStore");
76
77
  const keyMaterialUpdatesStore_1 = require("../mls/keyMaterialUpdatesStore");
@@ -260,7 +261,12 @@ class NotificationService extends events_1.EventEmitter {
260
261
  const encryptedData = bazinga64_1.Decoder.fromBase64(event.data).asBytes;
261
262
  const groupId = await this.getGroupIdFromConversationId((_a = event.qualified_conversation) !== null && _a !== void 0 ? _a : { id: event.conversation, domain: '' });
262
263
  const groupIdBytes = bazinga64_1.Decoder.fromBase64(groupId).asBytes;
263
- const { proposals, commitDelay, message } = await this.mlsService.decryptMessage(groupIdBytes, encryptedData);
264
+ const { proposals, commitDelay, message, senderClientId: encodedSenderClientId, } = await this.mlsService.decryptMessage(groupIdBytes, encryptedData);
265
+ if (encodedSenderClientId) {
266
+ const decoder = new TextDecoder();
267
+ const senderClientId = decoder.decode((0, mls_1.optionalToUint8Array)(encodedSenderClientId));
268
+ event.senderClientId = senderClientId;
269
+ }
264
270
  // Check if the message includes proposals
265
271
  if (typeof commitDelay === 'number' || proposals.length > 0) {
266
272
  // we are dealing with a proposal, add a task to process this proposal later on
@@ -283,7 +289,10 @@ class NotificationService extends events_1.EventEmitter {
283
289
  * @todo Find a proper solution to add mappedEvent to this return
284
290
  * otherwise event.data will be base64 raw data of the received event
285
291
  */
286
- return { event, decryptedData };
292
+ return {
293
+ event,
294
+ decryptedData,
295
+ };
287
296
  // Encrypted Proteus events
288
297
  case Events.CONVERSATION_EVENT.OTR_MESSAGE_ADD: {
289
298
  if (dryRun) {
@@ -22,7 +22,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
22
22
  };
23
23
  Object.defineProperty(exports, "__esModule", { value: true });
24
24
  exports.mockUserPayload = exports.getUrlParameter = exports.getUUID = void 0;
25
- const faker_1 = __importDefault(require("faker"));
25
+ const faker_1 = require("@faker-js/faker");
26
26
  const uuidjs_1 = __importDefault(require("uuidjs"));
27
27
  function getUUID() {
28
28
  return uuidjs_1.default.genV4().toString();
@@ -41,7 +41,7 @@ function mockUserPayload(userId) {
41
41
  assets: [],
42
42
  id: userId,
43
43
  locale: 'en',
44
- name: faker_1.default.name.findName(),
44
+ name: faker_1.faker.name.fullName(),
45
45
  picture: [
46
46
  {
47
47
  content_length: 263345,