@wireapp/core 41.4.2 → 41.5.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/lib/messagingProtocols/mls/MLSService/MLSService.d.ts.map +1 -1
- package/lib/messagingProtocols/mls/MLSService/MLSService.js +5 -2
- package/lib/messagingProtocols/mls/MLSService/MLSService.test.js +1 -1
- package/lib/util/numberToHex.d.ts +2 -0
- package/lib/util/numberToHex.d.ts.map +1 -0
- package/lib/util/numberToHex.js +25 -0
- package/lib/util/numberToHex.test.d.ts +2 -0
- package/lib/util/numberToHex.test.d.ts.map +1 -0
- package/lib/util/numberToHex.test.js +37 -0
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MLSService.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/mls/MLSService/MLSService.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAC,sBAAsB,EAAE,kBAAkB,EAAC,MAAM,sCAAsC,CAAC;AAChG,OAAO,EAAC,eAAe,EAAC,MAAM,sDAAsD,CAAC;AACrF,OAAO,EAAC,8BAA8B,EAAE,2BAA2B,EAAC,MAAM,+BAA+B,CAAC;AAE1G,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAGzD,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAE9C,OAAO,EACL,eAAe,EAIf,cAAc,EACd,UAAU,EAEV,gBAAgB,EAChB,uBAAuB,EACvB,oBAAoB,EACpB,OAAO,EACP,YAAY,EACZ,YAAY,EACZ,kBAAkB,EACnB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAC,gBAAgB,EAAsB,MAAM,oBAAoB,CAAC;AAIzE,OAAO,EAAC,mBAAmB,EAAC,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"MLSService.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/mls/M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Ac7C,OAAO,CAAC,sCAAsC;IAI9C;;;OAGG;IACI,uBAAuB,CAAC,OAAO,EAAE,MAAM;IAK9C;;;OAGG;IACI,wBAAwB,CAAC,OAAO,EAAE,MAAM;IAI/C;;;OAGG;IACI,0BAA0B,CAAC,OAAO,EAAE,MAAM;IAUjD;;;OAGG;IACI,mCAAmC,CAAC,QAAQ,EAAE,MAAM,EAAE;IAQ7D;;;OAGG;IACI,8BAA8B;YAQvB,eAAe;IAsB7B;;;;;OAKG;YACW,mBAAmB;YAMnB,oBAAoB;IAOrB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAY7D;;;;;OAKG;IACU,4BAA4B,CACvC,uBAAuB,EAAE,WAAW,EACpC,iBAAiB,CAAC,EAAE,kBAAkB,GACrC,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAQ9B;;;;;;;OAOG;IACU,sBAAsB,CAAC,EAAC,SAAS,EAAE,OAAO,EAAE,SAAS,EAAC,EAAE,4BAA4B;IAoBjG;;;;;OAKG;IACU,sBAAsB,CAAC,EAAC,OAAO,EAAE,UAAkB,EAAC,EAAE,4BAA4B;IAa/F;;;;OAIG;IACU,6BAA6B;IAiB1C;;;;OAIG;IACU,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAC,EAAE,CAAC;IAY5F,wBAAwB,CAAC,KAAK,EAAE,8BAA8B;IAI9D,4BAA4B,CAAC,KAAK,EAAE,2BAA2B;CAG7E"}
|
|
@@ -44,6 +44,7 @@ const pendingProposalsStore_1 = require("./stores/pendingProposalsStore");
|
|
|
44
44
|
const subconversationGroupIdStore_1 = require("./stores/subconversationGroupIdStore/subconversationGroupIdStore");
|
|
45
45
|
const messageSender_1 = require("../../../conversation/message/messageSender");
|
|
46
46
|
const fullyQualifiedClientIdUtils_1 = require("../../../util/fullyQualifiedClientIdUtils");
|
|
47
|
+
const numberToHex_1 = require("../../../util/numberToHex");
|
|
47
48
|
const RecurringTaskScheduler_1 = require("../../../util/RecurringTaskScheduler");
|
|
48
49
|
const TaskScheduler_1 = require("../../../util/TaskScheduler");
|
|
49
50
|
const TypedEventEmitter_1 = require("../../../util/TypedEventEmitter");
|
|
@@ -149,7 +150,9 @@ class MLSService extends TypedEventEmitter_1.TypedEventEmitter {
|
|
|
149
150
|
* includes self user too.
|
|
150
151
|
*/
|
|
151
152
|
const failedToFetchKeyPackages = [];
|
|
152
|
-
const keyPackagesSettledResult = await Promise.allSettled(qualifiedUsers.map(({ id, domain, skipOwnClientId }) => this.apiClient.api.client
|
|
153
|
+
const keyPackagesSettledResult = await Promise.allSettled(qualifiedUsers.map(({ id, domain, skipOwnClientId }) => this.apiClient.api.client
|
|
154
|
+
.claimMLSKeyPackages(id, domain, (0, numberToHex_1.numberToHex)(this.defaultCiphersuite), skipOwnClientId)
|
|
155
|
+
.catch(error => {
|
|
153
156
|
failedToFetchKeyPackages.push({ id, domain });
|
|
154
157
|
// Throw the error so we don't get {status: 'fulfilled', value: undefined}
|
|
155
158
|
throw error;
|
|
@@ -453,7 +456,7 @@ class MLSService extends TypedEventEmitter_1.TypedEventEmitter {
|
|
|
453
456
|
if (validKeyPackagesCount <= minAllowedNumberOfKeyPackages) {
|
|
454
457
|
const clientId = this.apiClient.validatedClientId;
|
|
455
458
|
//check numbers of keys on backend
|
|
456
|
-
const backendKeyPackagesCount = await this.apiClient.api.client.getMLSKeyPackageCount(clientId);
|
|
459
|
+
const backendKeyPackagesCount = await this.apiClient.api.client.getMLSKeyPackageCount(clientId, (0, numberToHex_1.numberToHex)(this.defaultCiphersuite));
|
|
457
460
|
if (backendKeyPackagesCount <= minAllowedNumberOfKeyPackages) {
|
|
458
461
|
//upload new keys
|
|
459
462
|
const newKeyPackages = await this.clientKeypackages(this.config.nbKeyPackages);
|
|
@@ -56,7 +56,7 @@ describe('MLSService', () => {
|
|
|
56
56
|
const users = [createUserId(), createUserId()];
|
|
57
57
|
await mlsService.registerConversation(groupId, [...users, selfUser], creator);
|
|
58
58
|
expect(apiClient.api.client.claimMLSKeyPackages).toHaveBeenCalledTimes(3);
|
|
59
|
-
expect(apiClient.api.client.claimMLSKeyPackages).toHaveBeenCalledWith(selfUser.id, selfUser.domain, creator.client);
|
|
59
|
+
expect(apiClient.api.client.claimMLSKeyPackages).toHaveBeenCalledWith(selfUser.id, selfUser.domain, '0x1', creator.client);
|
|
60
60
|
expect(mlsService.scheduleKeyMaterialRenewal).toHaveBeenCalledWith(groupId);
|
|
61
61
|
});
|
|
62
62
|
it('creates a new mls conversation without any creator', async () => {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"numberToHex.d.ts","sourceRoot":"","sources":["../../src/util/numberToHex.ts"],"names":[],"mappings":"AAmBA,eAAO,MAAM,WAAW,WAAY,MAAM,KAAG,MAE5C,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Wire
|
|
4
|
+
* Copyright (C) 2023 Wire Swiss GmbH
|
|
5
|
+
*
|
|
6
|
+
* This program is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU General Public License as published by
|
|
8
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
9
|
+
* (at your option) any later version.
|
|
10
|
+
*
|
|
11
|
+
* This program is distributed in the hope that it will be useful,
|
|
12
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
+
* GNU General Public License for more details.
|
|
15
|
+
*
|
|
16
|
+
* You should have received a copy of the GNU General Public License
|
|
17
|
+
* along with this program. If not, see http://www.gnu.org/licenses/.
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.numberToHex = void 0;
|
|
22
|
+
const numberToHex = (number) => {
|
|
23
|
+
return `0x${number.toString(16).toUpperCase()}`;
|
|
24
|
+
};
|
|
25
|
+
exports.numberToHex = numberToHex;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"numberToHex.test.d.ts","sourceRoot":"","sources":["../../src/util/numberToHex.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Wire
|
|
4
|
+
* Copyright (C) 2023 Wire Swiss GmbH
|
|
5
|
+
*
|
|
6
|
+
* This program is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU General Public License as published by
|
|
8
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
9
|
+
* (at your option) any later version.
|
|
10
|
+
*
|
|
11
|
+
* This program is distributed in the hope that it will be useful,
|
|
12
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
+
* GNU General Public License for more details.
|
|
15
|
+
*
|
|
16
|
+
* You should have received a copy of the GNU General Public License
|
|
17
|
+
* along with this program. If not, see http://www.gnu.org/licenses/.
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
const numberToHex_1 = require("./numberToHex");
|
|
22
|
+
describe('numberToHex', () => {
|
|
23
|
+
it('should convert a number to a hex string', () => {
|
|
24
|
+
expect((0, numberToHex_1.numberToHex)(0)).toBe('0x0');
|
|
25
|
+
expect((0, numberToHex_1.numberToHex)(1)).toBe('0x1');
|
|
26
|
+
expect((0, numberToHex_1.numberToHex)(10)).toBe('0xA');
|
|
27
|
+
expect((0, numberToHex_1.numberToHex)(15)).toBe('0xF');
|
|
28
|
+
expect((0, numberToHex_1.numberToHex)(16)).toBe('0x10');
|
|
29
|
+
expect((0, numberToHex_1.numberToHex)(255)).toBe('0xFF');
|
|
30
|
+
expect((0, numberToHex_1.numberToHex)(256)).toBe('0x100');
|
|
31
|
+
expect((0, numberToHex_1.numberToHex)(61489)).toBe('0xF031');
|
|
32
|
+
expect((0, numberToHex_1.numberToHex)(65535)).toBe('0xFFFF');
|
|
33
|
+
expect((0, numberToHex_1.numberToHex)(65536)).toBe('0x10000');
|
|
34
|
+
expect((0, numberToHex_1.numberToHex)(4294967295)).toBe('0xFFFFFFFF');
|
|
35
|
+
expect((0, numberToHex_1.numberToHex)(4294967296)).toBe('0x100000000');
|
|
36
|
+
});
|
|
37
|
+
});
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"./lib/cryptography/AssetCryptography/crypto.node": "./lib/cryptography/AssetCryptography/crypto.browser.js"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@wireapp/api-client": "^25.
|
|
14
|
+
"@wireapp/api-client": "^25.3.0",
|
|
15
15
|
"@wireapp/commons": "^5.1.0",
|
|
16
16
|
"@wireapp/core-crypto": "1.0.0-rc.6",
|
|
17
17
|
"@wireapp/cryptobox": "12.8.0",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"@wireapp/protocol-messaging": "1.44.0",
|
|
20
20
|
"@wireapp/store-engine": "5.1.1",
|
|
21
21
|
"@wireapp/store-engine-dexie": "^2.1.3",
|
|
22
|
-
"axios": "1.
|
|
22
|
+
"axios": "1.5.0",
|
|
23
23
|
"bazinga64": "6.1.2",
|
|
24
24
|
"deepmerge-ts": "5.1.0",
|
|
25
25
|
"hash.js": "1.1.7",
|
|
@@ -60,6 +60,6 @@
|
|
|
60
60
|
"test:coverage": "jest --coverage",
|
|
61
61
|
"watch": "tsc --watch"
|
|
62
62
|
},
|
|
63
|
-
"version": "41.
|
|
64
|
-
"gitHead": "
|
|
63
|
+
"version": "41.5.0",
|
|
64
|
+
"gitHead": "8e388941eab6dd435725cf1fe8d72181c20c1813"
|
|
65
65
|
}
|