@wireapp/core 43.11.5 → 43.12.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/lib/Account.d.ts.map +1 -1
- package/lib/Account.js +1 -2
- package/lib/messagingProtocols/mls/E2EIdentityService/E2EIService.types.d.ts +2 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/E2EIService.types.d.ts.map +1 -1
- package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceExternal.d.ts +6 -4
- package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceExternal.d.ts.map +1 -1
- package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceExternal.js +19 -6
- package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceExternal.test.js +33 -3
- package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceInternal.d.ts +2 -6
- package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceInternal.d.ts.map +1 -1
- package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceInternal.js +9 -8
- package/lib/messagingProtocols/mls/EventHandler/events/messageAdd/messageAdd.test.js +4 -1
- package/lib/messagingProtocols/mls/MLSService/MLSService.d.ts +1 -0
- package/lib/messagingProtocols/mls/MLSService/MLSService.d.ts.map +1 -1
- package/lib/messagingProtocols/mls/MLSService/MLSService.js +16 -9
- package/lib/messagingProtocols/mls/MLSService/MLSService.test.js +9 -3
- package/lib/messagingProtocols/mls/MLSService/MLSService.types.d.ts +3 -0
- package/lib/messagingProtocols/mls/MLSService/MLSService.types.d.ts.map +1 -1
- package/lib/util/qualifiedIdUtil.d.ts +4 -0
- package/lib/util/qualifiedIdUtil.d.ts.map +1 -0
- package/lib/util/qualifiedIdUtil.js +31 -0
- package/package.json +3 -3
package/lib/Account.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Account.d.ts","sourceRoot":"","sources":["../src/Account.ts"],"names":[],"mappings":"AAmBA,OAAO,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AC,cAAc;IAKtB,OAAO,CAAC,kBAAkB;IAI1B,OAAO,CAAC,uBAAuB;YAIjB,UAAU;IAuBxB,OAAO,CAAC,yBAAyB,CAS/B;CACH"}
|
package/lib/Account.js
CHANGED
|
@@ -356,8 +356,7 @@ class Account extends commons_1.TypedEventEmitter {
|
|
|
356
356
|
const clientService = new client_2.ClientService(this.apiClient, proteusService, this.storeEngine);
|
|
357
357
|
if (clientType === CryptoClient_1.CryptoClientType.CORE_CRYPTO && (await this.isMlsEnabled())) {
|
|
358
358
|
mlsService = new mls_1.MLSService(this.apiClient, cryptoClient.getNativeClient(), this.db, this.recurringTaskScheduler, Object.assign({}, (_a = this.coreCryptoConfig) === null || _a === void 0 ? void 0 : _a.mls));
|
|
359
|
-
e2eServiceExternal = new E2EIdentityService_1.E2EIServiceExternal(cryptoClient.getNativeClient(), this.db, this.recurringTaskScheduler, clientService, mlsService
|
|
360
|
-
mlsService.on('newCrlDistributionPoints', e2eServiceExternal.handleNewRemoteCrlDistributionPoints);
|
|
359
|
+
e2eServiceExternal = new E2EIdentityService_1.E2EIServiceExternal(cryptoClient.getNativeClient(), this.db, this.recurringTaskScheduler, clientService, mlsService);
|
|
361
360
|
}
|
|
362
361
|
const connectionService = new connection_1.ConnectionService(this.apiClient);
|
|
363
362
|
const giphyService = new giphy_1.GiphyService(this.apiClient);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { APIClient } from '@wireapp/api-client';
|
|
2
2
|
import { E2eiEnrollment, Ciphersuite, CoreCrypto, RotateBundle, WireIdentity, E2eiConversationState, CredentialType } from '@wireapp/core-crypto';
|
|
3
3
|
import { E2EIServiceExternal } from './E2EIServiceExternal';
|
|
4
|
+
import { NewCrlDistributionPointsPayload } from '../MLSService/MLSService.types';
|
|
4
5
|
/**
|
|
5
6
|
* Proxy types relevant to the E2EIService from CoreCrypto
|
|
6
7
|
*/
|
|
@@ -38,5 +39,6 @@ export interface InitParams {
|
|
|
38
39
|
skipInit?: boolean;
|
|
39
40
|
discoveryUrl?: string;
|
|
40
41
|
keyPackagesAmount: number;
|
|
42
|
+
dispatchNewCrlDistributionPoints: (payload: NewCrlDistributionPointsPayload) => void;
|
|
41
43
|
}
|
|
42
44
|
//# sourceMappingURL=E2EIService.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"E2EIService.types.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/mls/E2EIdentityService/E2EIService.types.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EACL,cAAc,EACd,WAAW,EACX,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,qBAAqB,EACrB,cAAc,EACf,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAC,mBAAmB,EAAC,MAAM,uBAAuB,CAAC;AAE1D;;GAEG;AACH,KAAK,QAAQ,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;AACnC,KAAK,oBAAoB,GAAG,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC;AAC9F,MAAM,MAAM,aAAa,GAAG,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC;AAC/F,MAAM,MAAM,aAAa,GAAG,QAAQ,CAAC,WAAW,CAAC,oBAAoB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;AACrF,MAAM,MAAM,YAAY,GAAG,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC;AAC7F,MAAM,MAAM,YAAY,GAAG,IAAI,CAC7B,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,kBAAkB,CAAC,CAAC,CAAC,EACvD,YAAY,GAAG,SAAS,GAAG,WAAW,CACvC,CAAC;AACF,OAAO,EAAC,cAAc,EAAE,WAAW,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,qBAAqB,EAAE,cAAc,EAAC,CAAC;AAEpH,MAAM,MAAM,IAAI,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AACF,MAAM,MAAM,OAAO,GAAG,UAAU,CAAC;AACjC,MAAM,MAAM,KAAK,GAAG,MAAM,CAAC;AAC3B,MAAM,MAAM,OAAO,GAAG,oBAAoB,CAAC,SAAS,CAAC,CAAC;AAEtD,MAAM,WAAW,yBAAyB;IACxC,aAAa,EAAE,aAAa,CAAC;IAC7B,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,uBAAuB;IACtC,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,SAAS,CAAC;IACrB,eAAe,EAAE,UAAU,CAAC;IAC5B,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"E2EIService.types.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/mls/E2EIdentityService/E2EIService.types.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EACL,cAAc,EACd,WAAW,EACX,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,qBAAqB,EACrB,cAAc,EACf,MAAM,sBAAsB,CAAC;AAE9B,OAAO,E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C,CAAC;AAEtD,MAAM,WAAW,yBAAyB;IACxC,aAAa,EAAE,aAAa,CAAC;IAC7B,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,uBAAuB;IACtC,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,SAAS,CAAC;IACrB,eAAe,EAAE,UAAU,CAAC;IAC5B,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,gCAAgC,EAAE,CAAC,OAAO,EAAE,+BAA+B,KAAK,IAAI,CAAC;CACtF"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { QualifiedId } from '@wireapp/api-client/lib/user';
|
|
2
2
|
import { TypedEventEmitter } from '@wireapp/commons';
|
|
3
|
-
import {
|
|
3
|
+
import { CoreCrypto, E2eiConversationState, WireIdentity, DeviceStatus } from '@wireapp/core-crypto';
|
|
4
4
|
import { ClientService } from '../../../client';
|
|
5
5
|
import { CoreDatabase } from '../../../storage/CoreDB';
|
|
6
6
|
import { RecurringTaskScheduler } from '../../../util/RecurringTaskScheduler';
|
|
7
|
+
import { MLSService } from '../MLSService';
|
|
7
8
|
export type DeviceIdentity = Omit<WireIdentity, 'free' | 'status'> & {
|
|
8
9
|
status?: DeviceStatus;
|
|
9
10
|
deviceId: string;
|
|
@@ -17,13 +18,14 @@ export declare class E2EIServiceExternal extends TypedEventEmitter<Events> {
|
|
|
17
18
|
private readonly coreDatabase;
|
|
18
19
|
private readonly recurringTaskScheduler;
|
|
19
20
|
private readonly clientService;
|
|
20
|
-
private readonly
|
|
21
|
+
private readonly mlsService;
|
|
21
22
|
private _acmeService?;
|
|
22
|
-
constructor(coreCryptoClient: CoreCrypto, coreDatabase: CoreDatabase, recurringTaskScheduler: RecurringTaskScheduler, clientService: ClientService,
|
|
23
|
+
constructor(coreCryptoClient: CoreCrypto, coreDatabase: CoreDatabase, recurringTaskScheduler: RecurringTaskScheduler, clientService: ClientService, mlsService: MLSService);
|
|
23
24
|
isEnrollmentInProgress(): boolean;
|
|
24
25
|
clearAllProgress(): void;
|
|
25
26
|
getConversationState(conversationId: Uint8Array): Promise<E2eiConversationState>;
|
|
26
27
|
isE2EIEnabled(): Promise<boolean>;
|
|
28
|
+
getAllGroupUsersIdentities(groupId: string): Promise<Map<string, DeviceIdentity[]>>;
|
|
27
29
|
getUsersIdentities(groupId: string, userIds: QualifiedId[]): Promise<Map<string, DeviceIdentity[]>>;
|
|
28
30
|
getDevicesIdentities(groupId: string, userClientsMap: Record<string, QualifiedId>): Promise<DeviceIdentity[]>;
|
|
29
31
|
isFreshMLSSelfClient(): Promise<boolean>;
|
|
@@ -55,7 +57,7 @@ export declare class E2EIServiceExternal extends TypedEventEmitter<Events> {
|
|
|
55
57
|
validateSelfCrl(): Promise<void>;
|
|
56
58
|
private validateRemoteCrlDistributionPoint;
|
|
57
59
|
private validateCrl;
|
|
58
|
-
handleNewRemoteCrlDistributionPoints
|
|
60
|
+
private handleNewRemoteCrlDistributionPoints;
|
|
59
61
|
}
|
|
60
62
|
export {};
|
|
61
63
|
//# sourceMappingURL=E2EIServiceExternal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"E2EIServiceExternal.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/mls/E2EIdentityService/E2EIServiceExternal.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAIzD,OAAO,EAAC,iBAAiB,EAAC,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"E2EIServiceExternal.d.ts","sourceRoot":"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CAAC,cAAc,EAAE,UAAU,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAIhF,aAAa,IAAI,OAAO,CAAC,OAAO,CAAC;IAI3B,0BAA0B,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,cAAc,EAAE,CAAC,CAAC;IAgBnF,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,cAAc,EAAE,CAAC,CAAC;IA6CnG,oBAAoB,CAC/B,OAAO,EAAE,MAAM,EACf,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,GAC1C,OAAO,CAAC,cAAc,EAAE,CAAC;IAef,oBAAoB,IAAI,OAAO,CAAC,OAAO,CAAC;YAQvC,4BAA4B;IAO7B,UAAU,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI5D,OAAO,KAAK,WAAW,GAKtB;YAEa,+BAA+B;IAK7C;;;;;;;;;;;;;;OAcG;IACU,0BAA0B,IAAI,OAAO,CAAC,IAAI,CAAC;IA6B3C,2BAA2B,CAAC,oBAAoB,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAI3F,OAAO,CAAC,4BAA4B;YAStB,+BAA+B;YAQ/B,uBAAuB;YAKvB,0BAA0B;IAI3B,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;YAQ/B,kCAAkC;YASlC,WAAW;YAkBX,oCAAoC;CAKnD"}
|
|
@@ -28,16 +28,18 @@ const E2EIStorage_1 = require("./Storage/E2EIStorage");
|
|
|
28
28
|
const fullyQualifiedClientIdUtils_1 = require("../../../util/fullyQualifiedClientIdUtils");
|
|
29
29
|
const LocalStorageStore_1 = require("../../../util/LocalStorageStore");
|
|
30
30
|
const LowPrecisionTaskScheduler_1 = require("../../../util/LowPrecisionTaskScheduler");
|
|
31
|
+
const qualifiedIdUtil_1 = require("../../../util/qualifiedIdUtil");
|
|
31
32
|
// This export is meant to be accessible from the outside (e.g the Webapp / UI)
|
|
32
33
|
class E2EIServiceExternal extends commons_1.TypedEventEmitter {
|
|
33
|
-
constructor(coreCryptoClient, coreDatabase, recurringTaskScheduler, clientService,
|
|
34
|
+
constructor(coreCryptoClient, coreDatabase, recurringTaskScheduler, clientService, mlsService) {
|
|
34
35
|
super();
|
|
35
36
|
this.coreCryptoClient = coreCryptoClient;
|
|
36
37
|
this.coreDatabase = coreDatabase;
|
|
37
38
|
this.recurringTaskScheduler = recurringTaskScheduler;
|
|
38
39
|
this.clientService = clientService;
|
|
39
|
-
this.
|
|
40
|
+
this.mlsService = mlsService;
|
|
40
41
|
void this.initialiseCrlDistributionTimers();
|
|
42
|
+
mlsService.on('newCrlDistributionPoints', this.handleNewRemoteCrlDistributionPoints);
|
|
41
43
|
}
|
|
42
44
|
// If we have a handle in the local storage, we are in the enrollment process (this handle is saved before oauth redirect)
|
|
43
45
|
isEnrollmentInProgress() {
|
|
@@ -50,7 +52,17 @@ class E2EIServiceExternal extends commons_1.TypedEventEmitter {
|
|
|
50
52
|
return this.coreCryptoClient.e2eiConversationState(conversationId);
|
|
51
53
|
}
|
|
52
54
|
isE2EIEnabled() {
|
|
53
|
-
return this.coreCryptoClient.e2eiIsEnabled(this.cipherSuite);
|
|
55
|
+
return this.coreCryptoClient.e2eiIsEnabled(this.mlsService.config.cipherSuite);
|
|
56
|
+
}
|
|
57
|
+
async getAllGroupUsersIdentities(groupId) {
|
|
58
|
+
const allGroupClients = await this.mlsService.getClientIds(groupId);
|
|
59
|
+
const userIdsMap = allGroupClients.reduce((acc, { userId, domain }) => {
|
|
60
|
+
const qualifiedId = { id: userId, domain };
|
|
61
|
+
acc[(0, qualifiedIdUtil_1.stringifyQualifiedId)(qualifiedId)] = qualifiedId;
|
|
62
|
+
return acc;
|
|
63
|
+
}, {});
|
|
64
|
+
const userIds = Object.values(userIdsMap);
|
|
65
|
+
return this.getUsersIdentities(groupId, userIds);
|
|
54
66
|
}
|
|
55
67
|
async getUsersIdentities(groupId, userIds) {
|
|
56
68
|
const groupIdBytes = bazinga64_1.Decoder.fromBase64(groupId).asBytes;
|
|
@@ -180,11 +192,12 @@ class E2EIServiceExternal extends commons_1.TypedEventEmitter {
|
|
|
180
192
|
});
|
|
181
193
|
}
|
|
182
194
|
async validateCrl(url, crl, onDirty) {
|
|
183
|
-
const { expiration, dirty } = await this.coreCryptoClient.e2eiRegisterCRL(url, crl);
|
|
195
|
+
const { expiration: expirationTimestampSeconds, dirty } = await this.coreCryptoClient.e2eiRegisterCRL(url, crl);
|
|
196
|
+
const expirationTimestamp = expirationTimestampSeconds && expirationTimestampSeconds * TimeUtil_1.TimeInMillis.SECOND;
|
|
184
197
|
await this.cancelCrlDistributionTimer(url);
|
|
185
198
|
//set a new timer that will execute a task once the CRL is expired
|
|
186
|
-
if (
|
|
187
|
-
await this.addCrlDistributionTimer({ expiresAt:
|
|
199
|
+
if (expirationTimestamp !== undefined) {
|
|
200
|
+
await this.addCrlDistributionTimer({ expiresAt: expirationTimestamp, url });
|
|
188
201
|
}
|
|
189
202
|
//if it was dirty, trigger e2eiconversationstate for every conversation
|
|
190
203
|
if (dirty) {
|
|
@@ -18,7 +18,6 @@
|
|
|
18
18
|
*
|
|
19
19
|
*/
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
const core_crypto_1 = require("@wireapp/core-crypto");
|
|
22
21
|
const E2EIServiceExternal_1 = require("./E2EIServiceExternal");
|
|
23
22
|
const CoreDB_1 = require("../../../storage/CoreDB");
|
|
24
23
|
const PayloadHelper_1 = require("../../../test/PayloadHelper");
|
|
@@ -30,6 +29,10 @@ async function buildE2EIService() {
|
|
|
30
29
|
};
|
|
31
30
|
const clientService = {};
|
|
32
31
|
const mockedDb = await (0, CoreDB_1.openDB)('core-test-db');
|
|
32
|
+
const mockedMLSService = {
|
|
33
|
+
on: jest.fn(),
|
|
34
|
+
getClientIds: jest.fn(),
|
|
35
|
+
};
|
|
33
36
|
const recurringTaskScheduler = new RecurringTaskScheduler_1.RecurringTaskScheduler({
|
|
34
37
|
delete: key => mockedDb.delete('recurringTasks', key),
|
|
35
38
|
get: async (key) => { var _a; return (_a = (await mockedDb.get('recurringTasks', key))) === null || _a === void 0 ? void 0 : _a.firingDate; },
|
|
@@ -38,8 +41,8 @@ async function buildE2EIService() {
|
|
|
38
41
|
},
|
|
39
42
|
});
|
|
40
43
|
return [
|
|
41
|
-
new E2EIServiceExternal_1.E2EIServiceExternal(coreCrypto, mockedDb, recurringTaskScheduler, clientService,
|
|
42
|
-
{ coreCrypto },
|
|
44
|
+
new E2EIServiceExternal_1.E2EIServiceExternal(coreCrypto, mockedDb, recurringTaskScheduler, clientService, mockedMLSService),
|
|
45
|
+
{ coreCrypto, mlsService: mockedMLSService },
|
|
43
46
|
];
|
|
44
47
|
}
|
|
45
48
|
function generateCoreCryptoIdentity({ userId, status = 'Valid', deviceId = (0, PayloadHelper_1.getUUID)(), }) {
|
|
@@ -91,4 +94,31 @@ describe('E2EIServiceExternal', () => {
|
|
|
91
94
|
expect(userIdentities.get(user2.id)).toHaveLength(1);
|
|
92
95
|
});
|
|
93
96
|
});
|
|
97
|
+
describe('getAllGroupUsersIdentities', () => {
|
|
98
|
+
it('returns all the user identities of a mls group', async () => {
|
|
99
|
+
const [service, { coreCrypto, mlsService }] = await buildE2EIService();
|
|
100
|
+
const user1 = {
|
|
101
|
+
domain: 'elna.wire.link',
|
|
102
|
+
userId: '48a1c3b0-4b0e-4bcd-93ad-64c7344b1534',
|
|
103
|
+
clientId: '74a50c1f4352b41f',
|
|
104
|
+
};
|
|
105
|
+
const user2 = {
|
|
106
|
+
domain: 'elna.wire.link',
|
|
107
|
+
userId: 'b7d287e4-7bbd-40e0-a550-6b18dcaf5f31',
|
|
108
|
+
clientId: '452cb4c65f0369a8',
|
|
109
|
+
};
|
|
110
|
+
const clientIds = [user1, user2];
|
|
111
|
+
jest.spyOn(mlsService, 'getClientIds').mockResolvedValue(clientIds);
|
|
112
|
+
coreCrypto.getUserIdentities.mockResolvedValue(new Map([
|
|
113
|
+
[
|
|
114
|
+
user1.userId,
|
|
115
|
+
[generateCoreCryptoIdentity({ userId: user1.userId }), generateCoreCryptoIdentity({ userId: user1.userId })],
|
|
116
|
+
],
|
|
117
|
+
[user2.userId, [generateCoreCryptoIdentity({ userId: user2.userId })]],
|
|
118
|
+
]));
|
|
119
|
+
const userIdentities = await service.getAllGroupUsersIdentities(groupId);
|
|
120
|
+
expect(userIdentities.get(user1.userId)).toHaveLength(2);
|
|
121
|
+
expect(userIdentities.get(user2.userId)).toHaveLength(1);
|
|
122
|
+
});
|
|
123
|
+
});
|
|
94
124
|
});
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import { TypedEventEmitter } from '@wireapp/commons';
|
|
2
1
|
import { InitParams, RotateBundle } from './E2EIService.types';
|
|
3
|
-
|
|
4
|
-
newCrlDistributionPoints: string[];
|
|
5
|
-
};
|
|
6
|
-
export declare class E2EIServiceInternal extends TypedEventEmitter<Events> {
|
|
2
|
+
export declare class E2EIServiceInternal {
|
|
7
3
|
private static instance;
|
|
8
4
|
private readonly logger;
|
|
9
5
|
private readonly coreCryptoClient;
|
|
@@ -13,6 +9,7 @@ export declare class E2EIServiceInternal extends TypedEventEmitter<Events> {
|
|
|
13
9
|
private identity?;
|
|
14
10
|
private acmeService?;
|
|
15
11
|
private isInitialized;
|
|
12
|
+
private readonly dispatchNewCrlDistributionPoints;
|
|
16
13
|
private constructor();
|
|
17
14
|
static getInstance(params?: InitParams): Promise<E2EIServiceInternal>;
|
|
18
15
|
startCertificateProcess(hasActiveCertificate: boolean): Promise<{
|
|
@@ -65,5 +62,4 @@ export declare class E2EIServiceInternal extends TypedEventEmitter<Events> {
|
|
|
65
62
|
*/
|
|
66
63
|
startRefreshCertficateFlow(oAuthIdToken: string, hasActiveCertificate: boolean): Promise<RotateBundle>;
|
|
67
64
|
}
|
|
68
|
-
export {};
|
|
69
65
|
//# sourceMappingURL=E2EIServiceInternal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"E2EIServiceInternal.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/mls/E2EIdentityService/E2EIServiceInternal.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"E2EIServiceInternal.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/mls/E2EIdentityService/E2EIServiceInternal.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAyD,UAAU,EAAE,YAAY,EAAC,MAAM,qBAAqB,CAAC;AAcrH,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAsB;IAC7C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAuD;IAC9E,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAa;IAC9C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAY;IACtC,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAsB;IACzD,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAC;IACnC,OAAO,CAAC,QAAQ,CAAC,CAAiB;IAClC,OAAO,CAAC,WAAW,CAAC,CAAc;IAClC,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,QAAQ,CAAC,gCAAgC,CAAqD;IAEtG,OAAO;WAiBa,WAAW,CAAC,MAAM,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAgCrE,uBAAuB,CAAC,oBAAoB,EAAE,OAAO;;;;;;;;IAOrD,0BAA0B,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC;YAUlF,YAAY;YA2BZ,IAAI;YAUJ,YAAY;YAUZ,eAAe;IAQ7B;;;;;OAKG;YACW,uBAAuB;IAiDrC;;;;;;;OAOG;YACW,sCAAsC;IAiEpD;;;OAGG;YACW,iBAAiB;IAwB/B;;;;;;OAMG;YACW,iBAAiB;IAe/B;;;;;OAKG;IACU,0BAA0B,CAAC,YAAY,EAAE,MAAM,EAAE,oBAAoB,EAAE,OAAO;CAa5F"}
|
|
@@ -24,7 +24,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
24
24
|
exports.E2EIServiceInternal = void 0;
|
|
25
25
|
const bazinga64_1 = require("bazinga64");
|
|
26
26
|
const logdown_1 = __importDefault(require("logdown"));
|
|
27
|
-
const commons_1 = require("@wireapp/commons");
|
|
28
27
|
const AcmeServer_1 = require("./Connection/AcmeServer");
|
|
29
28
|
const E2EIService_types_1 = require("./E2EIService.types");
|
|
30
29
|
const Helper_1 = require("./Helper");
|
|
@@ -35,15 +34,15 @@ const DpopChallenge_1 = require("./Steps/DpopChallenge");
|
|
|
35
34
|
const OidcChallenge_1 = require("./Steps/OidcChallenge");
|
|
36
35
|
const Order_1 = require("./Steps/Order");
|
|
37
36
|
const E2EIStorage_1 = require("./Storage/E2EIStorage");
|
|
38
|
-
class E2EIServiceInternal
|
|
39
|
-
constructor(coreCryptClient, apiClient, e2eiServiceExternal, keyPackagesAmount = 100) {
|
|
40
|
-
super();
|
|
37
|
+
class E2EIServiceInternal {
|
|
38
|
+
constructor(coreCryptClient, apiClient, e2eiServiceExternal, keyPackagesAmount = 100, dispatchNewCrlDistributionPoints) {
|
|
41
39
|
this.logger = (0, logdown_1.default)('@wireapp/core/E2EIdentityServiceInternal');
|
|
42
40
|
this.isInitialized = false;
|
|
43
41
|
this.coreCryptoClient = coreCryptClient;
|
|
44
42
|
this.apiClient = apiClient;
|
|
45
43
|
this.e2eServiceExternal = e2eiServiceExternal;
|
|
46
44
|
this.keyPackagesAmount = keyPackagesAmount;
|
|
45
|
+
this.dispatchNewCrlDistributionPoints = dispatchNewCrlDistributionPoints;
|
|
47
46
|
this.logger.log('Instance of E2EIServiceInternal created');
|
|
48
47
|
}
|
|
49
48
|
// ############ Public Functions ############
|
|
@@ -52,8 +51,8 @@ class E2EIServiceInternal extends commons_1.TypedEventEmitter {
|
|
|
52
51
|
if (!params) {
|
|
53
52
|
throw new Error('E2EIServiceInternal is not initialized. Please call getInstance with params.');
|
|
54
53
|
}
|
|
55
|
-
const { skipInit = false, coreCryptClient, apiClient, e2eiServiceExternal, keyPackagesAmount } = params;
|
|
56
|
-
E2EIServiceInternal.instance = new E2EIServiceInternal(coreCryptClient, apiClient, e2eiServiceExternal, keyPackagesAmount);
|
|
54
|
+
const { skipInit = false, coreCryptClient, apiClient, e2eiServiceExternal, keyPackagesAmount, dispatchNewCrlDistributionPoints, } = params;
|
|
55
|
+
E2EIServiceInternal.instance = new E2EIServiceInternal(coreCryptClient, apiClient, e2eiServiceExternal, keyPackagesAmount, dispatchNewCrlDistributionPoints);
|
|
57
56
|
if (!skipInit) {
|
|
58
57
|
const { discoveryUrl, user, clientId } = params;
|
|
59
58
|
if (!discoveryUrl || !user || !clientId) {
|
|
@@ -83,12 +82,13 @@ class E2EIServiceInternal extends commons_1.TypedEventEmitter {
|
|
|
83
82
|
const { user } = E2EIStorage_1.E2EIStorage.get.initialData();
|
|
84
83
|
// How long the issued certificate should be maximal valid
|
|
85
84
|
const expiryDays = 90;
|
|
85
|
+
const expirySecs = expiryDays * 24 * 60 * 60;
|
|
86
86
|
const ciphersuite = E2EIService_types_1.Ciphersuite.MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519;
|
|
87
87
|
if (hasActiveCertificate) {
|
|
88
|
-
this.identity = await this.coreCryptoClient.e2eiNewRotateEnrollment(
|
|
88
|
+
this.identity = await this.coreCryptoClient.e2eiNewRotateEnrollment(expirySecs, ciphersuite, user.displayName, user.handle, user.teamId);
|
|
89
89
|
}
|
|
90
90
|
else {
|
|
91
|
-
this.identity = await this.coreCryptoClient.e2eiNewActivationEnrollment(user.displayName, user.handle,
|
|
91
|
+
this.identity = await this.coreCryptoClient.e2eiNewActivationEnrollment(user.displayName, user.handle, expirySecs, ciphersuite, user.teamId);
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
async init(params) {
|
|
@@ -225,6 +225,7 @@ class E2EIServiceInternal extends commons_1.TypedEventEmitter {
|
|
|
225
225
|
}
|
|
226
226
|
// Step 10: Initialize MLS with the certificate
|
|
227
227
|
const rotateBundle = await this.coreCryptoClient.e2eiRotateAll(this.identity, certificate, this.keyPackagesAmount);
|
|
228
|
+
this.dispatchNewCrlDistributionPoints(rotateBundle);
|
|
228
229
|
return rotateBundle;
|
|
229
230
|
}
|
|
230
231
|
/**
|
|
@@ -63,8 +63,11 @@ describe('handleMLSMessageAdd', () => {
|
|
|
63
63
|
const mockGroupId = 'AAEAAH87aajaQ011i+rNLmwpy0sAZGl5YS53aXJlLmxpbms=';
|
|
64
64
|
const message = createMockedMessage();
|
|
65
65
|
jest.spyOn(mockedMLSService, 'decryptMessage').mockResolvedValueOnce({
|
|
66
|
-
proposals: [
|
|
66
|
+
proposals: [
|
|
67
|
+
{ proposal: new Uint8Array(), proposalRef: new Uint8Array(), crlNewDistributionPoints: [], free: () => { } },
|
|
68
|
+
],
|
|
67
69
|
commitDelay: 2000,
|
|
70
|
+
crlNewDistributionPoints: [],
|
|
68
71
|
message,
|
|
69
72
|
hasEpochChanged: false,
|
|
70
73
|
isActive: true,
|
|
@@ -64,6 +64,7 @@ export declare class MLSService extends TypedEventEmitter<Events> {
|
|
|
64
64
|
newProposal(proposalType: ProposalType, args: ProposalArgs | AddProposalArgs | RemoveProposalArgs): Promise<import("@wireapp/core-crypto").ProposalBundle>;
|
|
65
65
|
joinByExternalCommit(getGroupInfo: () => Promise<Uint8Array>): Promise<PostMlsMessageResponse>;
|
|
66
66
|
exportSecretKey(groupId: string, keyLength: number): Promise<string>;
|
|
67
|
+
private dispatchNewCrlDistributionPoints;
|
|
67
68
|
processWelcomeMessage(welcomeMessage: Uint8Array): Promise<ConversationId>;
|
|
68
69
|
decryptMessage(conversationId: ConversationId, payload: Uint8Array): Promise<DecryptedMessage>;
|
|
69
70
|
encryptMessage(conversationId: ConversationId, message: Uint8Array): Promise<Uint8Array>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MLSService.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/mls/MLSService/MLSService.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAqB,gBAAgB,EAAC,MAAM,gCAAgC,CAAC;AACzF,OAAO,EAAC,sBAAsB,EAAE,kBAAkB,EAAC,MAAM,sCAAsC,CAAC;AAChG,OAAO,EAAC,8BAA8B,EAAE,2BAA2B,EAAC,MAAM,+BAA+B,CAAC;AAE1G,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAEzD,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAW,iBAAiB,EAAC,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EACL,eAAe,EAIf,cAAc,EACd,UAAU,EAEV,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,kBAAkB,EACnB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAAC,gBAAgB,
|
|
1
|
+
{"version":3,"file":"MLSService.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/mls/MLSService/MLSService.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAqB,gBAAgB,EAAC,MAAM,gCAAgC,CAAC;AACzF,OAAO,EAAC,sBAAsB,EAAE,kBAAkB,EAAC,MAAM,sCAAsC,CAAC;AAChG,OAAO,EAAC,8BAA8B,EAAE,2BAA2B,EAAC,MAAM,+BAA+B,CAAC;AAE1G,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAEzD,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAW,iBAAiB,EAAC,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EACL,eAAe,EAIf,cAAc,EACd,UAAU,EAEV,gBA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C,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAe7D;;;;;;;OAOG;IACU,sBAAsB,CAAC,EAAC,SAAS,EAAE,OAAO,EAAE,SAAS,EAAC,EAAE,4BAA4B;YAWnF,4BAA4B;YAU5B,0BAA0B;IAKxC,OAAO,CAAC,6BAA6B;IAIrC;;;;;OAKG;IACU,sBAAsB,CAAC,EAAC,OAAO,EAAE,UAAkB,EAAC,EAAE,4BAA4B;IAY/F;;;;OAIG;IACU,+BAA+B;IAiB5C;;;;OAIG;IACU,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,QAAQ,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAC,EAAE,CAAC;IAY9F,wBAAwB,CACnC,KAAK,EAAE,8BAA8B,EACrC,yBAAyB,EAAE,CACzB,cAAc,EAAE,WAAW,EAC3B,iBAAiB,CAAC,EAAE,kBAAkB,KACnC,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAgBrB,4BAA4B,CAAC,KAAK,EAAE,2BAA2B,EAAE,QAAQ,EAAE,MAAM;IAcjF,oBAAoB,CAAC,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,UAAU,EAAE;IASjF;;;;;;;;OAQG;IACU,UAAU,CACrB,YAAY,EAAE,MAAM,EACpB,mBAAmB,EAAE,mBAAmB,EACxC,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,gBAAgB,EACxB,SAAS,EAAE,MAAM,EACjB,YAAY,CAAC,EAAE,MAAM,GACpB,OAAO,CAAC,sBAAsB,CAAC;CAiEnC"}
|
|
@@ -184,6 +184,7 @@ class MLSService extends commons_1.TypedEventEmitter {
|
|
|
184
184
|
}
|
|
185
185
|
return this.processCommitAction(groupIdBytes, async () => {
|
|
186
186
|
const commitBundle = await this.coreCryptoClient.addClientsToConversation(groupIdBytes, keyPackages);
|
|
187
|
+
this.dispatchNewCrlDistributionPoints(commitBundle);
|
|
187
188
|
return commitBundle;
|
|
188
189
|
});
|
|
189
190
|
}
|
|
@@ -233,7 +234,9 @@ class MLSService extends commons_1.TypedEventEmitter {
|
|
|
233
234
|
const credentialType = await this.getCredentialType();
|
|
234
235
|
const generateCommit = async () => {
|
|
235
236
|
const groupInfo = await getGroupInfo();
|
|
236
|
-
const
|
|
237
|
+
const joinRequest = await this.coreCryptoClient.joinByExternalCommit(groupInfo, credentialType);
|
|
238
|
+
this.dispatchNewCrlDistributionPoints(joinRequest);
|
|
239
|
+
const { conversationId } = joinRequest, commitBundle = __rest(joinRequest, ["conversationId"]);
|
|
237
240
|
return { groupId: conversationId, commitBundle };
|
|
238
241
|
};
|
|
239
242
|
const { commitBundle, groupId } = await generateCommit();
|
|
@@ -253,16 +256,21 @@ class MLSService extends commons_1.TypedEventEmitter {
|
|
|
253
256
|
const key = await this.coreCryptoClient.exportSecretKey(groupIdBytes, keyLength);
|
|
254
257
|
return bazinga64_1.Encoder.toBase64(key).asString;
|
|
255
258
|
}
|
|
259
|
+
dispatchNewCrlDistributionPoints(payload) {
|
|
260
|
+
const { crlNewDistributionPoints } = payload;
|
|
261
|
+
if (crlNewDistributionPoints && crlNewDistributionPoints.length > 0) {
|
|
262
|
+
this.emit('newCrlDistributionPoints', crlNewDistributionPoints);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
256
265
|
async processWelcomeMessage(welcomeMessage) {
|
|
257
|
-
|
|
266
|
+
const welcomeBundle = await this.coreCryptoClient.processWelcomeMessage(welcomeMessage);
|
|
267
|
+
this.dispatchNewCrlDistributionPoints(welcomeBundle);
|
|
268
|
+
return welcomeBundle.id;
|
|
258
269
|
}
|
|
259
270
|
async decryptMessage(conversationId, payload) {
|
|
260
271
|
try {
|
|
261
272
|
const decryptedMessage = await this.coreCryptoClient.decryptMessage(conversationId, payload);
|
|
262
|
-
|
|
263
|
-
if (crlNewDistributionPoints && crlNewDistributionPoints.length > 0) {
|
|
264
|
-
this.emit('newCrlDistributionPoints', crlNewDistributionPoints);
|
|
265
|
-
}
|
|
273
|
+
this.dispatchNewCrlDistributionPoints(decryptedMessage);
|
|
266
274
|
return decryptedMessage;
|
|
267
275
|
}
|
|
268
276
|
catch (error) {
|
|
@@ -638,9 +646,7 @@ class MLSService extends commons_1.TypedEventEmitter {
|
|
|
638
646
|
clientId: client.id,
|
|
639
647
|
discoveryUrl,
|
|
640
648
|
keyPackagesAmount: nbPrekeys,
|
|
641
|
-
|
|
642
|
-
instance.on('newCrlDistributionPoints', crlDistributionPoints => {
|
|
643
|
-
this.emit('newCrlDistributionPoints', crlDistributionPoints);
|
|
649
|
+
dispatchNewCrlDistributionPoints: payload => this.dispatchNewCrlDistributionPoints(payload),
|
|
644
650
|
});
|
|
645
651
|
// If we don't have an OAuth id token, we need to start the certificate process with Oauth
|
|
646
652
|
if (!oAuthIdToken) {
|
|
@@ -660,6 +666,7 @@ class MLSService extends commons_1.TypedEventEmitter {
|
|
|
660
666
|
if (rotateBundle === undefined) {
|
|
661
667
|
throw new Error('Could not get the rotate bundle');
|
|
662
668
|
}
|
|
669
|
+
this.dispatchNewCrlDistributionPoints(rotateBundle);
|
|
663
670
|
// upload the clients public keys
|
|
664
671
|
if (!hasActiveCertificate) {
|
|
665
672
|
// we only upload public keys for the initial certification process. Renewals do not need to upload new public keys
|
|
@@ -262,7 +262,9 @@ describe('MLSService', () => {
|
|
|
262
262
|
jest.spyOn(apiClient.api.client, 'getMLSKeyPackageCount').mockResolvedValueOnce(numberOfKeysBelowThreshold);
|
|
263
263
|
jest.spyOn(coreCrypto, 'clientValidKeypackagesCount').mockResolvedValueOnce(numberOfKeysBelowThreshold);
|
|
264
264
|
jest.spyOn(apiClient.api.client, 'uploadMLSKeyPackages').mockResolvedValueOnce(undefined);
|
|
265
|
-
jest
|
|
265
|
+
jest
|
|
266
|
+
.spyOn(coreCrypto, 'processWelcomeMessage')
|
|
267
|
+
.mockResolvedValueOnce({ id: new Uint8Array(), crlNewDistributionPoints: [], free: () => { } });
|
|
266
268
|
jest.spyOn(mlsService, 'scheduleKeyMaterialRenewal').mockImplementation(jest.fn());
|
|
267
269
|
const mockedMLSWelcomeEvent = {
|
|
268
270
|
type: event_1.CONVERSATION_EVENT.MLS_WELCOME_MESSAGE,
|
|
@@ -286,7 +288,9 @@ describe('MLSService', () => {
|
|
|
286
288
|
jest.spyOn(coreCrypto, 'clientValidKeypackagesCount').mockResolvedValueOnce(numberOfKeysAboveThreshold);
|
|
287
289
|
jest.spyOn(apiClient.api.client, 'getMLSKeyPackageCount').mockResolvedValueOnce(numberOfKeysAboveThreshold);
|
|
288
290
|
jest.spyOn(apiClient.api.client, 'uploadMLSKeyPackages').mockResolvedValueOnce(undefined);
|
|
289
|
-
jest
|
|
291
|
+
jest
|
|
292
|
+
.spyOn(coreCrypto, 'processWelcomeMessage')
|
|
293
|
+
.mockResolvedValueOnce({ id: new Uint8Array(), crlNewDistributionPoints: [], free: () => { } });
|
|
290
294
|
jest.spyOn(mlsService, 'scheduleKeyMaterialRenewal').mockImplementation(jest.fn());
|
|
291
295
|
const mockedMLSWelcomeEvent = {
|
|
292
296
|
type: event_1.CONVERSATION_EVENT.MLS_WELCOME_MESSAGE,
|
|
@@ -311,7 +315,9 @@ describe('MLSService', () => {
|
|
|
311
315
|
jest.spyOn(coreCrypto, 'clientValidKeypackagesCount').mockResolvedValueOnce(numberOfKeysBelowThreshold);
|
|
312
316
|
jest.spyOn(apiClient.api.client, 'getMLSKeyPackageCount').mockResolvedValueOnce(numberOfKeysAboveThreshold);
|
|
313
317
|
jest.spyOn(apiClient.api.client, 'uploadMLSKeyPackages').mockResolvedValueOnce(undefined);
|
|
314
|
-
jest
|
|
318
|
+
jest
|
|
319
|
+
.spyOn(coreCrypto, 'processWelcomeMessage')
|
|
320
|
+
.mockResolvedValueOnce({ id: new Uint8Array(), crlNewDistributionPoints: [], free: () => { } });
|
|
315
321
|
jest.spyOn(mlsService, 'scheduleKeyMaterialRenewal').mockImplementation(jest.fn());
|
|
316
322
|
const mockedMLSWelcomeEvent = {
|
|
317
323
|
type: event_1.CONVERSATION_EVENT.MLS_WELCOME_MESSAGE,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MLSService.types.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/mls/MLSService/MLSService.types.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAC,WAAW,EAAE,YAAY,EAAC,MAAM,sBAAsB,CAAC;AAEpE,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,sBAAsB,CAAC,EAAE,MAAM,OAAO,CAAC,YAAY,CAAC,CAAC;IAErD;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,6BAA6B,EAAE,MAAM,CAAC;IACtC;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,WAAW,EAAE,WAAW,CAAC;IACzB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB"}
|
|
1
|
+
{"version":3,"file":"MLSService.types.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/mls/MLSService/MLSService.types.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAC,WAAW,EAAE,YAAY,EAAC,MAAM,sBAAsB,CAAC;AAEpE,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,sBAAsB,CAAC,EAAE,MAAM,OAAO,CAAC,YAAY,CAAC,CAAC;IAErD;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,6BAA6B,EAAE,MAAM,CAAC;IACtC;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,WAAW,EAAE,WAAW,CAAC;IACzB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,MAAM,+BAA+B,GAAG;IAAC,wBAAwB,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAA;CAAC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { QualifiedId } from '@wireapp/api-client/lib/user';
|
|
2
|
+
export declare const stringifyQualifiedId: (qualifiedId: QualifiedId) => `${string}@${string}`;
|
|
3
|
+
export declare const parseQualifiedId: (qualifiedId: string) => QualifiedId;
|
|
4
|
+
//# sourceMappingURL=qualifiedIdUtil.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"qualifiedIdUtil.d.ts","sourceRoot":"","sources":["../../src/util/qualifiedIdUtil.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAEzD,eAAO,MAAM,oBAAoB,gBAAiB,WAAW,KAAG,GAAG,MAAM,IAAI,MAAM,EACxC,CAAC;AAE5C,eAAO,MAAM,gBAAgB,gBAAiB,MAAM,KAAG,WAMtD,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Wire
|
|
4
|
+
* Copyright (C) 2024 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.parseQualifiedId = exports.stringifyQualifiedId = void 0;
|
|
22
|
+
const stringifyQualifiedId = (qualifiedId) => `${qualifiedId.id}@${qualifiedId.domain}`;
|
|
23
|
+
exports.stringifyQualifiedId = stringifyQualifiedId;
|
|
24
|
+
const parseQualifiedId = (qualifiedId) => {
|
|
25
|
+
const [id, domain] = qualifiedId.split('@');
|
|
26
|
+
if (!id || !domain) {
|
|
27
|
+
throw new Error(`given qualified ID is corrupted (${qualifiedId})`);
|
|
28
|
+
}
|
|
29
|
+
return { id, domain };
|
|
30
|
+
};
|
|
31
|
+
exports.parseQualifiedId = parseQualifiedId;
|
package/package.json
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"@wireapp/api-client": "^26.10.3",
|
|
15
15
|
"@wireapp/commons": "^5.2.4",
|
|
16
|
-
"@wireapp/core-crypto": "1.0.0-rc.
|
|
16
|
+
"@wireapp/core-crypto": "1.0.0-rc.36",
|
|
17
17
|
"@wireapp/cryptobox": "12.8.0",
|
|
18
18
|
"@wireapp/promise-queue": "^2.2.9",
|
|
19
19
|
"@wireapp/protocol-messaging": "1.44.0",
|
|
@@ -61,6 +61,6 @@
|
|
|
61
61
|
"test:coverage": "jest --coverage",
|
|
62
62
|
"watch": "tsc --watch"
|
|
63
63
|
},
|
|
64
|
-
"version": "43.
|
|
65
|
-
"gitHead": "
|
|
64
|
+
"version": "43.12.1",
|
|
65
|
+
"gitHead": "b9cf581d877fa97e4be1f99fe0e0ecc4252bfdae"
|
|
66
66
|
}
|