@bitwarden/sdk-internal 0.2.0-main.309 → 0.2.0-main.310

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.
@@ -2118,6 +2118,10 @@ export class PureCrypto {
2118
2118
  * Derive output of the KDF for a [bitwarden_crypto::Kdf] configuration.
2119
2119
  */
2120
2120
  static derive_kdf_material(password: Uint8Array, salt: Uint8Array, kdf: Kdf): Uint8Array;
2121
+ static decrypt_user_key_with_master_key(
2122
+ encrypted_user_key: string,
2123
+ master_key: Uint8Array,
2124
+ ): Uint8Array;
2121
2125
  }
2122
2126
  /**
2123
2127
  * The `SendAccessClient` is used to interact with the Bitwarden API to get send access tokens.
@@ -861,7 +861,7 @@ function __wbg_adapter_60(arg0, arg1) {
861
861
  );
862
862
  }
863
863
 
864
- function __wbg_adapter_336(arg0, arg1, arg2, arg3) {
864
+ function __wbg_adapter_337(arg0, arg1, arg2, arg3) {
865
865
  wasm.wasm_bindgen__convert__closures__invoke2_mut__h54a8613170fef18e(
866
866
  arg0,
867
867
  arg1,
@@ -3727,6 +3727,37 @@ class PureCrypto {
3727
3727
  wasm.__wbindgen_add_to_stack_pointer(16);
3728
3728
  }
3729
3729
  }
3730
+ /**
3731
+ * @param {string} encrypted_user_key
3732
+ * @param {Uint8Array} master_key
3733
+ * @returns {Uint8Array}
3734
+ */
3735
+ static decrypt_user_key_with_master_key(encrypted_user_key, master_key) {
3736
+ try {
3737
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3738
+ const ptr0 = passStringToWasm0(
3739
+ encrypted_user_key,
3740
+ wasm.__wbindgen_malloc,
3741
+ wasm.__wbindgen_realloc,
3742
+ );
3743
+ const len0 = WASM_VECTOR_LEN;
3744
+ const ptr1 = passArray8ToWasm0(master_key, wasm.__wbindgen_malloc);
3745
+ const len1 = WASM_VECTOR_LEN;
3746
+ wasm.purecrypto_decrypt_user_key_with_master_key(retptr, ptr0, len0, ptr1, len1);
3747
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
3748
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
3749
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
3750
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
3751
+ if (r3) {
3752
+ throw takeObject(r2);
3753
+ }
3754
+ var v3 = getArrayU8FromWasm0(r0, r1).slice();
3755
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
3756
+ return v3;
3757
+ } finally {
3758
+ wasm.__wbindgen_add_to_stack_pointer(16);
3759
+ }
3760
+ }
3730
3761
  }
3731
3762
  module.exports.PureCrypto = PureCrypto;
3732
3763
 
@@ -4126,14 +4157,7 @@ module.exports.__wbg_getTime_46267b1c24877e30 = function (arg0) {
4126
4157
  return ret;
4127
4158
  };
4128
4159
 
