@wireapp/core-crypto 1.0.0-rc.5 → 1.0.0-rc.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wireapp/core-crypto",
3
- "version": "1.0.0-rc.5",
3
+ "version": "1.0.0-rc.7",
4
4
  "description": "CoreCrypto bindings for the Web",
5
5
  "type": "module",
6
6
  "module": "platforms/web/corecrypto.js",
@@ -262,7 +262,7 @@ export interface RotateBundle {
262
262
  *
263
263
  * @readonly
264
264
  */
265
- commits: CommitBundle[];
265
+ commits: Map<string, CommitBundle>;
266
266
  /**
267
267
  * Fresh KeyPackages with the new Credential
268
268
  *
@@ -727,6 +727,10 @@ export declare class CoreCrypto {
727
727
  /**
728
728
  * Ingest a TLS-serialized MLS welcome message to join an existing MLS group
729
729
  *
730
+ * Important: you have to catch the error with this reason "Although this Welcome seems valid, the local KeyPackage
731
+ * it references has already been deleted locally. Join this group with an external commit", ignore it and then try
732
+ * to join this group with an external commit.
733
+ *
730
734
  * @param welcomeMessage - TLS-serialized MLS Welcome message
731
735
  * @param configuration - configuration of the MLS group
732
736
  * @returns The conversation ID of the newly joined group. You can use the same ID to decrypt/encrypt messages
@@ -234,12 +234,12 @@ function makeMutClosure(arg0, arg1, dtor, f) {
234
234
  return real;
235
235
  }
236
236
  function __wbg_adapter_52(arg0, arg1, arg2) {
237
- wasm$1.wasm_bindgen__convert__closures__invoke1_mut__hb865a4e905934256(arg0, arg1, addHeapObject(arg2));
237
+ wasm$1.wasm_bindgen__convert__closures__invoke1_mut__h17baf5e1d66e67f4(arg0, arg1, addHeapObject(arg2));
238
238
  }
239
239
  function __wbg_adapter_55(arg0, arg1, arg2) {
240
240
  try {
241
241
  const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
242
- wasm$1.wasm_bindgen__convert__closures__invoke1_mut__h2720c46d5ff6c929(retptr, arg0, arg1, addHeapObject(arg2));
242
+ wasm$1.wasm_bindgen__convert__closures__invoke1_mut__h98d6800184b7661d(retptr, arg0, arg1, addHeapObject(arg2));
243
243
  var r0 = getInt32Memory0()[retptr / 4 + 0];
244
244
  var r1 = getInt32Memory0()[retptr / 4 + 1];
245
245
  if (r1) {
@@ -314,7 +314,7 @@ function handleError(f, args) {
314
314
  }
315
315
  }
316
316
  function __wbg_adapter_299(arg0, arg1, arg2, arg3) {
317
- wasm$1.wasm_bindgen__convert__closures__invoke2_mut__h22687e7c7a9c3c35(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
317
+ wasm$1.wasm_bindgen__convert__closures__invoke2_mut__haf4f26fdea6dc8ca(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
318
318
  }
319
319
  /**
320
320
  * see [core_crypto::prelude::MlsWirePolicy]
@@ -2615,7 +2615,7 @@ class RotateBundle {
2615
2615
  wasm$1.__wbg_rotatebundle_free(ptr);
2616
2616
  }
2617
2617
  /**
2618
- * @returns {Array<any>}
2618
+ * @returns {Map<any, any>}
2619
2619
  */
2620
2620
  get commits() {
2621
2621
  const ret = wasm$1.rotatebundle_commits(this.__wbg_ptr);
@@ -2869,14 +2869,18 @@ function __wbg_get_imports() {
2869
2869
  const ret = getObject(arg0).length;
2870
2870
  return ret;
2871
2871
  };
2872
+ imports.wbg.__wbg_new_8125e318e6245eed = function (arg0) {
2873
+ const ret = new Uint8Array(getObject(arg0));
2874
+ return addHeapObject(ret);
2875
+ };
2872
2876
  imports.wbg.__wbg_call_01734de55d61e11d = function () {
2873
2877
  return handleError(function (arg0, arg1, arg2) {
2874
2878
  const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
2875
2879
  return addHeapObject(ret);
2876
2880
  }, arguments);
2877
2881
  };
2878
- imports.wbg.__wbindgen_number_new = function (arg0) {
2879
- const ret = arg0;
2882
+ imports.wbg.__wbg_new_b51585de1b234aff = function () {
2883
+ const ret = new Object();
2880
2884
  return addHeapObject(ret);
2881
2885
  };
2882
2886
  imports.wbg.__wbg_new_898a68150f225f2e = function () {
@@ -2886,12 +2890,16 @@ function __wbg_get_imports() {
2886
2890
  imports.wbg.__wbg_set_502d29070ea18557 = function (arg0, arg1, arg2) {
2887
2891
  getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
2888
2892
  };
2889
- imports.wbg.__wbg_new_8125e318e6245eed = function (arg0) {
2890
- const ret = new Uint8Array(getObject(arg0));
2893
+ imports.wbg.__wbindgen_bigint_from_u64 = function (arg0) {
2894
+ const ret = BigInt.asUintN(64, arg0);
2891
2895
  return addHeapObject(ret);
2892
2896
  };
2893
- imports.wbg.__wbg_new_b51585de1b234aff = function () {
2894
- const ret = new Object();
2897
+ imports.wbg.__wbindgen_number_new = function (arg0) {
2898
+ const ret = arg0;
2899
+ return addHeapObject(ret);
2900
+ };
2901
+ imports.wbg.__wbg_ffiwiree2eidentity_new = function (arg0) {
2902
+ const ret = FfiWireE2EIdentity.__wrap(arg0);
2895
2903
  return addHeapObject(ret);
2896
2904
  };
2897
2905
  imports.wbg.__wbg_proteusautoprekeybundle_new = function (arg0) {
@@ -2902,14 +2910,6 @@ function __wbg_get_imports() {
2902
2910
  const ret = getObject(arg0).push(getObject(arg1));
2903
2911
  return ret;
2904
2912
  };
2905
- imports.wbg.__wbg_ffiwiree2eidentity_new = function (arg0) {
2906
- const ret = FfiWireE2EIdentity.__wrap(arg0);
2907
- return addHeapObject(ret);
2908
- };
2909
- imports.wbg.__wbindgen_bigint_from_u64 = function (arg0) {
2910
- const ret = BigInt.asUintN(64, arg0);
2911
- return addHeapObject(ret);
2912
- };
2913
2913
  imports.wbg.__wbg_new_56693dbed0c32988 = function () {
2914
2914
  const ret = new Map();
2915
2915
  return addHeapObject(ret);
@@ -2918,9 +2918,6 @@ function __wbg_get_imports() {
2918
2918
  const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
2919
2919
  return addHeapObject(ret);
2920
2920
  };
2921
- imports.wbg.__wbg_set_841ac57cff3d672b = function (arg0, arg1, arg2) {
2922
- getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
2923
- };
2924
2921
  imports.wbg.__wbg_new_d258248ed531ff54 = function (arg0, arg1) {
2925
2922
  const ret = new Error(getStringFromWasm0(arg0, arg1));
2926
2923
  return addHeapObject(ret);
@@ -2993,6 +2990,9 @@ function __wbg_get_imports() {
2993
2990
  const ret = CoreCrypto$1.__wrap(arg0);
2994
2991
  return addHeapObject(ret);
2995
2992
  };
2993
+ imports.wbg.__wbg_set_841ac57cff3d672b = function (arg0, arg1, arg2) {
2994
+ getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
2995
+ };
2996
2996
  imports.wbg.__wbg_instanceof_Promise_0e98a5bf082e090f = function (arg0) {
2997
2997
  let result;
2998
2998
  try {
@@ -3057,6 +3057,10 @@ function __wbg_get_imports() {
3057
3057
  state0.a = state0.b = 0;
3058
3058
  }
3059
3059
  };
3060
+ imports.wbg.__wbindgen_is_string = function (arg0) {
3061
+ const ret = typeof (getObject(arg0)) === 'string';
3062
+ return ret;
3063
+ };
3060
3064
  imports.wbg.__wbg_reject_7bd6ac9617013c02 = function (arg0) {
3061
3065
  const ret = Promise.reject(getObject(arg0));
3062
3066
  return addHeapObject(ret);
@@ -3134,6 +3138,10 @@ function __wbg_get_imports() {
3134
3138
  return addHeapObject(ret);
3135
3139
  }, arguments);
3136
3140
  };
3141
+ imports.wbg.__wbg_now_9c5990bda04c7e53 = function () {
3142
+ const ret = Date.now();
3143
+ return ret;
3144
+ };
3137
3145
  imports.wbg.__wbg_put_fb32824d87feec5c = function () {
3138
3146
  return handleError(function (arg0, arg1, arg2) {
3139
3147
  const ret = getObject(arg0).put(getObject(arg1), getObject(arg2));
@@ -3176,10 +3184,6 @@ function __wbg_get_imports() {
3176
3184
  return addHeapObject(ret);
3177
3185
  }, arguments);
3178
3186
  };
3179
- imports.wbg.__wbg_now_9c5990bda04c7e53 = function () {
3180
- const ret = Date.now();
3181
- return ret;
3182
- };
3183
3187
  imports.wbg.__wbindgen_memory = function () {
3184
3188
  const ret = wasm$1.memory;
3185
3189
  return addHeapObject(ret);
@@ -3222,10 +3226,6 @@ function __wbg_get_imports() {
3222
3226
  const ret = getObject(arg0).node;
3223
3227
  return addHeapObject(ret);
3224
3228
  };
3225
- imports.wbg.__wbindgen_is_string = function (arg0) {
3226
- const ret = typeof (getObject(arg0)) === 'string';
3227
- return ret;
3228
- };
3229
3229
  imports.wbg.__wbg_require_8f08ceecec0f4fee = function () {
3230
3230
  return handleError(function () {
3231
3231
  const ret = module.require;
@@ -3493,12 +3493,12 @@ function __wbg_get_imports() {
3493
3493
  return addHeapObject(ret);
3494
3494
  }, arguments);
3495
3495
  };
3496
- imports.wbg.__wbindgen_closure_wrapper1966 = function (arg0, arg1, arg2) {
3497
- const ret = makeMutClosure(arg0, arg1, 166, __wbg_adapter_52);
3496
+ imports.wbg.__wbindgen_closure_wrapper1999 = function (arg0, arg1, arg2) {
3497
+ const ret = makeMutClosure(arg0, arg1, 169, __wbg_adapter_52);
3498
3498
  return addHeapObject(ret);
3499
3499
  };
3500
- imports.wbg.__wbindgen_closure_wrapper4730 = function (arg0, arg1, arg2) {
3501
- const ret = makeMutClosure(arg0, arg1, 166, __wbg_adapter_55);
3500
+ imports.wbg.__wbindgen_closure_wrapper4745 = function (arg0, arg1, arg2) {
3501
+ const ret = makeMutClosure(arg0, arg1, 169, __wbg_adapter_55);
3502
3502
  return addHeapObject(ret);
3503
3503
  };
3504
3504
  return imports;
@@ -3567,7 +3567,7 @@ var exports = /*#__PURE__*/Object.freeze({
3567
3567
  var wasm = async (opt = {}) => {
3568
3568
  let {importHook, serverPath} = opt;
3569
3569
 
3570
- let path = "assets/core_crypto_ffi-9ad99558.wasm";
3570
+ let path = "assets/core_crypto_ffi-663eb4cf.wasm";
3571
3571
 
3572
3572
  if (serverPath != null) {
3573
3573
  path = serverPath + /[^\/\\]*$/.exec(path)[0];
@@ -4065,6 +4065,10 @@ class CoreCrypto {
4065
4065
  /**
4066
4066
  * Ingest a TLS-serialized MLS welcome message to join an existing MLS group
4067
4067
  *
4068
+ * Important: you have to catch the error with this reason "Although this Welcome seems valid, the local KeyPackage
4069
+ * it references has already been deleted locally. Join this group with an external commit", ignore it and then try
4070
+ * to join this group with an external commit.
4071
+ *
4068
4072
  * @param welcomeMessage - TLS-serialized MLS Welcome message
4069
4073
  * @param configuration - configuration of the MLS group
4070
4074
  * @returns The conversation ID of the newly joined group. You can use the same ID to decrypt/encrypt messages
@@ -4657,7 +4661,13 @@ class CoreCrypto {
4657
4661
  * @param newKeyPackageCount - number of KeyPackages with new identity to generate
4658
4662
  */
4659
4663
  async e2eiRotateAll(enrollment, certificateChain, newKeyPackageCount) {
4660
- return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").e2ei_rotate_all(enrollment.inner(), certificateChain, newKeyPackageCount);
4664
+ const ffiRet = await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").e2ei_rotate_all(enrollment.inner(), certificateChain, newKeyPackageCount);
4665
+ const ret = {
4666
+ commits: ffiRet.commits,
4667
+ newKeyPackages: ffiRet.new_key_packages,
4668
+ keyPackageRefsToRemove: ffiRet.key_package_refs_to_remove,
4669
+ };
4670
+ return ret;
4661
4671
  }
4662
4672
  /**
4663
4673
  * Allows persisting an active enrollment (for example while redirecting the user during OAuth) in order to resume