@wireapp/core 40.7.1 → 40.8.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.
|
@@ -31,6 +31,7 @@ export declare class MLSService extends TypedEventEmitter<Events> {
|
|
|
31
31
|
private readonly textEncoder;
|
|
32
32
|
private readonly textDecoder;
|
|
33
33
|
private readonly defaultCiphersuite;
|
|
34
|
+
private readonly defaultCredentialType;
|
|
34
35
|
constructor(apiClient: APIClient, coreCryptoClient: CoreCrypto, { keyingMaterialUpdateThreshold, nbKeyPackages, }: Partial<MLSServiceConfig>);
|
|
35
36
|
initClient(userId: QualifiedId, clientId: string): Promise<void>;
|
|
36
37
|
createClient(userId: QualifiedId, clientId: string): Promise<void>;
|
|
@@ -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;AAErF,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;AAK1D,OAAO,EAAC,iBAAiB,EAAC,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAC,kBAAkB,EAAC,MAAM,oBAAoB,CAAC;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AAE,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;CAW1G"}
|
|
@@ -67,6 +67,7 @@ class MLSService extends TypedEventEmitter_1.TypedEventEmitter {
|
|
|
67
67
|
this.textEncoder = new TextEncoder();
|
|
68
68
|
this.textDecoder = new TextDecoder();
|
|
69
69
|
this.defaultCiphersuite = core_crypto_1.Ciphersuite.MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519;
|
|
70
|
+
this.defaultCredentialType = core_crypto_1.CredentialType.Basic;
|
|
70
71
|
this.config = {
|
|
71
72
|
keyingMaterialUpdateThreshold,
|
|
72
73
|
nbKeyPackages,
|
|
@@ -80,7 +81,7 @@ class MLSService extends TypedEventEmitter_1.TypedEventEmitter {
|
|
|
80
81
|
await this.initClient(userId, clientId);
|
|
81
82
|
// If the device is new, we need to upload keypackages and public key to the backend
|
|
82
83
|
const publicKey = await this.coreCryptoClient.clientPublicKey(this.defaultCiphersuite);
|
|
83
|
-
const keyPackages = await this.coreCryptoClient.clientKeypackages(this.defaultCiphersuite, this.config.nbKeyPackages);
|
|
84
|
+
const keyPackages = await this.coreCryptoClient.clientKeypackages(this.defaultCiphersuite, this.defaultCredentialType, this.config.nbKeyPackages);
|
|
84
85
|
await this.uploadMLSPublicKeys(publicKey, clientId);
|
|
85
86
|
await this.uploadMLSKeyPackages(keyPackages, clientId);
|
|
86
87
|
}
|
|
@@ -186,7 +187,7 @@ class MLSService extends TypedEventEmitter_1.TypedEventEmitter {
|
|
|
186
187
|
async joinByExternalCommit(getGroupInfo) {
|
|
187
188
|
const generateCommit = async () => {
|
|
188
189
|
const groupInfo = await getGroupInfo();
|
|
189
|
-
const _a = await this.coreCryptoClient.joinByExternalCommit(groupInfo,
|
|
190
|
+
const _a = await this.coreCryptoClient.joinByExternalCommit(groupInfo, this.defaultCredentialType), { conversationId } = _a, commitBundle = __rest(_a, ["conversationId"]);
|
|
190
191
|
return { groupId: conversationId, commitBundle };
|
|
191
192
|
};
|
|
192
193
|
const { commitBundle, groupId } = await generateCommit();
|
|
@@ -320,7 +321,7 @@ class MLSService extends TypedEventEmitter_1.TypedEventEmitter {
|
|
|
320
321
|
externalSenders: mlsKeyBytes,
|
|
321
322
|
ciphersuite: this.defaultCiphersuite,
|
|
322
323
|
};
|
|
323
|
-
await this.coreCryptoClient.createConversation(groupIdBytes,
|
|
324
|
+
await this.coreCryptoClient.createConversation(groupIdBytes, this.defaultCredentialType, configuration);
|
|
324
325
|
const { coreCryptoKeyPackagesPayload: keyPackages, failedToFetchKeyPackages } = await this.getKeyPackagesPayload(users.map(user => {
|
|
325
326
|
if (user.id === (creator === null || creator === void 0 ? void 0 : creator.user.id)) {
|
|
326
327
|
/**
|
|
@@ -362,10 +363,10 @@ class MLSService extends TypedEventEmitter_1.TypedEventEmitter {
|
|
|
362
363
|
return this.coreCryptoClient.conversationExists(groupIdBytes);
|
|
363
364
|
}
|
|
364
365
|
async clientValidKeypackagesCount() {
|
|
365
|
-
return this.coreCryptoClient.clientValidKeypackagesCount(this.defaultCiphersuite);
|
|
366
|
+
return this.coreCryptoClient.clientValidKeypackagesCount(this.defaultCiphersuite, this.defaultCredentialType);
|
|
366
367
|
}
|
|
367
368
|
async clientKeypackages(amountRequested) {
|
|
368
|
-
return this.coreCryptoClient.clientKeypackages(this.defaultCiphersuite, amountRequested);
|
|
369
|
+
return this.coreCryptoClient.clientKeypackages(this.defaultCiphersuite, this.defaultCredentialType, amountRequested);
|
|
369
370
|
}
|
|
370
371
|
/**
|
|
371
372
|
* Renew key material for a given groupId
|
package/package.json
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"@wireapp/api-client": "^24.20.0",
|
|
15
15
|
"@wireapp/commons": "^5.1.0",
|
|
16
|
-
"@wireapp/core-crypto": "1.0.0-
|
|
16
|
+
"@wireapp/core-crypto": "^1.0.0-rc.1",
|
|
17
17
|
"@wireapp/cryptobox": "12.8.0",
|
|
18
18
|
"@wireapp/promise-queue": "^2.2.0",
|
|
19
19
|
"@wireapp/protocol-messaging": "1.44.0",
|
|
@@ -60,6 +60,6 @@
|
|
|
60
60
|
"test:coverage": "jest --coverage",
|
|
61
61
|
"watch": "tsc --watch"
|
|
62
62
|
},
|
|
63
|
-
"version": "40.
|
|
64
|
-
"gitHead": "
|
|
63
|
+
"version": "40.8.0",
|
|
64
|
+
"gitHead": "9a92f72c05013a618258365b6c5ac61a020911fd"
|
|
65
65
|
}
|