@wireapp/core 43.0.0 → 43.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/lib/conversation/ConversationService/ConversationService.d.ts.map +1 -1
- package/lib/conversation/ConversationService/ConversationService.js +3 -1
- package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceExternal.d.ts.map +1 -1
- package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceExternal.js +3 -9
- package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceExternal.test.js +2 -2
- package/lib/messagingProtocols/mls/E2EIdentityService/Helper/index.d.ts +0 -2
- package/lib/messagingProtocols/mls/E2EIdentityService/Helper/index.d.ts.map +1 -1
- package/lib/messagingProtocols/mls/E2EIdentityService/Helper/index.js +2 -11
- package/lib/messagingProtocols/mls/MLSService/MLSService.d.ts +6 -5
- package/lib/messagingProtocols/mls/MLSService/MLSService.d.ts.map +1 -1
- package/lib/messagingProtocols/mls/MLSService/MLSService.js +28 -24
- package/lib/messagingProtocols/mls/MLSService/MLSService.test.js +1 -0
- package/lib/messagingProtocols/mls/MLSService/MLSService.types.d.ts +2 -6
- package/lib/messagingProtocols/mls/MLSService/MLSService.types.d.ts.map +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConversationService.d.ts","sourceRoot":"","sources":["../../../src/conversation/ConversationService/ConversationService.ts"],"names":[],"mappings":"AAmBA,OAAO,EACL,YAAY,EACZ,2BAA2B,EAC3B,WAAW,EACX,eAAe,EACf,oBAAoB,EAEpB,mBAAmB,EACnB,sBAAsB,EACtB,eAAe,EACf,kBAAkB,EACnB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EACL,YAAY,EAIZ,4BAA4B,EAE7B,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAC,GAAG,EAAC,MAAM,oCAAoC,CAAC;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E,WAAW,EACnB,aAAa,EAAE,MAAM,GAAG,IAAI,GAC3B,OAAO,CAAC,IAAI,CAAC;IAaT,yBAAyB,CAC9B,cAAc,EAAE,WAAW,EAC3B,QAAQ,EAAE,OAAO,EACjB,gBAAgB,GAAE,MAAM,GAAG,IAAiB,GAC3C,OAAO,CAAC,IAAI,CAAC;IAaT,yBAAyB,CAC9B,cAAc,EAAE,MAAM,EACtB,MAAM,EAAE,MAAM,EACd,gBAAgB,EAAE,2BAA2B,GAAG,MAAM,GACrD,OAAO,CAAC,IAAI,CAAC;IAMhB;;;;OAIG;IAEH;;;OAGG;IACU,qBAAqB,CAChC,gBAAgB,EAAE,eAAe,EACjC,UAAU,EAAE,WAAW,EACvB,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,6BAA6B,CAAC;YAmC3B,cAAc;IA2C5B;;;;;;OAMG;IACU,yBAAyB,CAAC,EACrC,cAAc,EACd,OAAO,EACP,cAAc,GACf,EAAE,QAAQ,CAAC,cAAc,CAAC,GAAG,OAAO,CAAC,6BAA6B,CAAC;IAmBvD,8BAA8B,CAAC,EAC1C,OAAO,EACP,cAAc,EACd,gBAAgB,GACjB,EAAE,iBAAiB,GAAG,OAAO,CAAC,6BAA6B,CAAC;IAoBhD,oBAAoB,CAAC,cAAc,EAAE,WAAW;IAI7D;;;;;OAKG;IACU,wBAAwB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAmBpE;;;OAGG;IACU,qBAAqB,CAAC,OAAO,EAAE,MAAM;IAIlD;;;;OAIG;IACU,4BAA4B,CAAC,OAAO,EAAE,MAAM;IAI5C,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;YAIlD,YAAY;IAYb,gCAAgC;
|
|
1
|
+
{"version":3,"file":"ConversationService.d.ts","sourceRoot":"","sources":["../../../src/conversation/ConversationService/ConversationService.ts"],"names":[],"mappings":"AAmBA,OAAO,EACL,YAAY,EACZ,2BAA2B,EA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lD;;;;OAIG;IACU,4BAA4B,CAAC,OAAO,EAAE,MAAM;IAI5C,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;YAIlD,YAAY;IAYb,gCAAgC;IAe7C;;;;;OAKG;YACW,+BAA+B;IA6B7C;;;OAGG;IACG,sBAAsB,CAAC,MAAM,EAAE,WAAW;IAIhD;;;;;;;OAOG;IACH,SAAgB,4BAA4B,YACjC,MAAM,YACL;QAAC,IAAI,EAAE,WAAW,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAC,eAChC,WAAW,4BAEvB,QAAQ,eAAe,CAAC,CAoDzB;IAEF;;;;;;;;OAQG;IACU,uBAAuB,CAAC,EACnC,OAAO,EACP,cAAc,EACd,UAAU,EACV,cAAc,GACf,EAAE;QACD,OAAO,EAAE,MAAM,CAAC;QAChB,cAAc,EAAE,WAAW,CAAC;QAC5B,UAAU,EAAE,WAAW,CAAC;QACxB,cAAc,EAAE,WAAW,EAAE,CAAC;KAC/B,GAAG,OAAO,CAAC,IAAI,CAAC;YA4BH,wBAAwB;YAoBxB,uCAAuC;YAYvC,4BAA4B;YAI5B,wBAAwB;YAIxB,yBAAyB;IAKvC;;;;OAIG;IACU,WAAW,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,kBAAkB,CAAC;CAoB3E"}
|
|
@@ -386,7 +386,9 @@ class ConversationService extends commons_1.TypedEventEmitter {
|
|
|
386
386
|
const foundConversations = conversations.found || [];
|
|
387
387
|
const mlsConversations = foundConversations.filter(util_1.isMLSConversation);
|
|
388
388
|
//check all the established conversations' epoch with the core-crypto epoch
|
|
389
|
-
|
|
389
|
+
for (const mlsConversation of mlsConversations) {
|
|
390
|
+
await this.handleConversationEpochMismatch(mlsConversation);
|
|
391
|
+
}
|
|
390
392
|
}
|
|
391
393
|
/**
|
|
392
394
|
* Handles epoch mismatch in a single MLS conversation.
|
|
@@ -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,WAAW,EAAE,UAAU,EAAE,qBAAqB,EAAE,YAAY,EAAC,MAAM,sBAAsB,CAAC;AAKlG,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAG9C,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC,GAAG;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAC,CAAC;AAG7E,qBAAa,mBAAmB;IAI5B,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IACjC,OAAO,CAAC,QAAQ,CAAC,aAAa;IAJhC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAuD;gBAG3D,gBAAgB,EAAE,UAAU,EAC5B,aAAa,EAAE,aAAa;IAIxC,oBAAoB,IAAI,OAAO;IAK/B,kBAAkB,IAAI,MAAM,GAAG,SAAS;IAUxC,sBAAsB,IAAI,OAAO;IAIjC,gBAAgB,IAAI,IAAI;IAIxB,oBAAoB,CAAC,cAAc,EAAE,UAAU,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAIhF,aAAa,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC;IAInD,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,cAAc,EAAE,CAAC,CAAC;
|
|
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,WAAW,EAAE,UAAU,EAAE,qBAAqB,EAAE,YAAY,EAAC,MAAM,sBAAsB,CAAC;AAKlG,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAG9C,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC,GAAG;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAC,CAAC;AAG7E,qBAAa,mBAAmB;IAI5B,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IACjC,OAAO,CAAC,QAAQ,CAAC,aAAa;IAJhC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAuD;gBAG3D,gBAAgB,EAAE,UAAU,EAC5B,aAAa,EAAE,aAAa;IAIxC,oBAAoB,IAAI,OAAO;IAK/B,kBAAkB,IAAI,MAAM,GAAG,SAAS;IAUxC,sBAAsB,IAAI,OAAO;IAIjC,gBAAgB,IAAI,IAAI;IAIxB,oBAAoB,CAAC,cAAc,EAAE,UAAU,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAIhF,aAAa,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC;IAInD,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,cAAc,EAAE,CAAC,CAAC;IAqBnG,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;CAItD"}
|
|
@@ -62,16 +62,10 @@ class E2EIServiceExternal {
|
|
|
62
62
|
return this.coreCryptoClient.e2eiIsEnabled(ciphersuite);
|
|
63
63
|
}
|
|
64
64
|
async getUsersIdentities(groupId, userIds) {
|
|
65
|
-
|
|
66
|
-
const hashedIdMap = new Map(userIds.map(userId => [(0, Helper_1.uuidTobase64url)(userId.id).asString, userId]));
|
|
67
|
-
const userIdentities = await this.coreCryptoClient.getUserIdentities(bazinga64_1.Decoder.fromBase64(groupId).asBytes, Array.from(hashedIdMap.keys()));
|
|
65
|
+
const userIdentities = await this.coreCryptoClient.getUserIdentities(bazinga64_1.Decoder.fromBase64(groupId).asBytes, userIds.map(userId => userId.id));
|
|
68
66
|
const mappedUserIdentities = new Map();
|
|
69
|
-
for (const [
|
|
70
|
-
|
|
71
|
-
const userId = hashedIdMap.get(base64Id);
|
|
72
|
-
if (userId) {
|
|
73
|
-
mappedUserIdentities.set(userId.id, identities.map(identity => (Object.assign(Object.assign({}, identity), { deviceId: (0, fullyQualifiedClientIdUtils_1.parseFullQualifiedClientId)(identity.client_id).client }))));
|
|
74
|
-
}
|
|
67
|
+
for (const [userId, identities] of userIdentities) {
|
|
68
|
+
mappedUserIdentities.set(userId, identities.map(identity => (Object.assign(Object.assign({}, identity), { deviceId: (0, fullyQualifiedClientIdUtils_1.parseFullQualifiedClientId)(identity.client_id).client }))));
|
|
75
69
|
}
|
|
76
70
|
return mappedUserIdentities;
|
|
77
71
|
}
|
|
@@ -46,8 +46,8 @@ describe('E2EIServiceExternal', () => {
|
|
|
46
46
|
const user2 = { domain: 'elna.wire.link', id: 'b7d287e4-7bbd-40e0-a550-6b18dcaf5f31' };
|
|
47
47
|
const userIds = [user1, user2];
|
|
48
48
|
coreCrypto.getUserIdentities.mockResolvedValue(new Map([
|
|
49
|
-
['
|
|
50
|
-
['
|
|
49
|
+
['48a1c3b0-4b0e-4bcd-93ad-64c7344b1534', [generateCoreCryptoIdentity(), generateCoreCryptoIdentity()]],
|
|
50
|
+
['b7d287e4-7bbd-40e0-a550-6b18dcaf5f31', [generateCoreCryptoIdentity()]],
|
|
51
51
|
]));
|
|
52
52
|
const userIdentities = await service.getUsersIdentities(groupId, userIds);
|
|
53
53
|
expect(userIdentities.get(user1.id)).toBeDefined();
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { EncodedData } from 'bazinga64';
|
|
2
1
|
import { ClientIdStringType } from '../../../../util/fullyQualifiedClientIdUtils';
|
|
3
2
|
export declare const jsonToByteArray: (data: any) => Uint8Array;
|
|
4
|
-
export declare const uuidTobase64url: (uuid: string) => EncodedData;
|
|
5
3
|
type GetE2EIClientIdReturnType = {
|
|
6
4
|
asString: ClientIdStringType;
|
|
7
5
|
asBytes: Uint8Array;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/messagingProtocols/mls/E2EIdentityService/Helper/index.ts"],"names":[],"mappings":"AAmBA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/messagingProtocols/mls/E2EIdentityService/Helper/index.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,kBAAkB,EAAkC,MAAM,8CAA8C,CAAC;AAEjH,eAAO,MAAM,eAAe,SAAU,GAAG,KAAG,UAG3C,CAAC;AAEF,KAAK,yBAAyB,GAAG;IAC/B,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,OAAO,EAAE,UAAU,CAAC;CACrB,CAAC;AACF,eAAO,MAAM,eAAe,aAAc,MAAM,UAAU,MAAM,cAAc,MAAM,KAAG,yBAOtF,CAAC;AAEF,eAAO,MAAM,qBAAqB,WAAY,MAAM,GAAG,SAAS,6BAAiC,CAAC"}
|
|
@@ -18,24 +18,15 @@
|
|
|
18
18
|
*
|
|
19
19
|
*/
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.isResponseStatusValid = exports.getE2EIClientId = exports.
|
|
22
|
-
const bazinga64_1 = require("bazinga64");
|
|
21
|
+
exports.isResponseStatusValid = exports.getE2EIClientId = exports.jsonToByteArray = void 0;
|
|
23
22
|
const fullyQualifiedClientIdUtils_1 = require("../../../../util/fullyQualifiedClientIdUtils");
|
|
24
23
|
const jsonToByteArray = (data) => {
|
|
25
24
|
const encoder = new TextEncoder();
|
|
26
25
|
return encoder.encode(JSON.stringify(data, null, 0));
|
|
27
26
|
};
|
|
28
27
|
exports.jsonToByteArray = jsonToByteArray;
|
|
29
|
-
const uuidTobase64url = (uuid) => {
|
|
30
|
-
const noDashes = uuid.replace(/-/g, '');
|
|
31
|
-
if (noDashes.length !== 32) {
|
|
32
|
-
throw new Error('Invalid UUID');
|
|
33
|
-
}
|
|
34
|
-
return bazinga64_1.Encoder.toBase64Url(bazinga64_1.Converter.hexStringToArrayBufferView(noDashes));
|
|
35
|
-
};
|
|
36
|
-
exports.uuidTobase64url = uuidTobase64url;
|
|
37
28
|
const getE2EIClientId = (clientId, userId, userDomain) => {
|
|
38
|
-
const asString = (0, fullyQualifiedClientIdUtils_1.constructFullyQualifiedClientId)(
|
|
29
|
+
const asString = (0, fullyQualifiedClientIdUtils_1.constructFullyQualifiedClientId)(userId, clientId, userDomain);
|
|
39
30
|
const asBytes = new TextEncoder().encode(asString);
|
|
40
31
|
return {
|
|
41
32
|
asString,
|
|
@@ -5,7 +5,7 @@ import { QualifiedId } from '@wireapp/api-client/lib/user';
|
|
|
5
5
|
import logdown from 'logdown';
|
|
6
6
|
import { APIClient } from '@wireapp/api-client';
|
|
7
7
|
import { TypedEventEmitter } from '@wireapp/commons';
|
|
8
|
-
import { AddProposalArgs, ConversationId, CoreCrypto, DecryptedMessage, ExternalAddProposalArgs, ExternalProposalType,
|
|
8
|
+
import { AddProposalArgs, ConversationId, CoreCrypto, DecryptedMessage, ExternalAddProposalArgs, ExternalProposalType, ProposalArgs, ProposalType, RemoveProposalArgs } from '@wireapp/core-crypto';
|
|
9
9
|
import { MLSServiceConfig } from './MLSService.types';
|
|
10
10
|
import { KeyPackageClaimUser } from '../../../conversation';
|
|
11
11
|
import { CoreDatabase } from '../../../storage/CoreDB';
|
|
@@ -34,19 +34,20 @@ export declare class MLSService extends TypedEventEmitter<Events> {
|
|
|
34
34
|
config: LocalMLSServiceConfig;
|
|
35
35
|
private readonly textEncoder;
|
|
36
36
|
private readonly textDecoder;
|
|
37
|
-
constructor(apiClient: APIClient, coreCryptoClient: CoreCrypto, coreDatabase: CoreDatabase, recurringTaskScheduler: RecurringTaskScheduler, { keyingMaterialUpdateThreshold, nbKeyPackages,
|
|
37
|
+
constructor(apiClient: APIClient, coreCryptoClient: CoreCrypto, coreDatabase: CoreDatabase, recurringTaskScheduler: RecurringTaskScheduler, { keyingMaterialUpdateThreshold, nbKeyPackages, cipherSuite, }: Partial<MLSServiceConfig>);
|
|
38
38
|
initClient(userId: QualifiedId, client: RegisteredClient, blockKeypackageUpload?: boolean): Promise<void>;
|
|
39
|
+
private getCredentialType;
|
|
39
40
|
private readonly uploadCommitBundle;
|
|
40
41
|
/**
|
|
41
42
|
* Will add users to an existing MLS group and send a commit bundle to backend.
|
|
42
43
|
* Cannot be called with an empty array of keys.
|
|
43
44
|
*
|
|
44
45
|
* @param groupId - the group id of the MLS group
|
|
45
|
-
* @param
|
|
46
|
+
* @param keyPackages - the list of keys of clients to add to the MLS group
|
|
46
47
|
*/
|
|
47
|
-
addUsersToExistingConversation(groupId: string,
|
|
48
|
+
addUsersToExistingConversation(groupId: string, keyPackages: Uint8Array[]): Promise<PostMlsMessageResponse>;
|
|
48
49
|
getKeyPackagesPayload(qualifiedUsers: KeyPackageClaimUser[]): Promise<{
|
|
49
|
-
coreCryptoKeyPackagesPayload:
|
|
50
|
+
coreCryptoKeyPackagesPayload: Uint8Array[];
|
|
50
51
|
failedToFetchKeyPackages: QualifiedId[];
|
|
51
52
|
}>;
|
|
52
53
|
getEpoch(groupId: string | Uint8Array): Promise<number>;
|
|
@@ -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,2B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,EAAE,8BAA8B,EACrC,yBAAyB,EAAE,CACzB,cAAc,EAAE,WAAW,EAC3B,iBAAiB,CAAC,EAAE,kBAAkB,KACnC,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAKrB,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,wBAAwB,EAAE,OAAO,EACjC,YAAY,CAAC,EAAE,MAAM,GACpB,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC;CA4DpC"}
|
|
@@ -55,11 +55,10 @@ exports.optionalToUint8Array = optionalToUint8Array;
|
|
|
55
55
|
const defaultConfig = {
|
|
56
56
|
keyingMaterialUpdateThreshold: 1000 * 60 * 60 * 24 * 30, //30 days
|
|
57
57
|
nbKeyPackages: 100,
|
|
58
|
-
|
|
59
|
-
defaultCredentialType: core_crypto_1.CredentialType.Basic,
|
|
58
|
+
cipherSuite: core_crypto_1.Ciphersuite.MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519,
|
|
60
59
|
};
|
|
61
60
|
class MLSService extends commons_1.TypedEventEmitter {
|
|
62
|
-
constructor(apiClient, coreCryptoClient, coreDatabase, recurringTaskScheduler, { keyingMaterialUpdateThreshold = defaultConfig.keyingMaterialUpdateThreshold, nbKeyPackages = defaultConfig.nbKeyPackages,
|
|
61
|
+
constructor(apiClient, coreCryptoClient, coreDatabase, recurringTaskScheduler, { keyingMaterialUpdateThreshold = defaultConfig.keyingMaterialUpdateThreshold, nbKeyPackages = defaultConfig.nbKeyPackages, cipherSuite = defaultConfig.cipherSuite, }) {
|
|
63
62
|
super();
|
|
64
63
|
this.apiClient = apiClient;
|
|
65
64
|
this.coreCryptoClient = coreCryptoClient;
|
|
@@ -140,13 +139,12 @@ class MLSService extends commons_1.TypedEventEmitter {
|
|
|
140
139
|
this.config = {
|
|
141
140
|
keyingMaterialUpdateThreshold,
|
|
142
141
|
nbKeyPackages,
|
|
143
|
-
|
|
144
|
-
defaultCredentialType,
|
|
142
|
+
cipherSuite,
|
|
145
143
|
minRequiredNumberOfAvailableKeyPackages: Math.floor(nbKeyPackages / 2),
|
|
146
144
|
};
|
|
147
145
|
}
|
|
148
146
|
async initClient(userId, client, blockKeypackageUpload = false) {
|
|
149
|
-
await this.coreCryptoClient.mlsInit((0, MLSId_1.generateMLSDeviceId)(userId, client.id), [this.config.
|
|
147
|
+
await this.coreCryptoClient.mlsInit((0, MLSId_1.generateMLSDeviceId)(userId, client.id), [this.config.cipherSuite], this.config.nbKeyPackages);
|
|
150
148
|
await this.coreCryptoClient.registerCallbacks({
|
|
151
149
|
// All authorization/membership rules are enforced on backend
|
|
152
150
|
clientIsExistingGroupUser: async () => true,
|
|
@@ -162,19 +160,24 @@ class MLSService extends commons_1.TypedEventEmitter {
|
|
|
162
160
|
this.logger.info(`Blocked initial key package upload for client ${client.id} as E2EI is enabled`);
|
|
163
161
|
}
|
|
164
162
|
}
|
|
163
|
+
async getCredentialType() {
|
|
164
|
+
return (await this.coreCryptoClient.e2eiIsEnabled(this.config.cipherSuite))
|
|
165
|
+
? core_crypto_1.CredentialType.X509
|
|
166
|
+
: core_crypto_1.CredentialType.Basic;
|
|
167
|
+
}
|
|
165
168
|
/**
|
|
166
169
|
* Will add users to an existing MLS group and send a commit bundle to backend.
|
|
167
170
|
* Cannot be called with an empty array of keys.
|
|
168
171
|
*
|
|
169
172
|
* @param groupId - the group id of the MLS group
|
|
170
|
-
* @param
|
|
173
|
+
* @param keyPackages - the list of keys of clients to add to the MLS group
|
|
171
174
|
*/
|
|
172
|
-
addUsersToExistingConversation(groupId,
|
|
175
|
+
addUsersToExistingConversation(groupId, keyPackages) {
|
|
173
176
|
const groupIdBytes = bazinga64_1.Decoder.fromBase64(groupId).asBytes;
|
|
174
|
-
if (
|
|
177
|
+
if (keyPackages.length < 1) {
|
|
175
178
|
throw new Error('Empty list of keys provided to addUsersToExistingConversation');
|
|
176
179
|
}
|
|
177
|
-
return this.processCommitAction(groupIdBytes, () => this.coreCryptoClient.addClientsToConversation(groupIdBytes,
|
|
180
|
+
return this.processCommitAction(groupIdBytes, () => this.coreCryptoClient.addClientsToConversation(groupIdBytes, keyPackages));
|
|
178
181
|
}
|
|
179
182
|
async getKeyPackagesPayload(qualifiedUsers) {
|
|
180
183
|
/**
|
|
@@ -184,7 +187,7 @@ class MLSService extends commons_1.TypedEventEmitter {
|
|
|
184
187
|
*/
|
|
185
188
|
const failedToFetchKeyPackages = [];
|
|
186
189
|
const keyPackagesSettledResult = await Promise.allSettled(qualifiedUsers.map(({ id, domain, skipOwnClientId }) => this.apiClient.api.client
|
|
187
|
-
.claimMLSKeyPackages(id, domain, (0, numberToHex_1.numberToHex)(this.config.
|
|
190
|
+
.claimMLSKeyPackages(id, domain, (0, numberToHex_1.numberToHex)(this.config.cipherSuite), skipOwnClientId)
|
|
188
191
|
.catch(error => {
|
|
189
192
|
failedToFetchKeyPackages.push({ id, domain });
|
|
190
193
|
// Throw the error so we don't get {status: 'fulfilled', value: undefined}
|
|
@@ -199,15 +202,12 @@ class MLSService extends commons_1.TypedEventEmitter {
|
|
|
199
202
|
const keyPackages = keyPackagesSettledResult
|
|
200
203
|
.filter((result) => result.status === 'fulfilled')
|
|
201
204
|
.map(result => result.value);
|
|
202
|
-
const coreCryptoKeyPackagesPayload = keyPackages.reduce((previousValue,
|
|
205
|
+
const coreCryptoKeyPackagesPayload = keyPackages.reduce((previousValue, { key_packages }) => {
|
|
203
206
|
// skip users that have not uploaded their MLS key packages
|
|
204
|
-
if (
|
|
207
|
+
if (key_packages.length > 0) {
|
|
205
208
|
return [
|
|
206
209
|
...previousValue,
|
|
207
|
-
...
|
|
208
|
-
id: bazinga64_1.Encoder.toBase64(keyPackage.client).asBytes,
|
|
209
|
-
kp: bazinga64_1.Decoder.fromBase64(keyPackage.key_package).asBytes,
|
|
210
|
-
})),
|
|
210
|
+
...key_packages.map(keyPackage => bazinga64_1.Decoder.fromBase64(keyPackage.key_package).asBytes),
|
|
211
211
|
];
|
|
212
212
|
}
|
|
213
213
|
return previousValue;
|
|
@@ -222,9 +222,10 @@ class MLSService extends commons_1.TypedEventEmitter {
|
|
|
222
222
|
return this.coreCryptoClient.newProposal(proposalType, args);
|
|
223
223
|
}
|
|
224
224
|
async joinByExternalCommit(getGroupInfo) {
|
|
225
|
+
const credentialType = await this.getCredentialType();
|
|
225
226
|
const generateCommit = async () => {
|
|
226
227
|
const groupInfo = await getGroupInfo();
|
|
227
|
-
const _a = await this.coreCryptoClient.joinByExternalCommit(groupInfo,
|
|
228
|
+
const _a = await this.coreCryptoClient.joinByExternalCommit(groupInfo, credentialType), { conversationId } = _a, commitBundle = __rest(_a, ["conversationId"]);
|
|
228
229
|
return { groupId: conversationId, commitBundle };
|
|
229
230
|
};
|
|
230
231
|
const { commitBundle, groupId } = await generateCommit();
|
|
@@ -301,9 +302,10 @@ class MLSService extends commons_1.TypedEventEmitter {
|
|
|
301
302
|
const mlsKeyBytes = Object.values(mlsKeys).map((key) => bazinga64_1.Decoder.fromBase64(key).asBytes);
|
|
302
303
|
const configuration = {
|
|
303
304
|
externalSenders: mlsKeyBytes,
|
|
304
|
-
ciphersuite: this.config.
|
|
305
|
+
ciphersuite: this.config.cipherSuite,
|
|
305
306
|
};
|
|
306
|
-
|
|
307
|
+
const credentialType = await this.getCredentialType();
|
|
308
|
+
return this.coreCryptoClient.createConversation(groupIdBytes, credentialType, configuration);
|
|
307
309
|
}
|
|
308
310
|
/**
|
|
309
311
|
* Will create a conversation inside of coreCrypto, add users to it or update the keying material if empty key packages list is provided.
|
|
@@ -367,10 +369,12 @@ class MLSService extends commons_1.TypedEventEmitter {
|
|
|
367
369
|
return doesConversationExist && (await this.getEpoch(groupId)) > 0;
|
|
368
370
|
}
|
|
369
371
|
async clientValidKeypackagesCount() {
|
|
370
|
-
|
|
372
|
+
const credentialType = await this.getCredentialType();
|
|
373
|
+
return this.coreCryptoClient.clientValidKeypackagesCount(this.config.cipherSuite, credentialType);
|
|
371
374
|
}
|
|
372
375
|
async clientKeypackages(amountRequested) {
|
|
373
|
-
|
|
376
|
+
const credentialType = await this.getCredentialType();
|
|
377
|
+
return this.coreCryptoClient.clientKeypackages(this.config.cipherSuite, credentialType, amountRequested);
|
|
374
378
|
}
|
|
375
379
|
/**
|
|
376
380
|
* Will send an empty commit into a group (renew key material)
|
|
@@ -464,7 +468,7 @@ class MLSService extends commons_1.TypedEventEmitter {
|
|
|
464
468
|
return this.uploadMLSKeyPackages(clientId, keyPackages);
|
|
465
469
|
}
|
|
466
470
|
async getRemoteMLSKeyPackageCount(clientId) {
|
|
467
|
-
return this.apiClient.api.client.getMLSKeyPackageCount(clientId, (0, numberToHex_1.numberToHex)(this.config.
|
|
471
|
+
return this.apiClient.api.client.getMLSKeyPackageCount(clientId, (0, numberToHex_1.numberToHex)(this.config.cipherSuite));
|
|
468
472
|
}
|
|
469
473
|
/**
|
|
470
474
|
* Will update the given client on backend with its public key.
|
|
@@ -477,7 +481,7 @@ class MLSService extends commons_1.TypedEventEmitter {
|
|
|
477
481
|
if (typeof client.mls_public_keys.ed25519 === 'string' && client.mls_public_keys.ed25519.length > 0) {
|
|
478
482
|
return;
|
|
479
483
|
}
|
|
480
|
-
const publicKey = await this.coreCryptoClient.clientPublicKey(this.config.
|
|
484
|
+
const publicKey = await this.coreCryptoClient.clientPublicKey(this.config.cipherSuite);
|
|
481
485
|
return this.apiClient.api.client.putClient(client.id, {
|
|
482
486
|
mls_public_keys: { ed25519: btoa(bazinga64_1.Converter.arrayBufferViewToBaselineString(publicKey)) },
|
|
483
487
|
});
|
|
@@ -47,6 +47,7 @@ const createMLSService = async () => {
|
|
|
47
47
|
conversationEpoch: jest.fn(),
|
|
48
48
|
commitPendingProposals: jest.fn(),
|
|
49
49
|
registerCallbacks: jest.fn(),
|
|
50
|
+
e2eiIsEnabled: jest.fn(() => false),
|
|
50
51
|
};
|
|
51
52
|
const mockedDb = await (0, CoreDB_1.openDB)('core-test-db');
|
|
52
53
|
const recurringTaskScheduler = new RecurringTaskScheduler_1.RecurringTaskScheduler({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Ciphersuite, CommitBundle
|
|
1
|
+
import type { Ciphersuite, CommitBundle } from '@wireapp/core-crypto';
|
|
2
2
|
export interface UploadCommitOptions {
|
|
3
3
|
/**
|
|
4
4
|
* If uploading the commit fails and we endup in a scenario where a retrial is possible, then this callback will be called to re-generate a new commit bundle
|
|
@@ -21,11 +21,7 @@ export interface MLSServiceConfig {
|
|
|
21
21
|
/**
|
|
22
22
|
* default ciphersuite to use for MLS (MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519 = 1 by default)
|
|
23
23
|
*/
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* default credential type to use for MLS (Basic = 1 by default)
|
|
27
|
-
*/
|
|
28
|
-
defaultCredentialType: CredentialType;
|
|
24
|
+
cipherSuite: Ciphersuite;
|
|
29
25
|
/**
|
|
30
26
|
* signals if the E2E - Identity process should be used
|
|
31
27
|
*/
|
|
@@ -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,
|
|
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"}
|
package/package.json
CHANGED
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
"./lib/cryptography/AssetCryptography/crypto.node": "./lib/cryptography/AssetCryptography/crypto.browser.js"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@wireapp/api-client": "^26.
|
|
14
|
+
"@wireapp/api-client": "^26.7.1",
|
|
15
15
|
"@wireapp/commons": "^5.2.3",
|
|
16
|
-
"@wireapp/core-crypto": "1.0.0-rc.
|
|
16
|
+
"@wireapp/core-crypto": "1.0.0-rc.21",
|
|
17
17
|
"@wireapp/cryptobox": "12.8.0",
|
|
18
18
|
"@wireapp/promise-queue": "^2.2.8",
|
|
19
19
|
"@wireapp/protocol-messaging": "1.44.0",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"fake-indexeddb": "^4.0.0",
|
|
45
45
|
"jest": "^29.2.1",
|
|
46
46
|
"jest-websocket-mock": "2.5.0",
|
|
47
|
-
"nock": "13.
|
|
47
|
+
"nock": "13.4.0",
|
|
48
48
|
"rimraf": "^3.0.2",
|
|
49
49
|
"typescript": "^5.0.4"
|
|
50
50
|
},
|
|
@@ -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.1.1",
|
|
65
|
+
"gitHead": "e277fc238464f62b36936c79b1b8fa5223f54a4b"
|
|
66
66
|
}
|