@wireapp/core 22.1.0 → 22.1.1

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/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [22.1.1](https://github.com/wireapp/wire-web-packages/tree/main/packages/core/compare/@wireapp/core@22.1.0...@wireapp/core@22.1.1) (2022-02-01)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **core:** Do not try to encrypt for clients without prekeys ([#4220](https://github.com/wireapp/wire-web-packages/tree/main/packages/core/issues/4220)) ([1adea26](https://github.com/wireapp/wire-web-packages/tree/main/packages/core/commit/1adea2652de6fd7833a3f1ae99b488f2d25e9817))
12
+
13
+
14
+
15
+
16
+
6
17
  # [22.1.0](https://github.com/wireapp/wire-web-packages/tree/main/packages/core/compare/@wireapp/core@22.0.0...@wireapp/core@22.1.0) (2022-02-01)
7
18
 
8
19
 
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "dependencies": {
6
6
  "@types/long": "4.0.1",
7
7
  "@types/node": "~14",
8
- "@wireapp/api-client": "16.6.0",
8
+ "@wireapp/api-client": "16.6.1",
9
9
  "@wireapp/cryptobox": "12.7.1",
10
10
  "bazinga64": "5.10.0",
11
11
  "hash.js": "1.1.7",
@@ -69,6 +69,6 @@
69
69
  "test:project": "yarn dist && yarn test",
70
70
  "test:node": "nyc jasmine --config=jasmine.json"
71
71
  },
72
- "version": "22.1.0",
73
- "gitHead": "97061d487f550a9bcb587ae730a61b9c16fbe074"
72
+ "version": "22.1.1",
73
+ "gitHead": "805541bf8ba66031d424c4b9d14bead16b165c33"
74
74
  }
@@ -94,12 +94,17 @@ class CryptographyService {
94
94
  };
95
95
  }
96
96
  async encrypt(plainText, users, domain) {
97
+ var _a;
97
98
  const encrypted = {};
98
99
  const missing = {};
99
100
  for (const userId in users) {
100
- const clientIds = (0, util_1.isUserClients)(users) ? users[userId] : Object.keys(users[userId]);
101
+ const clientIds = (0, util_1.isUserClients)(users)
102
+ ? users[userId]
103
+ : Object.keys(users[userId])
104
+ // We filter out clients that have `null` prekey
105
+ .filter(clientId => !!users[userId][clientId]);
101
106
  for (const clientId of clientIds) {
102
- const base64PreKey = (0, util_1.isUserClients)(users) ? undefined : users[userId][clientId].key;
107
+ const base64PreKey = (0, util_1.isUserClients)(users) ? undefined : (_a = users[userId][clientId]) === null || _a === void 0 ? void 0 : _a.key;
103
108
  const sessionId = CryptographyService.constructSessionId(userId, clientId, domain || null);
104
109
  const result = await this.encryptPayloadForSession(sessionId, plainText, base64PreKey);
105
110
  if (result) {