4129
- module.exports.__wbg_get_67b2ba62fc30de12 = function () {
4130
- return handleError(function (arg0, arg1) {
4131
- const ret = Reflect.get(getObject(arg0), getObject(arg1));
4132
- return addHeapObject(ret);
4133
- }, arguments);
4134
- };
4135
-
4136
- module.exports.__wbg_get_945a0b915f37e6a5 = function () {
4160
+ module.exports.__wbg_get_3a409a7dafd3e832 = function () {
4137
4161
  return handleError(function (arg0, arg1, arg2) {
4138
4162
  let deferred0_0;
4139
4163
  let deferred0_1;
@@ -4148,7 +4172,14 @@ module.exports.__wbg_get_945a0b915f37e6a5 = function () {
4148
4172
  }, arguments);
4149
4173
  };
4150
4174
 
4151
- module.exports.__wbg_get_9ee78ff9ed59da5e = function () {
4175
+ module.exports.__wbg_get_67b2ba62fc30de12 = function () {
4176
+ return handleError(function (arg0, arg1) {
4177
+ const ret = Reflect.get(getObject(arg0), getObject(arg1));
4178
+ return addHeapObject(ret);
4179
+ }, arguments);
4180
+ };
4181
+
4182
+ module.exports.__wbg_get_95a0582c46fd0c96 = function () {
4152
4183
  return handleError(function (arg0, arg1, arg2) {
4153
4184
  let deferred0_0;
4154
4185
  let deferred0_1;
@@ -4168,7 +4199,7 @@ module.exports.__wbg_get_b9b93047fe3cf45b = function (arg0, arg1) {
4168
4199
  return addHeapObject(ret);
4169
4200
  };
4170
4201
 
4171
- module.exports.__wbg_getaccesstoken_02c003cee7a7f946 = function (arg0) {
4202
+ module.exports.__wbg_getaccesstoken_cbb2f210f2f61bbd = function (arg0) {
4172
4203
  const ret = getObject(arg0).get_access_token();
4173
4204
  return addHeapObject(ret);
4174
4205
  };
@@ -4353,14 +4384,14 @@ module.exports.__wbg_length_e2d2a49132c1b256 = function (arg0) {
4353
4384
  return ret;
4354
4385
  };
4355
4386
 
4356
- module.exports.__wbg_list_089304e0f8b73332 = function () {
4387
+ module.exports.__wbg_list_b1cdc7778de66020 = function () {
4357
4388
  return handleError(function (arg0) {
4358
4389
  const ret = getObject(arg0).list();
4359
4390
  return addHeapObject(ret);
4360
4391
  }, arguments);
4361
4392
  };
4362
4393
 
4363
- module.exports.__wbg_list_8f1660977cede183 = function () {
4394
+ module.exports.__wbg_list_bcf3b9131930635a = function () {
4364
4395
  return handleError(function (arg0) {
4365
4396
  const ret = getObject(arg0).list();
4366
4397
  return addHeapObject(ret);
@@ -4403,7 +4434,7 @@ module.exports.__wbg_new_23a2665fac83c611 = function (arg0, arg1) {
4403
4434
  const a = state0.a;
4404
4435
  state0.a = 0;
4405
4436
  try {
4406
- return __wbg_adapter_336(a, state0.b, arg0, arg1);
4437
+ return __wbg_adapter_337(a, state0.b, arg0, arg1);
4407
4438
  } finally {
4408
4439
  state0.a = a;
4409
4440
  }
@@ -4561,7 +4592,7 @@ module.exports.__wbg_randomFillSync_ac0988aba3254290 = function () {
4561
4592
  }, arguments);
4562
4593
  };
4563
4594
 
4564
- module.exports.__wbg_remove_040e62d289940f27 = function () {
4595
+ module.exports.__wbg_remove_975abb7a03360aba = function () {
4565
4596
  return handleError(function (arg0, arg1, arg2) {
4566
4597
  let deferred0_0;
4567
4598
  let deferred0_1;
@@ -4576,7 +4607,7 @@ module.exports.__wbg_remove_040e62d289940f27 = function () {
4576
4607
  }, arguments);
4577
4608
  };
4578
4609
 
4579
- module.exports.__wbg_remove_776df28597eb84c1 = function () {
4610
+ module.exports.__wbg_remove_b7b33f655fbc8553 = function () {
4580
4611
  return handleError(function (arg0, arg1, arg2) {
4581
4612
  let deferred0_0;
4582
4613
  let deferred0_1;
@@ -4630,7 +4661,7 @@ module.exports.__wbg_set_3f1d0b984ed272ed = function (arg0, arg1, arg2) {
4630
4661
  getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
4631
4662
  };
4632
4663
 
4633
- module.exports.__wbg_set_4b0d9d322752f026 = function () {
4664
+ module.exports.__wbg_set_40d071fe896210d7 = function () {
4634
4665
  return handleError(function (arg0, arg1, arg2, arg3) {
4635
4666
  let deferred0_0;
4636
4667
  let deferred0_1;
@@ -4654,7 +4685,7 @@ module.exports.__wbg_set_8fc6bf8a5b1071d1 = function (arg0, arg1, arg2) {
4654
4685
  return addHeapObject(ret);
4655
4686
  };
4656
4687
 
4657
- module.exports.__wbg_set_ce6e1a0d1eefa91c = function () {
4688
+ module.exports.__wbg_set_9b654d2ccc308957 = function () {
4658
4689
  return handleError(function (arg0, arg1, arg2, arg3) {
4659
4690
  let deferred0_0;
4660
4691
  let deferred0_1;
@@ -4889,17 +4920,17 @@ module.exports.__wbindgen_closure_wrapper193 = function (arg0, arg1, arg2) {
4889
4920
  return addHeapObject(ret);
4890
4921
  };
4891
4922
 
4892
- module.exports.__wbindgen_closure_wrapper3784 = function (arg0, arg1, arg2) {
4923
+ module.exports.__wbindgen_closure_wrapper3786 = function (arg0, arg1, arg2) {
4893
4924
  const ret = makeMutClosure(arg0, arg1, 294, __wbg_adapter_60);
4894
4925
  return addHeapObject(ret);
4895
4926
  };
4896
4927
 
4897
- module.exports.__wbindgen_closure_wrapper6138 = function (arg0, arg1, arg2) {
4928
+ module.exports.__wbindgen_closure_wrapper6140 = function (arg0, arg1, arg2) {
4898
4929
  const ret = makeMutClosure(arg0, arg1, 319, __wbg_adapter_60);
4899
4930
  return addHeapObject(ret);
4900
4931
  };
4901
4932
 
4902
- module.exports.__wbindgen_closure_wrapper6519 = function (arg0, arg1, arg2) {
4933
+ module.exports.__wbindgen_closure_wrapper6521 = function (arg0, arg1, arg2) {
4903
4934
  const ret = makeMutClosure(arg0, arg1, 342, __wbg_adapter_57);
4904
4935
  return addHeapObject(ret);
4905
4936
  };
@@ -170,6 +170,13 @@ export const purecrypto_derive_kdf_material: (
170
170
  e: number,
171
171
  f: number,
172
172
  ) => void;
173
+ export const purecrypto_decrypt_user_key_with_master_key: (
174
+ a: number,
175
+ b: number,
176
+ c: number,
177
+ d: number,
178
+ e: number,
179
+ ) => void;
173
180
  export const generate_ssh_key: (a: number, b: number) => void;
174
181
  export const import_ssh_key: (a: number, b: number, c: number, d: number, e: number) => void;
175
182
  export const isTestError: (a: number) => number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bitwarden/sdk-internal",
3
- "version": "0.2.0-main.309",
3
+ "version": "0.2.0-main.310",
4
4
  "license": "GPL-3.0",
5
5
  "repository": {
6
6
  "type": "git",