@wireapp/core 40.4.2 → 40.5.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 +1 -1
- package/lib/conversation/ConversationService/ConversationService.d.ts.map +1 -1
- package/lib/conversation/ConversationService/ConversationService.js +5 -6
- package/lib/messagingProtocols/mls/MLSService/MLSService.d.ts +2 -2
- package/lib/messagingProtocols/mls/MLSService/MLSService.d.ts.map +1 -1
- package/lib/messagingProtocols/mls/MLSService/MLSService.js +11 -8
- package/lib/messagingProtocols/proteus/ProteusService/CryptoClient/CoreCryptoWrapper/CoreCryptoWrapper.d.ts.map +1 -1
- package/lib/messagingProtocols/proteus/ProteusService/CryptoClient/CoreCryptoWrapper/CoreCryptoWrapper.js +1 -0
- package/package.json +4 -4
|
@@ -63,7 +63,7 @@ export declare class ConversationService {
|
|
|
63
63
|
* Will create a conversation on backend and register it to CoreCrypto once created
|
|
64
64
|
* @param conversationData
|
|
65
65
|
*/
|
|
66
|
-
createMLSConversation(conversationData: NewConversation): Promise<MLSReturnType>;
|
|
66
|
+
createMLSConversation(conversationData: NewConversation, selfUserId: QualifiedId, selfClientId: string): Promise<MLSReturnType>;
|
|
67
67
|
private sendMLSMessage;
|
|
68
68
|
/**
|
|
69
69
|
* Will add users to existing MLS group by claiming their key packages and passing them to CoreCrypto.addClientsToConversation
|
|
@@ -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,EACvB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EAAC,4BAA4B,EAAC,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;A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,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;IAWhF,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAK/E,6BAA6B,CAAC,MAAM,EAAE,mCAAmC;IAIzE,0BAA0B,CACrC,cAAc,EAAE,WAAW,EAC3B,MAAM,EAAE,WAAW,GAClB,OAAO,CAAC,4BAA4B,CAAC;IAIxC;;;OAGG;IACU,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,oBAAoB,EAAE,wBAAwB,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC;IAO5F,eAAe,CAAC,cAAc,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAI3D,cAAc,CAAC,cAAc,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAIjE;;OAEG;IACH,gBAAgB,IAAI,OAAO;IAIpB,0BAA0B,CAC/B,cAAc,EAAE,MAAM,EACtB,MAAM,EAAE,WAAW,EACnB,aAAa,EAAE,MAAM,GAAG,IAAI,GAC3B,OAAO,CAAC,IAAI,CAAC;IAaT,yBAAyB,CAC9B,cAAc,EAAE,MAAM,EACtB,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,
|
|
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,EACvB,MAAM,sCA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AC;YAgCX,cAAc;IA+B5B;;;;;;OAMG;IACU,yBAAyB,CAAC,EACrC,cAAc,EACd,OAAO,EACP,cAAc,GACf,EAAE,QAAQ,CAAC,cAAc,CAAC,GAAG,OAAO,CAAC,aAAa,CAAC;IAcvC,8BAA8B,CAAC,EAC1C,OAAO,EACP,cAAc,EACd,gBAAgB,GACjB,EAAE,iBAAiB,GAAG,OAAO,CAAC,aAAa,CAAC;IAoBhC,oBAAoB,CAAC,cAAc,EAAE,WAAW;IAI7D;;;;;OAKG;IACU,wBAAwB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAmBvD,4BAA4B,CAAC,OAAO,EAAE,MAAM;IAI5C,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;YAIlD,YAAY;IAYb,mBAAmB;CA2BjC"}
|
|
@@ -155,12 +155,9 @@ class ConversationService {
|
|
|
155
155
|
* Will create a conversation on backend and register it to CoreCrypto once created
|
|
156
156
|
* @param conversationData
|
|
157
157
|
*/
|
|
158
|
-
async createMLSConversation(conversationData) {
|
|
158
|
+
async createMLSConversation(conversationData, selfUserId, selfClientId) {
|
|
159
159
|
var _a;
|
|
160
|
-
const {
|
|
161
|
-
if (!selfUserId) {
|
|
162
|
-
throw new Error('You need to pass self user qualified id in order to create an MLS conversation');
|
|
163
|
-
}
|
|
160
|
+
const { qualified_users: qualifiedUsers = [] } = conversationData;
|
|
164
161
|
/**
|
|
165
162
|
* @note For creating MLS conversations the users & qualified_users
|
|
166
163
|
* field must be empty as backend is not aware which users
|
|
@@ -173,7 +170,7 @@ class ConversationService {
|
|
|
173
170
|
}
|
|
174
171
|
const response = await this.mlsService.registerConversation(groupId, qualifiedUsers.concat(selfUserId), {
|
|
175
172
|
user: selfUserId,
|
|
176
|
-
client:
|
|
173
|
+
client: selfClientId,
|
|
177
174
|
});
|
|
178
175
|
// We fetch the fresh version of the conversation created on backend with the newly added users
|
|
179
176
|
const conversation = await this.apiClient.api.conversation.getConversation(qualifiedId);
|
|
@@ -254,6 +251,8 @@ class ConversationService {
|
|
|
254
251
|
const externalProposal = await this.mlsService.newExternalProposal(core_crypto_1.ExternalProposalType.Add, {
|
|
255
252
|
epoch,
|
|
256
253
|
conversationId: groupIdBytes,
|
|
254
|
+
ciphersuite: core_crypto_1.Ciphersuite.MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519,
|
|
255
|
+
credentialType: core_crypto_1.CredentialType.Basic,
|
|
257
256
|
});
|
|
258
257
|
await this.apiClient.api.conversation.postMlsMessage(
|
|
259
258
|
//@todo: it's temporary - we wait for core-crypto fix to return the actual Uint8Array instead of regular array
|
|
@@ -3,7 +3,7 @@ import { Subconversation } from '@wireapp/api-client/lib/conversation/Subconvers
|
|
|
3
3
|
import { QualifiedId } from '@wireapp/api-client/lib/user';
|
|
4
4
|
import logdown from 'logdown';
|
|
5
5
|
import { APIClient } from '@wireapp/api-client';
|
|
6
|
-
import { AddProposalArgs, ConversationId, CoreCrypto, DecryptedMessage,
|
|
6
|
+
import { AddProposalArgs, ConversationId, CoreCrypto, DecryptedMessage, ExternalAddProposalArgs, ExternalProposalType, ExternalRemoveProposalArgs, Invitee, ProposalArgs, ProposalType, RemoveProposalArgs } from '@wireapp/core-crypto';
|
|
7
7
|
import { MLSServiceConfig } from './MLSService.types';
|
|
8
8
|
import { KeyPackageClaimUser } from '../../../conversation';
|
|
9
9
|
import { TypedEventEmitter } from '../../../util/TypedEventEmitter';
|
|
@@ -60,7 +60,7 @@ export declare class MLSService extends TypedEventEmitter<Events> {
|
|
|
60
60
|
epoch: number;
|
|
61
61
|
}>;
|
|
62
62
|
exportSecretKey(groupId: string, keyLength: number): Promise<string>;
|
|
63
|
-
newExternalProposal(externalProposalType: ExternalProposalType, args:
|
|
63
|
+
newExternalProposal(externalProposalType: ExternalProposalType, args: ExternalAddProposalArgs | ExternalRemoveProposalArgs): Promise<Uint8Array>;
|
|
64
64
|
processWelcomeMessage(welcomeMessage: Uint8Array): Promise<ConversationId>;
|
|
65
65
|
decryptMessage(conversationId: ConversationId, payload: Uint8Array): Promise<DecryptedMessage>;
|
|
66
66
|
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,EAAC,sBAAsB,EAAE,kBAAkB,EAAC,MAAM,sCAAsC,CAAC;AAChG,OAAO,EAAC,eAAe,EAAC,MAAM,sDAAsD,CAAC;AACrF,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAIzD,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAE9C,OAAO,EACL,eAAe,
|
|
1
|
+
{"version":3,"file":"MLSService.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/mls/MLSService/MLSService.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,sBAAsB,EAAE,kBAAkB,EAAC,MAAM,sCAAsC,CAAC;AAChG,OAAO,EAAC,eAAe,EAAC,MAAM,sDAAsD,CAAC;AACrF,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAIzD,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,0BAA0B,EAC1B,OAAO,EACP,YAAY,EACZ,YAAY,EACZ,kBAAkB,EACnB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAAC,gBAAgB,EAAsB,MAAM,oBAAoB,CAAC;AAIzE,OAAO,EAAC,mBAAmB,EAAC,MAAM,uBAAuB,CAAC;AAK1D,OAAO,EAAC,iBAAiB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AE,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"}
|
|
@@ -39,6 +39,7 @@ const axios_1 = __importDefault(require("axios"));
|
|
|
39
39
|
const bazinga64_1 = require("bazinga64");
|
|
40
40
|
const logdown_1 = __importDefault(require("logdown"));
|
|
41
41
|
const commons_1 = require("@wireapp/commons");
|
|
42
|
+
const core_crypto_1 = require("@wireapp/core-crypto");
|
|
42
43
|
const commitBundleUtil_1 = require("./commitBundleUtil");
|
|
43
44
|
const pendingProposalsStore_1 = require("./stores/pendingProposalsStore");
|
|
44
45
|
const subconversationGroupIdStore_1 = require("./stores/subconversationGroupIdStore/subconversationGroupIdStore");
|
|
@@ -73,13 +74,15 @@ class MLSService extends TypedEventEmitter_1.TypedEventEmitter {
|
|
|
73
74
|
}
|
|
74
75
|
async initClient(userId, clientId) {
|
|
75
76
|
const qualifiedClientId = (0, fullyQualifiedClientIdUtils_1.constructFullyQualifiedClientId)(userId.id, clientId, userId.domain);
|
|
76
|
-
await this.coreCryptoClient.mlsInit(this.textEncoder.encode(qualifiedClientId)
|
|
77
|
+
await this.coreCryptoClient.mlsInit(this.textEncoder.encode(qualifiedClientId), [
|
|
78
|
+
core_crypto_1.Ciphersuite.MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519,
|
|
79
|
+
]);
|
|
77
80
|
}
|
|
78
81
|
async createClient(userId, clientId) {
|
|
79
82
|
await this.initClient(userId, clientId);
|
|
80
83
|
// If the device is new, we need to upload keypackages and public key to the backend
|
|
81
|
-
const publicKey = await this.coreCryptoClient.clientPublicKey();
|
|
82
|
-
const keyPackages = await this.coreCryptoClient.clientKeypackages(this.config.nbKeyPackages);
|
|
84
|
+
const publicKey = await this.coreCryptoClient.clientPublicKey(core_crypto_1.Ciphersuite.MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519);
|
|
85
|
+
const keyPackages = await this.coreCryptoClient.clientKeypackages(core_crypto_1.Ciphersuite.MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519, this.config.nbKeyPackages);
|
|
83
86
|
await this.uploadMLSPublicKeys(publicKey, clientId);
|
|
84
87
|
await this.uploadMLSKeyPackages(keyPackages, clientId);
|
|
85
88
|
}
|
|
@@ -165,7 +168,7 @@ class MLSService extends TypedEventEmitter_1.TypedEventEmitter {
|
|
|
165
168
|
async joinByExternalCommit(getGroupInfo) {
|
|
166
169
|
const generateCommit = async () => {
|
|
167
170
|
const groupInfo = await getGroupInfo();
|
|
168
|
-
const _a = await this.coreCryptoClient.joinByExternalCommit(groupInfo), { conversationId } = _a, commitBundle = __rest(_a, ["conversationId"]);
|
|
171
|
+
const _a = await this.coreCryptoClient.joinByExternalCommit(groupInfo, core_crypto_1.CredentialType.Basic), { conversationId } = _a, commitBundle = __rest(_a, ["conversationId"]);
|
|
169
172
|
return { groupId: conversationId, commitBundle };
|
|
170
173
|
};
|
|
171
174
|
const { commitBundle, groupId } = await generateCommit();
|
|
@@ -297,9 +300,9 @@ class MLSService extends TypedEventEmitter_1.TypedEventEmitter {
|
|
|
297
300
|
const mlsKeyBytes = Object.values(mlsKeys).map((key) => bazinga64_1.Decoder.fromBase64(key).asBytes);
|
|
298
301
|
const configuration = {
|
|
299
302
|
externalSenders: mlsKeyBytes,
|
|
300
|
-
ciphersuite:
|
|
303
|
+
ciphersuite: core_crypto_1.Ciphersuite.MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519,
|
|
301
304
|
};
|
|
302
|
-
await this.coreCryptoClient.createConversation(groupIdBytes, configuration);
|
|
305
|
+
await this.coreCryptoClient.createConversation(groupIdBytes, core_crypto_1.CredentialType.Basic, configuration);
|
|
303
306
|
const keyPackages = await this.getKeyPackagesPayload(users.map(user => {
|
|
304
307
|
if (user.id === (creator === null || creator === void 0 ? void 0 : creator.user.id)) {
|
|
305
308
|
/**
|
|
@@ -336,10 +339,10 @@ class MLSService extends TypedEventEmitter_1.TypedEventEmitter {
|
|
|
336
339
|
return this.coreCryptoClient.conversationExists(groupIdBytes);
|
|
337
340
|
}
|
|
338
341
|
async clientValidKeypackagesCount() {
|
|
339
|
-
return this.coreCryptoClient.clientValidKeypackagesCount();
|
|
342
|
+
return this.coreCryptoClient.clientValidKeypackagesCount(core_crypto_1.Ciphersuite.MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519);
|
|
340
343
|
}
|
|
341
344
|
async clientKeypackages(amountRequested) {
|
|
342
|
-
return this.coreCryptoClient.clientKeypackages(amountRequested);
|
|
345
|
+
return this.coreCryptoClient.clientKeypackages(core_crypto_1.Ciphersuite.MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519, amountRequested);
|
|
343
346
|
}
|
|
344
347
|
/**
|
|
345
348
|
* Renew key material for a given groupId
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoreCryptoWrapper.d.ts","sourceRoot":"","sources":["../../../../../../src/messagingProtocols/proteus/ProteusService/CryptoClient/CoreCryptoWrapper/CoreCryptoWrapper.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,MAAM,EAAC,MAAM,8BAA8B,CAAC;AAIpD,OAAO,
|
|
1
|
+
{"version":3,"file":"CoreCryptoWrapper.d.ts","sourceRoot":"","sources":["../../../../../../src/messagingProtocols/proteus/ProteusService/CryptoClient/CoreCryptoWrapper/CoreCryptoWrapper.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,MAAM,EAAC,MAAM,8BAA8B,CAAC;AAIpD,OAAO,EAAc,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAAC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AU;IAIvD,aAAa,CAAC,SAAS,EAAE,MAAM;IAI/B,WAAW,CAAC,SAAS,EAAE,MAAM;IAI7B,aAAa,CAAC,SAAS,EAAE,MAAM;IAI/B,aAAa;IAIP,SAAS;;;;IAKT,iBAAiB,CAAC,SAAS,EAAE,MAAM;IAUnC,kBAAkB;IAIlB,oBAAoB,CAAC,MAAM,EAAE,MAAM;IAIzC;;;;OAIG;IACH,OAAO,CAAC,OAAO;IAgBT,IAAI;CAIX"}
|
|
@@ -52,6 +52,7 @@ async function buildClient(storeEngine, coreCryptoWasmFilePath, { systemCrypto,
|
|
|
52
52
|
databaseName: coreCryptoDbName,
|
|
53
53
|
key: bazinga64_1.Encoder.toBase64(key.key).asString,
|
|
54
54
|
wasmFilePath: coreCryptoWasmFilePath,
|
|
55
|
+
ciphersuites: [core_crypto_1.Ciphersuite.MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519],
|
|
55
56
|
});
|
|
56
57
|
return new CoreCryptoWrapper(coreCrypto, { nbPrekeys, onNewPrekeys, onWipe: key.deleteKey });
|
|
57
58
|
}
|
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": "^24.15.
|
|
14
|
+
"@wireapp/api-client": "^24.15.4",
|
|
15
15
|
"@wireapp/commons": "^5.1.0",
|
|
16
|
-
"@wireapp/core-crypto": "0.
|
|
16
|
+
"@wireapp/core-crypto": "0.11.0",
|
|
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.5.1",
|
|
64
|
+
"gitHead": "7096977539106206a58c7f0e391b4873457eab86"
|
|
65
65
|
}
|