@wireapp/core 41.5.1 → 41.6.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 +1 -3
- package/lib/messagingProtocols/mls/MLSService/MLSService.d.ts.map +1 -1
- package/lib/messagingProtocols/mls/MLSService/MLSService.js +15 -13
- package/lib/messagingProtocols/mls/MLSService/MLSService.types.d.ts +15 -1
- package/lib/messagingProtocols/mls/MLSService/MLSService.types.d.ts.map +1 -1
- package/lib/messagingProtocols/mls/types.d.ts +2 -6
- package/lib/messagingProtocols/mls/types.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -29,9 +29,7 @@ export declare class MLSService extends TypedEventEmitter<Events> {
|
|
|
29
29
|
groupIdFromConversationId?: MLSCallbacks['groupIdFromConversationId'];
|
|
30
30
|
private readonly textEncoder;
|
|
31
31
|
private readonly textDecoder;
|
|
32
|
-
|
|
33
|
-
private readonly defaultCredentialType;
|
|
34
|
-
constructor(apiClient: APIClient, coreCryptoClient: CoreCrypto, { keyingMaterialUpdateThreshold, nbKeyPackages, }: Partial<MLSServiceConfig>);
|
|
32
|
+
constructor(apiClient: APIClient, coreCryptoClient: CoreCrypto, { keyingMaterialUpdateThreshold, nbKeyPackages, defaultCiphersuite, defaultCredentialType, }: Partial<MLSServiceConfig>);
|
|
35
33
|
initClient(userId: QualifiedId, clientId: string): Promise<void>;
|
|
36
34
|
createClient(userId: QualifiedId, clientId: string): Promise<void>;
|
|
37
35
|
private uploadCommitBundle;
|
|
@@ -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,8B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AOG;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"}
|
|
@@ -58,31 +58,33 @@ exports.optionalToUint8Array = optionalToUint8Array;
|
|
|
58
58
|
const defaultConfig = {
|
|
59
59
|
keyingMaterialUpdateThreshold: 1000 * 60 * 60 * 24 * 30,
|
|
60
60
|
nbKeyPackages: 100,
|
|
61
|
+
defaultCiphersuite: core_crypto_1.Ciphersuite.MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519,
|
|
62
|
+
defaultCredentialType: core_crypto_1.CredentialType.Basic,
|
|
61
63
|
};
|
|
62
64
|
class MLSService extends TypedEventEmitter_1.TypedEventEmitter {
|
|
63
|
-
constructor(apiClient, coreCryptoClient, { keyingMaterialUpdateThreshold = defaultConfig.keyingMaterialUpdateThreshold, nbKeyPackages = defaultConfig.nbKeyPackages, }) {
|
|
65
|
+
constructor(apiClient, coreCryptoClient, { keyingMaterialUpdateThreshold = defaultConfig.keyingMaterialUpdateThreshold, nbKeyPackages = defaultConfig.nbKeyPackages, defaultCiphersuite = defaultConfig.defaultCiphersuite, defaultCredentialType = defaultConfig.defaultCredentialType, }) {
|
|
64
66
|
super();
|
|
65
67
|
this.apiClient = apiClient;
|
|
66
68
|
this.coreCryptoClient = coreCryptoClient;
|
|
67
69
|
this.logger = (0, logdown_1.default)('@wireapp/core/MLSService');
|
|
68
70
|
this.textEncoder = new TextEncoder();
|
|
69
71
|
this.textDecoder = new TextDecoder();
|
|
70
|
-
this.defaultCiphersuite = core_crypto_1.Ciphersuite.MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519;
|
|
71
|
-
this.defaultCredentialType = core_crypto_1.CredentialType.Basic;
|
|
72
72
|
this.config = {
|
|
73
73
|
keyingMaterialUpdateThreshold,
|
|
74
74
|
nbKeyPackages,
|
|
75
|
+
defaultCiphersuite,
|
|
76
|
+
defaultCredentialType,
|
|
75
77
|
};
|
|
76
78
|
}
|
|
77
79
|
async initClient(userId, clientId) {
|
|
78
80
|
const qualifiedClientId = (0, fullyQualifiedClientIdUtils_1.constructFullyQualifiedClientId)(userId.id, clientId, userId.domain);
|
|
79
|
-
await this.coreCryptoClient.mlsInit(this.textEncoder.encode(qualifiedClientId), [this.defaultCiphersuite]);
|
|
81
|
+
await this.coreCryptoClient.mlsInit(this.textEncoder.encode(qualifiedClientId), [this.config.defaultCiphersuite]);
|
|
80
82
|
}
|
|
81
83
|
async createClient(userId, clientId) {
|
|
82
84
|
await this.initClient(userId, clientId);
|
|
83
85
|
// If the device is new, we need to upload keypackages and public key to the backend
|
|
84
|
-
const publicKey = await this.coreCryptoClient.clientPublicKey(this.defaultCiphersuite);
|
|
85
|
-
const keyPackages = await this.coreCryptoClient.clientKeypackages(this.defaultCiphersuite, this.defaultCredentialType, this.config.nbKeyPackages);
|
|
86
|
+
const publicKey = await this.coreCryptoClient.clientPublicKey(this.config.defaultCiphersuite);
|
|
87
|
+
const keyPackages = await this.coreCryptoClient.clientKeypackages(this.config.defaultCiphersuite, this.config.defaultCredentialType, this.config.nbKeyPackages);
|
|
86
88
|
await this.uploadMLSPublicKeys(publicKey, clientId);
|
|
87
89
|
await this.uploadMLSKeyPackages(keyPackages, clientId);
|
|
88
90
|
}
|
|
@@ -151,7 +153,7 @@ class MLSService extends TypedEventEmitter_1.TypedEventEmitter {
|
|
|
151
153
|
*/
|
|
152
154
|
const failedToFetchKeyPackages = [];
|
|
153
155
|
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)
|
|
156
|
+
.claimMLSKeyPackages(id, domain, (0, numberToHex_1.numberToHex)(this.config.defaultCiphersuite), skipOwnClientId)
|
|
155
157
|
.catch(error => {
|
|
156
158
|
failedToFetchKeyPackages.push({ id, domain });
|
|
157
159
|
// Throw the error so we don't get {status: 'fulfilled', value: undefined}
|
|
@@ -191,7 +193,7 @@ class MLSService extends TypedEventEmitter_1.TypedEventEmitter {
|
|
|
191
193
|
async joinByExternalCommit(getGroupInfo) {
|
|
192
194
|
const generateCommit = async () => {
|
|
193
195
|
const groupInfo = await getGroupInfo();
|
|
194
|
-
const _a = await this.coreCryptoClient.joinByExternalCommit(groupInfo, this.defaultCredentialType), { conversationId } = _a, commitBundle = __rest(_a, ["conversationId"]);
|
|
196
|
+
const _a = await this.coreCryptoClient.joinByExternalCommit(groupInfo, this.config.defaultCredentialType), { conversationId } = _a, commitBundle = __rest(_a, ["conversationId"]);
|
|
195
197
|
return { groupId: conversationId, commitBundle };
|
|
196
198
|
};
|
|
197
199
|
const { commitBundle, groupId } = await generateCommit();
|
|
@@ -322,9 +324,9 @@ class MLSService extends TypedEventEmitter_1.TypedEventEmitter {
|
|
|
322
324
|
const mlsKeyBytes = Object.values(mlsKeys).map((key) => bazinga64_1.Decoder.fromBase64(key).asBytes);
|
|
323
325
|
const configuration = {
|
|
324
326
|
externalSenders: mlsKeyBytes,
|
|
325
|
-
ciphersuite: this.defaultCiphersuite,
|
|
327
|
+
ciphersuite: this.config.defaultCiphersuite,
|
|
326
328
|
};
|
|
327
|
-
return this.coreCryptoClient.createConversation(groupIdBytes, this.defaultCredentialType, configuration);
|
|
329
|
+
return this.coreCryptoClient.createConversation(groupIdBytes, this.config.defaultCredentialType, configuration);
|
|
328
330
|
}
|
|
329
331
|
/**
|
|
330
332
|
* Will create a conversation inside of coreCrypto, add users to it or update the keying material if empty key packages list is provided.
|
|
@@ -375,10 +377,10 @@ class MLSService extends TypedEventEmitter_1.TypedEventEmitter {
|
|
|
375
377
|
return this.coreCryptoClient.conversationExists(groupIdBytes);
|
|
376
378
|
}
|
|
377
379
|
async clientValidKeypackagesCount() {
|
|
378
|
-
return this.coreCryptoClient.clientValidKeypackagesCount(this.defaultCiphersuite, this.defaultCredentialType);
|
|
380
|
+
return this.coreCryptoClient.clientValidKeypackagesCount(this.config.defaultCiphersuite, this.config.defaultCredentialType);
|
|
379
381
|
}
|
|
380
382
|
async clientKeypackages(amountRequested) {
|
|
381
|
-
return this.coreCryptoClient.clientKeypackages(this.defaultCiphersuite, this.defaultCredentialType, amountRequested);
|
|
383
|
+
return this.coreCryptoClient.clientKeypackages(this.config.defaultCiphersuite, this.config.defaultCredentialType, amountRequested);
|
|
382
384
|
}
|
|
383
385
|
/**
|
|
384
386
|
* Will send an empty commit into a group (renew key material)
|
|
@@ -456,7 +458,7 @@ class MLSService extends TypedEventEmitter_1.TypedEventEmitter {
|
|
|
456
458
|
if (validKeyPackagesCount <= minAllowedNumberOfKeyPackages) {
|
|
457
459
|
const clientId = this.apiClient.validatedClientId;
|
|
458
460
|
//check numbers of keys on backend
|
|
459
|
-
const backendKeyPackagesCount = await this.apiClient.api.client.getMLSKeyPackageCount(clientId, (0, numberToHex_1.numberToHex)(this.defaultCiphersuite));
|
|
461
|
+
const backendKeyPackagesCount = await this.apiClient.api.client.getMLSKeyPackageCount(clientId, (0, numberToHex_1.numberToHex)(this.config.defaultCiphersuite));
|
|
460
462
|
if (backendKeyPackagesCount <= minAllowedNumberOfKeyPackages) {
|
|
461
463
|
//upload new keys
|
|
462
464
|
const newKeyPackages = await this.clientKeypackages(this.config.nbKeyPackages);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CommitBundle } from '@wireapp/core-crypto';
|
|
1
|
+
import type { Ciphersuite, CommitBundle, CredentialType } 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
|
|
@@ -10,7 +10,21 @@ export interface UploadCommitOptions {
|
|
|
10
10
|
isExternalCommit?: boolean;
|
|
11
11
|
}
|
|
12
12
|
export interface MLSServiceConfig {
|
|
13
|
+
/**
|
|
14
|
+
* (milliseconds) period of time between automatic updates of the keying material (30 days by default)
|
|
15
|
+
*/
|
|
13
16
|
keyingMaterialUpdateThreshold: number;
|
|
17
|
+
/**
|
|
18
|
+
* number of key packages client should upload to the server (100 by default)
|
|
19
|
+
*/
|
|
14
20
|
nbKeyPackages: number;
|
|
21
|
+
/**
|
|
22
|
+
* default ciphersuite to use for MLS (MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519 = 1 by default)
|
|
23
|
+
*/
|
|
24
|
+
defaultCiphersuite: Ciphersuite;
|
|
25
|
+
/**
|
|
26
|
+
* default credential type to use for MLS (Basic = 1 by default)
|
|
27
|
+
*/
|
|
28
|
+
defaultCredentialType: CredentialType;
|
|
15
29
|
}
|
|
16
30
|
//# sourceMappingURL=MLSService.types.d.ts.map
|
|
@@ -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,YAAY,EAAC,MAAM,sBAAsB,CAAC;
|
|
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,EAAE,cAAc,EAAC,MAAM,sBAAsB,CAAC;AAEpF,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,kBAAkB,EAAE,WAAW,CAAC;IAChC;;OAEG;IACH,qBAAqB,EAAE,cAAc,CAAC;CACvC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { QualifiedId } from '@wireapp/api-client/lib/user';
|
|
2
2
|
import { CoreCryptoCallbacks } from '@wireapp/core-crypto';
|
|
3
|
+
import { MLSServiceConfig } from './MLSService/MLSService.types';
|
|
3
4
|
export type SecretCrypto = {
|
|
4
5
|
encrypt: (value: Uint8Array) => Promise<Uint8Array>;
|
|
5
6
|
decrypt: (payload: Uint8Array) => Promise<Uint8Array>;
|
|
@@ -42,12 +43,7 @@ export interface CryptoProtocolConfig {
|
|
|
42
43
|
*/
|
|
43
44
|
coreCrypoWasmFilePath: string;
|
|
44
45
|
/** If set will create an MLS capable device from the current device */
|
|
45
|
-
mls?:
|
|
46
|
-
/**
|
|
47
|
-
* (milliseconds) period of time between automatic updates of the keying material (30 days by default)
|
|
48
|
-
*/
|
|
49
|
-
keyingMaterialUpdateThreshold?: number;
|
|
50
|
-
};
|
|
46
|
+
mls?: Partial<MLSServiceConfig>;
|
|
51
47
|
/** if set to true, will use experimental proteus encryption/decryption library (core-crypto). If not set will fallback to the legacy proteus library (cryptobox) */
|
|
52
48
|
proteus?: boolean;
|
|
53
49
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/messagingProtocols/mls/types.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAEzD,OAAO,EA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E;IACvE,GAAG,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAEhC,oKAAoK;IACpK,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB"}
|
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.4.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",
|
|
@@ -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.6.0",
|
|
64
|
+
"gitHead": "748d84564267dcb4bd0515b40970a660f3327690"
|
|
65
65
|
}
|