@wireapp/core 40.5.2 → 40.5.3-draft-20-cc-1.3

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.
@@ -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, ExternalAddProposalArgs, ExternalProposalType, ExternalRemoveProposalArgs, Invitee, ProposalArgs, ProposalType, RemoveProposalArgs } from '@wireapp/core-crypto';
6
+ import { AddProposalArgs, ConversationId, CoreCrypto, DecryptedMessage, ExternalAddProposalArgs, ExternalProposalType, 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';
@@ -30,6 +30,7 @@ export declare class MLSService extends TypedEventEmitter<Events> {
30
30
  groupIdFromConversationId?: MLSCallbacks['groupIdFromConversationId'];
31
31
  private readonly textEncoder;
32
32
  private readonly textDecoder;
33
+ private readonly defaultCiphersuite;
33
34
  constructor(apiClient: APIClient, coreCryptoClient: CoreCrypto, { keyingMaterialUpdateThreshold, nbKeyPackages, }: Partial<MLSServiceConfig>);
34
35
  initClient(userId: QualifiedId, clientId: string): Promise<void>;
35
36
  createClient(userId: QualifiedId, clientId: string): Promise<void>;
@@ -60,7 +61,7 @@ export declare class MLSService extends TypedEventEmitter<Events> {
60
61
  epoch: number;
61
62
  }>;
62
63
  exportSecretKey(groupId: string, keyLength: number): Promise<string>;
63
- newExternalProposal(externalProposalType: ExternalProposalType, args: ExternalAddProposalArgs | ExternalRemoveProposalArgs): Promise<Uint8Array>;
64
+ newExternalProposal(externalProposalType: ExternalProposalType, args: ExternalAddProposalArgs): Promise<Uint8Array>;
64
65
  processWelcomeMessage(welcomeMessage: Uint8Array): Promise<ConversationId>;
65
66
  decryptMessage(conversationId: ConversationId, payload: Uint8Array): Promise<DecryptedMessage>;
66
67
  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,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,EAAC,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAC,kBAAkB,EAAC,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAC,kBAAkB,EAAqB,MAAM,iBAAiB,CAAC;AACvE,OAAO,EAAC,4BAA4B,EAAE,4BAA4B,EAAE,YAAY,EAAC,MAAM,UAAU,CAAC;AAIlG,eAAO,MAAM,oBAAoB,UAAW,UAAU,GAAG,EAAE,KAAG,UAE7D,CAAC;AAOF,MAAM,WAAW,8BAA8B;IAC7C,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,C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G;IACI,uBAAuB,CAAC,OAAO,EAAE,MAAM;IAK9C;;;OAGG;IACI,wBAAwB,CAAC,OAAO,EAAE,MAAM;IAI/C;;;OAGG;IACI,0BAA0B,CAAC,OAAO,EAAE,MAAM;IAUjD;;;OAGG;IACI,mCAAmC,CAAC,QAAQ,EAAE,MAAM,EAAE;IAQ7D;;;OAGG;IACI,8BAA8B;YAQvB,eAAe;IAmB7B;;;;;OAKG;YACW,mBAAmB;YAMnB,oBAAoB;IAOrB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAYhD,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,kBAAkB,EAAE,YAAY,CAAC,GAAG,kBAAkB;IAW5F;;;;;OAKG;IACU,4BAA4B,CACvC,uBAAuB,EAAE,WAAW,EACpC,iBAAiB,CAAC,EAAE,kBAAkB,GACrC,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAQ9B;;;;;;;OAOG;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;CAW1G"}
@@ -40,7 +40,6 @@ const bazinga64_1 = require("bazinga64");
40
40
  const logdown_1 = __importDefault(require("logdown"));
41
41
  const commons_1 = require("@wireapp/commons");
42
42
  const core_crypto_1 = require("@wireapp/core-crypto");
43
- const commitBundleUtil_1 = require("./commitBundleUtil");
44
43
  const pendingProposalsStore_1 = require("./stores/pendingProposalsStore");
45
44
  const subconversationGroupIdStore_1 = require("./stores/subconversationGroupIdStore/subconversationGroupIdStore");
46
45
  const messageSender_1 = require("../../../conversation/message/messageSender");
@@ -67,6 +66,7 @@ class MLSService extends TypedEventEmitter_1.TypedEventEmitter {
67
66
  this.logger = (0, logdown_1.default)('@wireapp/core/MLSService');
68
67
  this.textEncoder = new TextEncoder();
69
68
  this.textDecoder = new TextDecoder();
69
+ this.defaultCiphersuite = core_crypto_1.Ciphersuite.MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519;
70
70
  this.config = {
71
71
  keyingMaterialUpdateThreshold,
72
72
  nbKeyPackages,
@@ -74,22 +74,21 @@ class MLSService extends TypedEventEmitter_1.TypedEventEmitter {
74
74
  }
75
75
  async initClient(userId, clientId) {
76
76
  const qualifiedClientId = (0, fullyQualifiedClientIdUtils_1.constructFullyQualifiedClientId)(userId.id, clientId, userId.domain);
77
- await this.coreCryptoClient.mlsInit(this.textEncoder.encode(qualifiedClientId), [
78
- core_crypto_1.Ciphersuite.MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519,
79
- ]);
77
+ await this.coreCryptoClient.mlsInit(this.textEncoder.encode(qualifiedClientId), [this.defaultCiphersuite]);
80
78
  }
81
79
  async createClient(userId, clientId) {
82
80
  await this.initClient(userId, clientId);
83
81
  // If the device is new, we need to upload keypackages and public key to the backend
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);
82
+ const publicKey = await this.coreCryptoClient.clientPublicKey(this.defaultCiphersuite);
83
+ const keyPackages = await this.coreCryptoClient.clientKeypackages(this.defaultCiphersuite, this.config.nbKeyPackages);
86
84
  await this.uploadMLSPublicKeys(publicKey, clientId);
87
85
  await this.uploadMLSKeyPackages(keyPackages, clientId);
88
86
  }
89
87
  async uploadCommitBundle(groupId, commitBundle, { regenerateCommitBundle, isExternalCommit } = {}) {
90
- const bundlePayload = (0, commitBundleUtil_1.toProtobufCommitBundle)(commitBundle);
88
+ const { commit, groupInfo, welcome } = commitBundle;
89
+ const bundlePayload = new Uint8Array([...commit, ...groupInfo.payload, ...(welcome || [])]);
91
90
  try {
92
- const response = await this.apiClient.api.conversation.postMlsCommitBundle(bundlePayload.slice());
91
+ const response = await this.apiClient.api.conversation.postMlsCommitBundle(bundlePayload);
93
92
  if (isExternalCommit) {
94
93
  await this.coreCryptoClient.mergePendingGroupFromExternalCommit(groupId);
95
94
  }
@@ -300,7 +299,7 @@ class MLSService extends TypedEventEmitter_1.TypedEventEmitter {
300
299
  const mlsKeyBytes = Object.values(mlsKeys).map((key) => bazinga64_1.Decoder.fromBase64(key).asBytes);
301
300
  const configuration = {
302
301
  externalSenders: mlsKeyBytes,
303
- ciphersuite: core_crypto_1.Ciphersuite.MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519,
302
+ ciphersuite: this.defaultCiphersuite,
304
303
  };
305
304
  await this.coreCryptoClient.createConversation(groupIdBytes, core_crypto_1.CredentialType.Basic, configuration);
306
305
  const keyPackages = await this.getKeyPackagesPayload(users.map(user => {
@@ -339,10 +338,10 @@ class MLSService extends TypedEventEmitter_1.TypedEventEmitter {
339
338
  return this.coreCryptoClient.conversationExists(groupIdBytes);
340
339
  }
341
340
  async clientValidKeypackagesCount() {
342
- return this.coreCryptoClient.clientValidKeypackagesCount(core_crypto_1.Ciphersuite.MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519);
341
+ return this.coreCryptoClient.clientValidKeypackagesCount(this.defaultCiphersuite);
343
342
  }
344
343
  async clientKeypackages(amountRequested) {
345
- return this.coreCryptoClient.clientKeypackages(core_crypto_1.Ciphersuite.MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519, amountRequested);
344
+ return this.coreCryptoClient.clientKeypackages(this.defaultCiphersuite, amountRequested);
346
345
  }
347
346
  /**
348
347
  * Renew key material for a given groupId
@@ -4,5 +4,5 @@ import { CommitBundle } from '@wireapp/core-crypto';
4
4
  * @param commitBundle a commit bundle generated by coreCrypto
5
5
  * @returns
6
6
  */
7
- export declare function toProtobufCommitBundle({ commit, welcome, publicGroupState }: CommitBundle): Uint8Array;
7
+ export declare function toProtobufCommitBundle({ commit, welcome, groupInfo }: CommitBundle): Uint8Array;
8
8
  //# sourceMappingURL=commitBundleUtil.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"commitBundleUtil.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/mls/MLSService/commitBundleUtil.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAC,YAAY,EAAkD,MAAM,sBAAsB,CAAC;AAYnG;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,EAAC,MAAM,EAAE,OAAO,EAAE,gBAAgB,EAAC,EAAE,YAAY,GAAG,UAAU,CAWpG"}
1
+ {"version":3,"file":"commitBundleUtil.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/mls/MLSService/commitBundleUtil.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAC,YAAY,EAA2C,MAAM,sBAAsB,CAAC;AAY5F;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,EAAC,MAAM,EAAE,OAAO,EAAE,SAAS,EAAC,EAAE,YAAY,GAAG,UAAU,CAW7F"}
@@ -27,20 +27,20 @@ const ratchetTreeMapping = {
27
27
  [core_crypto_1.RatchetTreeType.Delta]: mls_1.mls.RatchetTreeType.DELTA,
28
28
  };
29
29
  const groupInfoType = {
30
- [core_crypto_1.PublicGroupStateEncryptionType.Plaintext]: mls_1.mls.GroupInfoType.PUBLIC_GROUP_STATE,
31
- [core_crypto_1.PublicGroupStateEncryptionType.JweEncrypted]: mls_1.mls.GroupInfoType.GROUP_INFO_JWE,
30
+ [core_crypto_1.GroupInfoEncryptionType.Plaintext]: mls_1.mls.GroupInfoType.PUBLIC_GROUP_STATE,
31
+ [core_crypto_1.GroupInfoEncryptionType.JweEncrypted]: mls_1.mls.GroupInfoType.GROUP_INFO_JWE,
32
32
  };
33
33
  /**
34
34
  * Will convert a coreCrypto commit bundle into a Uint8Array representing a protobuf object
35
35
  * @param commitBundle a commit bundle generated by coreCrypto
36
36
  * @returns
37
37
  */
38
- function toProtobufCommitBundle({ commit, welcome, publicGroupState }) {
39
- const { ratchetTreeType, encryptionType } = publicGroupState;
38
+ function toProtobufCommitBundle({ commit, welcome, groupInfo }) {
39
+ const { ratchetTreeType, encryptionType } = groupInfo;
40
40
  return mls_1.mls.CommitBundle.encode({
41
41
  groupInfoBundle: {
42
42
  ratchetTreeType: ratchetTreeMapping[ratchetTreeType],
43
- groupInfo: publicGroupState.payload,
43
+ groupInfo: groupInfo.payload,
44
44
  groupInfoType: groupInfoType[encryptionType],
45
45
  },
46
46
  commit,
@@ -27,17 +27,17 @@ describe('toProtobufCommitBundle', () => {
27
27
  const payload = {
28
28
  commit: Uint8Array.from([0]),
29
29
  welcome: Uint8Array.from([1]),
30
- publicGroupState: {
30
+ groupInfo: {
31
31
  ratchetTreeType: core_crypto_1.RatchetTreeType.Full,
32
32
  payload: Uint8Array.from([2]),
33
- encryptionType: core_crypto_1.PublicGroupStateEncryptionType.Plaintext,
33
+ encryptionType: core_crypto_1.GroupInfoEncryptionType.Plaintext,
34
34
  },
35
35
  };
36
36
  const result = (0, commitBundleUtil_1.toProtobufCommitBundle)(payload);
37
37
  const { commit, welcome, groupInfoBundle } = mls_1.mls.CommitBundle.decode(result);
38
38
  expect(bazinga64_1.Encoder.toBase64(commit)).toEqual(bazinga64_1.Encoder.toBase64(payload.commit));
39
39
  expect(bazinga64_1.Encoder.toBase64(welcome)).toEqual(bazinga64_1.Encoder.toBase64(payload.welcome));
40
- expect(bazinga64_1.Encoder.toBase64(groupInfoBundle.groupInfo)).toEqual(bazinga64_1.Encoder.toBase64(payload.publicGroupState.payload));
40
+ expect(bazinga64_1.Encoder.toBase64(groupInfoBundle.groupInfo)).toEqual(bazinga64_1.Encoder.toBase64(payload.groupInfo.payload));
41
41
  expect(groupInfoBundle.ratchetTreeType).toEqual(mls_1.mls.RatchetTreeType.FULL);
42
42
  expect(groupInfoBundle.groupInfoType).toEqual(mls_1.mls.GroupInfoType.PUBLIC_GROUP_STATE);
43
43
  });
package/package.json CHANGED
@@ -11,14 +11,14 @@
11
11
  "./lib/cryptography/AssetCryptography/crypto.node": "./lib/cryptography/AssetCryptography/crypto.browser.js"
12
12
  },
13
13
  "dependencies": {
14
- "@wireapp/api-client": "^24.15.5",
15
- "@wireapp/commons": "^5.1.0",
16
- "@wireapp/core-crypto": "0.11.0",
14
+ "@wireapp/api-client": "24.15.5",
15
+ "@wireapp/commons": "5.1.0",
16
+ "@wireapp/core-crypto": "1.0.0-pre.5",
17
17
  "@wireapp/cryptobox": "12.8.0",
18
- "@wireapp/promise-queue": "^2.2.0",
18
+ "@wireapp/promise-queue": "2.2.0",
19
19
  "@wireapp/protocol-messaging": "1.44.0",
20
20
  "@wireapp/store-engine": "5.1.1",
21
- "@wireapp/store-engine-dexie": "^2.1.2",
21
+ "@wireapp/store-engine-dexie": "2.1.2",
22
22
  "axios": "1.4.0",
23
23
  "bazinga64": "6.1.1",
24
24
  "deepmerge-ts": "4.3.0",
@@ -60,6 +60,6 @@
60
60
  "test:coverage": "jest --coverage",
61
61
  "watch": "tsc --watch"
62
62
  },
63
- "version": "40.5.2",
64
- "gitHead": "1ed405f040d81c74928aa513385b2378fbb37cd3"
63
+ "version": "40.5.3-draft-20-cc-1.3+eb1ee03af",
64
+ "gitHead": "eb1ee03af53d793cd367ddf15f3f2a93cf73f9bc"
65
65
  }