@wireapp/core-crypto 0.11.0 → 1.0.0-pre.4
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
Binary file
|
@@ -152,11 +152,11 @@ export interface MemberAddedMessages {
|
|
152
152
|
*/
|
153
153
|
welcome: Uint8Array;
|
154
154
|
/**
|
155
|
-
* MLS
|
155
|
+
* MLS GroupInfo which is required for joining a group by external commit
|
156
156
|
*
|
157
157
|
* @readonly
|
158
158
|
*/
|
159
|
-
|
159
|
+
groupInfo: GroupInfoBundle;
|
160
160
|
}
|
161
161
|
/**
|
162
162
|
* Data shape for a MLS generic commit + optional bundle (aka stapled commit & welcome)
|
@@ -175,35 +175,35 @@ export interface CommitBundle {
|
|
175
175
|
*/
|
176
176
|
welcome?: Uint8Array;
|
177
177
|
/**
|
178
|
-
* MLS
|
178
|
+
* MLS GroupInfo which is required for joining a group by external commit
|
179
179
|
*
|
180
180
|
* @readonly
|
181
181
|
*/
|
182
|
-
|
182
|
+
groupInfo: GroupInfoBundle;
|
183
183
|
}
|
184
184
|
/**
|
185
|
-
* Wraps a
|
185
|
+
* Wraps a GroupInfo in order to efficiently upload it to the Delivery Service.
|
186
186
|
* This is not part of MLS protocol but parts might be standardized at some point.
|
187
187
|
*/
|
188
|
-
export interface
|
188
|
+
export interface GroupInfoBundle {
|
189
189
|
/**
|
190
|
-
* see {@link
|
190
|
+
* see {@link GroupInfoEncryptionType}
|
191
191
|
*/
|
192
|
-
encryptionType:
|
192
|
+
encryptionType: GroupInfoEncryptionType;
|
193
193
|
/**
|
194
194
|
* see {@link RatchetTreeType}
|
195
195
|
*/
|
196
196
|
ratchetTreeType: RatchetTreeType;
|
197
197
|
/**
|
198
|
-
* TLS-serialized
|
198
|
+
* TLS-serialized GroupInfo
|
199
199
|
*/
|
200
200
|
payload: Uint8Array;
|
201
201
|
}
|
202
202
|
/**
|
203
|
-
* Informs whether the
|
204
|
-
* see [core_crypto::mls::conversation::
|
203
|
+
* Informs whether the GroupInfo is confidential
|
204
|
+
* see [core_crypto::mls::conversation::group_info::GroupInfoEncryptionType]
|
205
205
|
*/
|
206
|
-
export declare enum
|
206
|
+
export declare enum GroupInfoEncryptionType {
|
207
207
|
/**
|
208
208
|
* Unencrypted
|
209
209
|
*/
|
@@ -215,11 +215,11 @@ export declare enum PublicGroupStateEncryptionType {
|
|
215
215
|
}
|
216
216
|
/**
|
217
217
|
* Represents different ways of carrying the Ratchet Tree with some optimizations to save some space
|
218
|
-
* see [core_crypto::mls::conversation::
|
218
|
+
* see [core_crypto::mls::conversation::group_info::RatchetTreeType]
|
219
219
|
*/
|
220
220
|
export declare enum RatchetTreeType {
|
221
221
|
/**
|
222
|
-
* Complete
|
222
|
+
* Complete GroupInfo
|
223
223
|
*/
|
224
224
|
Full = 1,
|
225
225
|
/**
|
@@ -302,7 +302,7 @@ export interface ConversationInitBundle {
|
|
302
302
|
*
|
303
303
|
* @readonly
|
304
304
|
*/
|
305
|
-
|
305
|
+
groupInfo: GroupInfoBundle;
|
306
306
|
}
|
307
307
|
/**
|
308
308
|
* This is a wrapper for all the possible outcomes you can get after decrypting a message
|
@@ -431,11 +431,7 @@ export declare enum ExternalProposalType {
|
|
431
431
|
/**
|
432
432
|
* This allows to propose the addition of other clients to the MLS group/conversation
|
433
433
|
*/
|
434
|
-
Add = 0
|
435
|
-
/**
|
436
|
-
* This allows to propose the removal of clients from the MLS group/conversation
|
437
|
-
*/
|
438
|
-
Remove = 1
|
434
|
+
Add = 0
|
439
435
|
}
|
440
436
|
export interface ExternalProposalArgs {
|
441
437
|
/**
|
@@ -448,12 +444,6 @@ export interface ExternalProposalArgs {
|
|
448
444
|
*/
|
449
445
|
epoch: number;
|
450
446
|
}
|
451
|
-
export interface ExternalRemoveProposalArgs extends ExternalProposalArgs {
|
452
|
-
/**
|
453
|
-
* KeyPackageRef of the client that needs to be removed in the proposal
|
454
|
-
*/
|
455
|
-
keyPackageRef: Uint8Array;
|
456
|
-
}
|
457
447
|
export interface ExternalAddProposalArgs extends ExternalProposalArgs {
|
458
448
|
/**
|
459
449
|
* {@link Ciphersuite} to propose to join the MLS group with.
|
@@ -759,16 +749,16 @@ export declare class CoreCrypto {
|
|
759
749
|
* @returns A {@link ProposalBundle} containing the Proposal and its reference in order to roll it back if necessary
|
760
750
|
*/
|
761
751
|
newProposal(proposalType: ProposalType, args: ProposalArgs | AddProposalArgs | RemoveProposalArgs): Promise<ProposalBundle>;
|
762
|
-
newExternalProposal(externalProposalType: ExternalProposalType, args: ExternalAddProposalArgs
|
752
|
+
newExternalProposal(externalProposalType: ExternalProposalType, args: ExternalAddProposalArgs): Promise<Uint8Array>;
|
763
753
|
/**
|
764
|
-
* Exports
|
754
|
+
* Exports GroupInfo for use in external commits
|
765
755
|
*
|
766
756
|
* @param conversationId - MLS Conversation ID
|
767
|
-
* @returns TLS-serialized MLS
|
757
|
+
* @returns TLS-serialized MLS GroupInfo
|
768
758
|
*/
|
769
|
-
|
759
|
+
exportGroupInfo(conversationId: ConversationId): Promise<Uint8Array>;
|
770
760
|
/**
|
771
|
-
* Allows to create an external commit to "apply" to join a group through its
|
761
|
+
* Allows to create an external commit to "apply" to join a group through its GroupInfo.
|
772
762
|
*
|
773
763
|
* If the Delivery Service accepts the external commit, you have to {@link CoreCrypto.mergePendingGroupFromExternalCommit}
|
774
764
|
* in order to get back a functional MLS group. On the opposite, if it rejects it, you can either retry by just
|
@@ -777,14 +767,14 @@ export declare class CoreCrypto {
|
|
777
767
|
* {@link CoreCrypto.clearPendingGroupFromExternalCommit} in order not to bloat the user's storage but nothing
|
778
768
|
* bad can happen if you forget to except some storage space wasted.
|
779
769
|
*
|
780
|
-
* @param
|
770
|
+
* @param groupInfo - a TLS encoded GroupInfo fetched from the Delivery Service
|
781
771
|
* @param credentialType - kind of Credential to use for joining this group. If {@link CredentialType.Basic} is
|
782
772
|
* chosen and no Credential has been created yet for it, a new one will be generated.
|
783
773
|
* @param configuration - configuration of the MLS group
|
784
774
|
* When {@link CredentialType.X509} is chosen, it fails when no Credential has been created for the given {@link Ciphersuite}.
|
785
775
|
* @returns see {@link ConversationInitBundle}
|
786
776
|
*/
|
787
|
-
joinByExternalCommit(
|
777
|
+
joinByExternalCommit(groupInfo: Uint8Array, credentialType: CredentialType, configuration?: CustomConfiguration): Promise<ConversationInitBundle>;
|
788
778
|
/**
|
789
779
|
* This merges the commit generated by {@link CoreCrypto.joinByExternalCommit}, persists the group permanently
|
790
780
|
* and deletes the temporary one. This step makes the group operational and ready to encrypt/decrypt message
|
@@ -1144,7 +1134,6 @@ export declare class WireE2eIdentity {
|
|
1144
1134
|
* Verifies that the previous challenge has been completed.
|
1145
1135
|
*
|
1146
1136
|
* @param orderUrl `location` header from http response you got from {@link newOrderResponse}
|
1147
|
-
* @param account you found after {@link newAccountResponse}
|
1148
1137
|
* @param previousNonce `replay-nonce` response header from `POST /acme/{provisioner-name}/challenge/{challenge-id}`
|
1149
1138
|
* @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.4
|
1150
1139
|
*/
|
@@ -1160,7 +1149,6 @@ export declare class WireE2eIdentity {
|
|
1160
1149
|
/**
|
1161
1150
|
* Final step before fetching the certificate.
|
1162
1151
|
*
|
1163
|
-
* @param order - order you got from {@link checkOrderResponse}
|
1164
1152
|
* @param previousNonce - `replay-nonce` response header from `POST /acme/{provisioner-name}/order/{order-id}`
|
1165
1153
|
* @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.4
|
1166
1154
|
*/
|
@@ -35,14 +35,6 @@ const heap = new Array(128).fill(undefined);
|
|
35
35
|
heap.push(undefined, null, true, false);
|
36
36
|
function getObject(idx) { return heap[idx]; }
|
37
37
|
let heap_next = heap.length;
|
38
|
-
function addHeapObject(obj) {
|
39
|
-
if (heap_next === heap.length)
|
40
|
-
heap.push(heap.length + 1);
|
41
|
-
const idx = heap_next;
|
42
|
-
heap_next = heap[idx];
|
43
|
-
heap[idx] = obj;
|
44
|
-
return idx;
|
45
|
-
}
|
46
38
|
function dropObject(idx) {
|
47
39
|
if (idx < 132)
|
48
40
|
return;
|
@@ -54,6 +46,14 @@ function takeObject(idx) {
|
|
54
46
|
dropObject(idx);
|
55
47
|
return ret;
|
56
48
|
}
|
49
|
+
function addHeapObject(obj) {
|
50
|
+
if (heap_next === heap.length)
|
51
|
+
heap.push(heap.length + 1);
|
52
|
+
const idx = heap_next;
|
53
|
+
heap_next = heap[idx];
|
54
|
+
heap[idx] = obj;
|
55
|
+
return idx;
|
56
|
+
}
|
57
57
|
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available'); } });
|
58
58
|
if (typeof TextDecoder !== 'undefined') {
|
59
59
|
cachedTextDecoder.decode();
|
@@ -230,12 +230,12 @@ function makeMutClosure(arg0, arg1, dtor, f) {
|
|
230
230
|
return real;
|
231
231
|
}
|
232
232
|
function __wbg_adapter_52(arg0, arg1, arg2) {
|
233
|
-
wasm$1.
|
233
|
+
wasm$1.wasm_bindgen__convert__closures__invoke1_mut__heb4cb26b6c16bdde(arg0, arg1, addHeapObject(arg2));
|
234
234
|
}
|
235
235
|
function __wbg_adapter_55(arg0, arg1, arg2) {
|
236
236
|
try {
|
237
237
|
const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
|
238
|
-
wasm$1.
|
238
|
+
wasm$1.wasm_bindgen__convert__closures__invoke1_mut__h4f01ac4587554ef9(retptr, arg0, arg1, addHeapObject(arg2));
|
239
239
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
240
240
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
241
241
|
if (r1) {
|
@@ -299,8 +299,8 @@ function handleError(f, args) {
|
|
299
299
|
wasm$1.__wbindgen_exn_store(addHeapObject(e));
|
300
300
|
}
|
301
301
|
}
|
302
|
-
function
|
303
|
-
wasm$1.
|
302
|
+
function __wbg_adapter_288(arg0, arg1, arg2, arg3) {
|
303
|
+
wasm$1.wasm_bindgen__convert__closures__invoke2_mut__h20434c3f820154b5(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
304
304
|
}
|
305
305
|
/**
|
306
306
|
* see [core_crypto::prelude::MlsWirePolicy]
|
@@ -563,11 +563,11 @@ class CommitBundle {
|
|
563
563
|
return takeObject(ret);
|
564
564
|
}
|
565
565
|
/**
|
566
|
-
* @returns {
|
566
|
+
* @returns {GroupInfoBundle}
|
567
567
|
*/
|
568
|
-
get
|
569
|
-
const ret = wasm$1.
|
570
|
-
return
|
568
|
+
get group_info() {
|
569
|
+
const ret = wasm$1.commitbundle_group_info(this.__wbg_ptr);
|
570
|
+
return GroupInfoBundle.__wrap(ret);
|
571
571
|
}
|
572
572
|
}
|
573
573
|
/**
|
@@ -629,11 +629,11 @@ class ConversationInitBundle {
|
|
629
629
|
return takeObject(ret);
|
630
630
|
}
|
631
631
|
/**
|
632
|
-
* @returns {
|
632
|
+
* @returns {GroupInfoBundle}
|
633
633
|
*/
|
634
|
-
get
|
635
|
-
const ret = wasm$1.
|
636
|
-
return
|
634
|
+
get group_info() {
|
635
|
+
const ret = wasm$1.commitbundle_group_info(this.__wbg_ptr);
|
636
|
+
return GroupInfoBundle.__wrap(ret);
|
637
637
|
}
|
638
638
|
}
|
639
639
|
/**
|
@@ -1151,44 +1151,27 @@ let CoreCrypto$1 = class CoreCrypto {
|
|
1151
1151
|
/**
|
1152
1152
|
* Returns: [`WasmCryptoResult<js_sys::Uint8Array>`]
|
1153
1153
|
*
|
1154
|
-
* see [core_crypto::mls::MlsCentral::
|
1155
|
-
* @param {Uint8Array} conversation_id
|
1156
|
-
* @param {number} epoch
|
1157
|
-
* @param {Uint8Array} keypackage_ref
|
1158
|
-
* @returns {Promise<any>}
|
1159
|
-
*/
|
1160
|
-
new_external_remove_proposal(conversation_id, epoch, keypackage_ref) {
|
1161
|
-
const ptr0 = passArray8ToWasm0(conversation_id, wasm$1.__wbindgen_malloc);
|
1162
|
-
const len0 = WASM_VECTOR_LEN;
|
1163
|
-
const ptr1 = passArray8ToWasm0(keypackage_ref, wasm$1.__wbindgen_malloc);
|
1164
|
-
const len1 = WASM_VECTOR_LEN;
|
1165
|
-
const ret = wasm$1.corecrypto_new_external_remove_proposal(this.__wbg_ptr, ptr0, len0, epoch, ptr1, len1);
|
1166
|
-
return takeObject(ret);
|
1167
|
-
}
|
1168
|
-
/**
|
1169
|
-
* Returns: [`WasmCryptoResult<js_sys::Uint8Array>`]
|
1170
|
-
*
|
1171
|
-
* see [core_crypto::mls::MlsCentral::export_public_group_state]
|
1154
|
+
* see [core_crypto::mls::MlsCentral::export_group_info]
|
1172
1155
|
* @param {Uint8Array} conversation_id
|
1173
1156
|
* @returns {Promise<any>}
|
1174
1157
|
*/
|
1175
|
-
|
1158
|
+
export_group_info(conversation_id) {
|
1176
1159
|
const ptr0 = passArray8ToWasm0(conversation_id, wasm$1.__wbindgen_malloc);
|
1177
1160
|
const len0 = WASM_VECTOR_LEN;
|
1178
|
-
const ret = wasm$1.
|
1161
|
+
const ret = wasm$1.corecrypto_export_group_info(this.__wbg_ptr, ptr0, len0);
|
1179
1162
|
return takeObject(ret);
|
1180
1163
|
}
|
1181
1164
|
/**
|
1182
1165
|
* Returns: [`WasmCryptoResult<ConversationInitBundle>`]
|
1183
1166
|
*
|
1184
1167
|
* see [core_crypto::mls::MlsCentral::join_by_external_commit]
|
1185
|
-
* @param {Uint8Array}
|
1168
|
+
* @param {Uint8Array} group_info
|
1186
1169
|
* @param {CustomConfiguration} custom_configuration
|
1187
1170
|
* @param {number} credential_type
|
1188
1171
|
* @returns {Promise<any>}
|
1189
1172
|
*/
|
1190
|
-
join_by_external_commit(
|
1191
|
-
const ptr0 = passArray8ToWasm0(
|
1173
|
+
join_by_external_commit(group_info, custom_configuration, credential_type) {
|
1174
|
+
const ptr0 = passArray8ToWasm0(group_info, wasm$1.__wbindgen_malloc);
|
1192
1175
|
const len0 = WASM_VECTOR_LEN;
|
1193
1176
|
_assertClass(custom_configuration, CustomConfiguration);
|
1194
1177
|
var ptr1 = custom_configuration.__destroy_into_raw();
|
@@ -2123,6 +2106,46 @@ class FfiWireE2EIdentity {
|
|
2123
2106
|
}
|
2124
2107
|
}
|
2125
2108
|
/**
|
2109
|
+
*/
|
2110
|
+
class GroupInfoBundle {
|
2111
|
+
static __wrap(ptr) {
|
2112
|
+
ptr = ptr >>> 0;
|
2113
|
+
const obj = Object.create(GroupInfoBundle.prototype);
|
2114
|
+
obj.__wbg_ptr = ptr;
|
2115
|
+
return obj;
|
2116
|
+
}
|
2117
|
+
__destroy_into_raw() {
|
2118
|
+
const ptr = this.__wbg_ptr;
|
2119
|
+
this.__wbg_ptr = 0;
|
2120
|
+
return ptr;
|
2121
|
+
}
|
2122
|
+
free() {
|
2123
|
+
const ptr = this.__destroy_into_raw();
|
2124
|
+
wasm$1.__wbg_groupinfobundle_free(ptr);
|
2125
|
+
}
|
2126
|
+
/**
|
2127
|
+
* @returns {number}
|
2128
|
+
*/
|
2129
|
+
get encryption_type() {
|
2130
|
+
const ret = wasm$1.groupinfobundle_encryption_type(this.__wbg_ptr);
|
2131
|
+
return ret;
|
2132
|
+
}
|
2133
|
+
/**
|
2134
|
+
* @returns {number}
|
2135
|
+
*/
|
2136
|
+
get ratchet_tree_type() {
|
2137
|
+
const ret = wasm$1.groupinfobundle_ratchet_tree_type(this.__wbg_ptr);
|
2138
|
+
return ret;
|
2139
|
+
}
|
2140
|
+
/**
|
2141
|
+
* @returns {Uint8Array}
|
2142
|
+
*/
|
2143
|
+
get payload() {
|
2144
|
+
const ret = wasm$1.acmechallenge_delegate(this.__wbg_ptr);
|
2145
|
+
return takeObject(ret);
|
2146
|
+
}
|
2147
|
+
}
|
2148
|
+
/**
|
2126
2149
|
* see [core_crypto::prelude::ConversationMember]
|
2127
2150
|
*/
|
2128
2151
|
class Invitee {
|
@@ -2186,11 +2209,11 @@ class MemberAddedMessages {
|
|
2186
2209
|
/**
|
2187
2210
|
* @param {Uint8Array} welcome
|
2188
2211
|
* @param {Uint8Array} commit
|
2189
|
-
* @param {
|
2212
|
+
* @param {GroupInfoBundle} group_info
|
2190
2213
|
*/
|
2191
|
-
constructor(welcome, commit,
|
2192
|
-
_assertClass(
|
2193
|
-
var ptr0 =
|
2214
|
+
constructor(welcome, commit, group_info) {
|
2215
|
+
_assertClass(group_info, GroupInfoBundle);
|
2216
|
+
var ptr0 = group_info.__destroy_into_raw();
|
2194
2217
|
const ret = wasm$1.memberaddedmessages_new(addHeapObject(welcome), addHeapObject(commit), ptr0);
|
2195
2218
|
return MemberAddedMessages.__wrap(ret);
|
2196
2219
|
}
|
@@ -2209,11 +2232,11 @@ class MemberAddedMessages {
|
|
2209
2232
|
return takeObject(ret);
|
2210
2233
|
}
|
2211
2234
|
/**
|
2212
|
-
* @returns {
|
2235
|
+
* @returns {GroupInfoBundle}
|
2213
2236
|
*/
|
2214
|
-
get
|
2215
|
-
const ret = wasm$1.
|
2216
|
-
return
|
2237
|
+
get group_info() {
|
2238
|
+
const ret = wasm$1.commitbundle_group_info(this.__wbg_ptr);
|
2239
|
+
return GroupInfoBundle.__wrap(ret);
|
2217
2240
|
}
|
2218
2241
|
}
|
2219
2242
|
/**
|
@@ -2426,46 +2449,6 @@ class ProteusAutoPrekeyBundle {
|
|
2426
2449
|
}
|
2427
2450
|
}
|
2428
2451
|
/**
|
2429
|
-
*/
|
2430
|
-
class PublicGroupStateBundle {
|
2431
|
-
static __wrap(ptr) {
|
2432
|
-
ptr = ptr >>> 0;
|
2433
|
-
const obj = Object.create(PublicGroupStateBundle.prototype);
|
2434
|
-
obj.__wbg_ptr = ptr;
|
2435
|
-
return obj;
|
2436
|
-
}
|
2437
|
-
__destroy_into_raw() {
|
2438
|
-
const ptr = this.__wbg_ptr;
|
2439
|
-
this.__wbg_ptr = 0;
|
2440
|
-
return ptr;
|
2441
|
-
}
|
2442
|
-
free() {
|
2443
|
-
const ptr = this.__destroy_into_raw();
|
2444
|
-
wasm$1.__wbg_publicgroupstatebundle_free(ptr);
|
2445
|
-
}
|
2446
|
-
/**
|
2447
|
-
* @returns {number}
|
2448
|
-
*/
|
2449
|
-
get encryption_type() {
|
2450
|
-
const ret = wasm$1.publicgroupstatebundle_encryption_type(this.__wbg_ptr);
|
2451
|
-
return ret;
|
2452
|
-
}
|
2453
|
-
/**
|
2454
|
-
* @returns {number}
|
2455
|
-
*/
|
2456
|
-
get ratchet_tree_type() {
|
2457
|
-
const ret = wasm$1.publicgroupstatebundle_ratchet_tree_type(this.__wbg_ptr);
|
2458
|
-
return ret;
|
2459
|
-
}
|
2460
|
-
/**
|
2461
|
-
* @returns {Uint8Array}
|
2462
|
-
*/
|
2463
|
-
get payload() {
|
2464
|
-
const ret = wasm$1.acmechallenge_delegate(this.__wbg_ptr);
|
2465
|
-
return takeObject(ret);
|
2466
|
-
}
|
2467
|
-
}
|
2468
|
-
/**
|
2469
2452
|
* see [core_crypto::prelude::WireIdentity]
|
2470
2453
|
*/
|
2471
2454
|
class WireIdentity {
|
@@ -2614,6 +2597,9 @@ async function __wbg_load(module, imports) {
|
|
2614
2597
|
function __wbg_get_imports() {
|
2615
2598
|
const imports = {};
|
2616
2599
|
imports.wbg = {};
|
2600
|
+
imports.wbg.__wbindgen_object_drop_ref = function (arg0) {
|
2601
|
+
takeObject(arg0);
|
2602
|
+
};
|
2617
2603
|
imports.wbg.__wbindgen_object_clone_ref = function (arg0) {
|
2618
2604
|
const ret = getObject(arg0);
|
2619
2605
|
return addHeapObject(ret);
|
@@ -2623,9 +2609,6 @@ function __wbg_get_imports() {
|
|
2623
2609
|
const ret = typeof (val) === 'object' && val !== null;
|
2624
2610
|
return ret;
|
2625
2611
|
};
|
2626
|
-
imports.wbg.__wbindgen_object_drop_ref = function (arg0) {
|
2627
|
-
takeObject(arg0);
|
2628
|
-
};
|
2629
2612
|
imports.wbg.__wbg_getwithrefkey_5e6d9547403deab8 = function (arg0, arg1) {
|
2630
2613
|
const ret = getObject(arg0)[getObject(arg1)];
|
2631
2614
|
return addHeapObject(ret);
|
@@ -2638,6 +2621,12 @@ function __wbg_get_imports() {
|
|
2638
2621
|
const ret = getObject(arg0) in getObject(arg1);
|
2639
2622
|
return ret;
|
2640
2623
|
};
|
2624
|
+
imports.wbg.__wbg_objectStore_6eb812526333c917 = function () {
|
2625
|
+
return handleError(function (arg0, arg1, arg2) {
|
2626
|
+
const ret = getObject(arg0).objectStore(getStringFromWasm0(arg1, arg2));
|
2627
|
+
return addHeapObject(ret);
|
2628
|
+
}, arguments);
|
2629
|
+
};
|
2641
2630
|
imports.wbg.__wbg_objectStoreNames_432a9424fbdfefda = function (arg0) {
|
2642
2631
|
const ret = getObject(arg0).objectStoreNames;
|
2643
2632
|
return addHeapObject(ret);
|
@@ -2650,6 +2639,12 @@ function __wbg_get_imports() {
|
|
2650
2639
|
const ret = getStringFromWasm0(arg0, arg1);
|
2651
2640
|
return addHeapObject(ret);
|
2652
2641
|
};
|
2642
|
+
imports.wbg.__wbg_get_a9b507527c0f6958 = function () {
|
2643
|
+
return handleError(function (arg0, arg1) {
|
2644
|
+
const ret = getObject(arg0).get(getObject(arg1));
|
2645
|
+
return addHeapObject(ret);
|
2646
|
+
}, arguments);
|
2647
|
+
};
|
2653
2648
|
imports.wbg.__wbindgen_is_null = function (arg0) {
|
2654
2649
|
const ret = getObject(arg0) === null;
|
2655
2650
|
return ret;
|
@@ -2666,16 +2661,16 @@ function __wbg_get_imports() {
|
|
2666
2661
|
const ret = getObject(arg0).length;
|
2667
2662
|
return ret;
|
2668
2663
|
};
|
2664
|
+
imports.wbg.__wbg_new_2b6fea4ea03b1b95 = function () {
|
2665
|
+
const ret = new Object();
|
2666
|
+
return addHeapObject(ret);
|
2667
|
+
};
|
2669
2668
|
imports.wbg.__wbg_call_587b30eea3e09332 = function () {
|
2670
2669
|
return handleError(function (arg0, arg1, arg2) {
|
2671
2670
|
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
2672
2671
|
return addHeapObject(ret);
|
2673
2672
|
}, arguments);
|
2674
2673
|
};
|
2675
|
-
imports.wbg.__wbindgen_number_new = function (arg0) {
|
2676
|
-
const ret = arg0;
|
2677
|
-
return addHeapObject(ret);
|
2678
|
-
};
|
2679
2674
|
imports.wbg.__wbg_new_2b55e405e4af4986 = function (arg0, arg1) {
|
2680
2675
|
try {
|
2681
2676
|
var state0 = { a: arg0, b: arg1 };
|
@@ -2683,7 +2678,7 @@ function __wbg_get_imports() {
|
|
2683
2678
|
const a = state0.a;
|
2684
2679
|
state0.a = 0;
|
2685
2680
|
try {
|
2686
|
-
return
|
2681
|
+
return __wbg_adapter_288(a, state0.b, arg0, arg1);
|
2687
2682
|
}
|
2688
2683
|
finally {
|
2689
2684
|
state0.a = a;
|
@@ -2700,14 +2695,10 @@ function __wbg_get_imports() {
|
|
2700
2695
|
const ret = new Uint8Array(getObject(arg0));
|
2701
2696
|
return addHeapObject(ret);
|
2702
2697
|
};
|
2703
|
-
imports.wbg.
|
2704
|
-
const ret =
|
2698
|
+
imports.wbg.__wbindgen_bigint_from_u64 = function (arg0) {
|
2699
|
+
const ret = BigInt.asUintN(64, arg0);
|
2705
2700
|
return addHeapObject(ret);
|
2706
2701
|
};
|
2707
|
-
imports.wbg.__wbg_push_109cfc26d02582dd = function (arg0, arg1) {
|
2708
|
-
const ret = getObject(arg0).push(getObject(arg1));
|
2709
|
-
return ret;
|
2710
|
-
};
|
2711
2702
|
imports.wbg.__wbg_new_0f2b71ca2f2a6029 = function () {
|
2712
2703
|
const ret = new Map();
|
2713
2704
|
return addHeapObject(ret);
|
@@ -2716,14 +2707,28 @@ function __wbg_get_imports() {
|
|
2716
2707
|
const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
|
2717
2708
|
return addHeapObject(ret);
|
2718
2709
|
};
|
2719
|
-
imports.wbg.
|
2720
|
-
const ret =
|
2710
|
+
imports.wbg.__wbg_new_0394642eae39db16 = function () {
|
2711
|
+
const ret = new Array();
|
2721
2712
|
return addHeapObject(ret);
|
2722
2713
|
};
|
2723
|
-
imports.wbg.
|
2724
|
-
const ret =
|
2714
|
+
imports.wbg.__wbg_push_109cfc26d02582dd = function (arg0, arg1) {
|
2715
|
+
const ret = getObject(arg0).push(getObject(arg1));
|
2716
|
+
return ret;
|
2717
|
+
};
|
2718
|
+
imports.wbg.__wbg_ffiwiree2eidentity_new = function (arg0) {
|
2719
|
+
const ret = FfiWireE2EIdentity.__wrap(arg0);
|
2725
2720
|
return addHeapObject(ret);
|
2726
2721
|
};
|
2722
|
+
imports.wbg.__wbindgen_number_new = function (arg0) {
|
2723
|
+
const ret = arg0;
|
2724
|
+
return addHeapObject(ret);
|
2725
|
+
};
|
2726
|
+
imports.wbg.__wbg_set_b4da98d504ac6091 = function (arg0, arg1, arg2) {
|
2727
|
+
getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
|
2728
|
+
};
|
2729
|
+
imports.wbg.__wbg_set_841ac57cff3d672b = function (arg0, arg1, arg2) {
|
2730
|
+
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
2731
|
+
};
|
2727
2732
|
imports.wbg.__wbg_proteusautoprekeybundle_new = function (arg0) {
|
2728
2733
|
const ret = ProteusAutoPrekeyBundle.__wrap(arg0);
|
2729
2734
|
return addHeapObject(ret);
|
@@ -2732,9 +2737,17 @@ function __wbg_get_imports() {
|
|
2732
2737
|
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
2733
2738
|
return addHeapObject(ret);
|
2734
2739
|
};
|
2735
|
-
imports.wbg.
|
2736
|
-
|
2737
|
-
|
2740
|
+
imports.wbg.__wbg_openCursor_63250aa904924858 = function () {
|
2741
|
+
return handleError(function (arg0, arg1) {
|
2742
|
+
const ret = getObject(arg0).openCursor(getObject(arg1));
|
2743
|
+
return addHeapObject(ret);
|
2744
|
+
}, arguments);
|
2745
|
+
};
|
2746
|
+
imports.wbg.__wbg_openCursor_2da32f6b7767a8f6 = function () {
|
2747
|
+
return handleError(function (arg0) {
|
2748
|
+
const ret = getObject(arg0).openCursor();
|
2749
|
+
return addHeapObject(ret);
|
2750
|
+
}, arguments);
|
2738
2751
|
};
|
2739
2752
|
imports.wbg.__wbg_setonsuccess_d668ac71ae816a35 = function (arg0, arg1) {
|
2740
2753
|
getObject(arg0).onsuccess = getObject(arg1);
|
@@ -2796,9 +2809,6 @@ function __wbg_get_imports() {
|
|
2796
2809
|
const ret = CoreCrypto$1.__wrap(arg0);
|
2797
2810
|
return addHeapObject(ret);
|
2798
2811
|
};
|
2799
|
-
imports.wbg.__wbg_set_841ac57cff3d672b = function (arg0, arg1, arg2) {
|
2800
|
-
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
2801
|
-
};
|
2802
2812
|
imports.wbg.__wbg_instanceof_Promise_4b9b76dc9c35f96e = function (arg0) {
|
2803
2813
|
let result;
|
2804
2814
|
try {
|
@@ -2847,9 +2857,6 @@ function __wbg_get_imports() {
|
|
2847
2857
|
const ret = Promise.reject(getObject(arg0));
|
2848
2858
|
return addHeapObject(ret);
|
2849
2859
|
};
|
2850
|
-
imports.wbg.__wbg_set_b4da98d504ac6091 = function (arg0, arg1, arg2) {
|
2851
|
-
getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
|
2852
|
-
};
|
2853
2860
|
imports.wbg.__wbg_proposalbundle_new = function (arg0) {
|
2854
2861
|
const ret = ProposalBundle.__wrap(arg0);
|
2855
2862
|
return addHeapObject(ret);
|
@@ -2951,12 +2958,6 @@ function __wbg_get_imports() {
|
|
2951
2958
|
return addHeapObject(ret);
|
2952
2959
|
}, arguments);
|
2953
2960
|
};
|
2954
|
-
imports.wbg.__wbg_openCursor_9f2ba6afb4885925 = function () {
|
2955
|
-
return handleError(function (arg0, arg1) {
|
2956
|
-
const ret = getObject(arg0).openCursor(getObject(arg1));
|
2957
|
-
return addHeapObject(ret);
|
2958
|
-
}, arguments);
|
2959
|
-
};
|
2960
2961
|
imports.wbg.__wbindgen_memory = function () {
|
2961
2962
|
const ret = wasm$1.memory;
|
2962
2963
|
return addHeapObject(ret);
|
@@ -2969,7 +2970,7 @@ function __wbg_get_imports() {
|
|
2969
2970
|
const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
|
2970
2971
|
return addHeapObject(ret);
|
2971
2972
|
};
|
2972
|
-
imports.wbg.
|
2973
|
+
imports.wbg.__wbg_randomFillSync_dc1e9a60c158336d = function () {
|
2973
2974
|
return handleError(function (arg0, arg1) {
|
2974
2975
|
getObject(arg0).randomFillSync(takeObject(arg1));
|
2975
2976
|
}, arguments);
|
@@ -2978,24 +2979,24 @@ function __wbg_get_imports() {
|
|
2978
2979
|
const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
|
2979
2980
|
return addHeapObject(ret);
|
2980
2981
|
};
|
2981
|
-
imports.wbg.
|
2982
|
+
imports.wbg.__wbg_getRandomValues_37fa2ca9e4e07fab = function () {
|
2982
2983
|
return handleError(function (arg0, arg1) {
|
2983
2984
|
getObject(arg0).getRandomValues(getObject(arg1));
|
2984
2985
|
}, arguments);
|
2985
2986
|
};
|
2986
|
-
imports.wbg.
|
2987
|
+
imports.wbg.__wbg_crypto_c48a774b022d20ac = function (arg0) {
|
2987
2988
|
const ret = getObject(arg0).crypto;
|
2988
2989
|
return addHeapObject(ret);
|
2989
2990
|
};
|
2990
|
-
imports.wbg.
|
2991
|
+
imports.wbg.__wbg_process_298734cf255a885d = function (arg0) {
|
2991
2992
|
const ret = getObject(arg0).process;
|
2992
2993
|
return addHeapObject(ret);
|
2993
2994
|
};
|
2994
|
-
imports.wbg.
|
2995
|
+
imports.wbg.__wbg_versions_e2e78e134e3e5d01 = function (arg0) {
|
2995
2996
|
const ret = getObject(arg0).versions;
|
2996
2997
|
return addHeapObject(ret);
|
2997
2998
|
};
|
2998
|
-
imports.wbg.
|
2999
|
+
imports.wbg.__wbg_node_1cd7a5d853dbea79 = function (arg0) {
|
2999
3000
|
const ret = getObject(arg0).node;
|
3000
3001
|
return addHeapObject(ret);
|
3001
3002
|
};
|
@@ -3003,7 +3004,7 @@ function __wbg_get_imports() {
|
|
3003
3004
|
const ret = typeof (getObject(arg0)) === 'string';
|
3004
3005
|
return ret;
|
3005
3006
|
};
|
3006
|
-
imports.wbg.
|
3007
|
+
imports.wbg.__wbg_require_8f08ceecec0f4fee = function () {
|
3007
3008
|
return handleError(function () {
|
3008
3009
|
const ret = module.require;
|
3009
3010
|
return addHeapObject(ret);
|
@@ -3013,7 +3014,7 @@ function __wbg_get_imports() {
|
|
3013
3014
|
const ret = typeof (getObject(arg0)) === 'function';
|
3014
3015
|
return ret;
|
3015
3016
|
};
|
3016
|
-
imports.wbg.
|
3017
|
+
imports.wbg.__wbg_msCrypto_bcb970640f50a1e8 = function (arg0) {
|
3017
3018
|
const ret = getObject(arg0).msCrypto;
|
3018
3019
|
return addHeapObject(ret);
|
3019
3020
|
};
|
@@ -3094,12 +3095,6 @@ function __wbg_get_imports() {
|
|
3094
3095
|
const ret = getObject(arg0).target;
|
3095
3096
|
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
3096
3097
|
};
|
3097
|
-
imports.wbg.__wbg_error_a16f2288166003c0 = function () {
|
3098
|
-
return handleError(function (arg0) {
|
3099
|
-
const ret = getObject(arg0).error;
|
3100
|
-
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
3101
|
-
}, arguments);
|
3102
|
-
};
|
3103
3098
|
imports.wbg.__wbg_result_fcdf1e20f03fa375 = function () {
|
3104
3099
|
return handleError(function (arg0) {
|
3105
3100
|
const ret = getObject(arg0).result;
|
@@ -3140,6 +3135,12 @@ function __wbg_get_imports() {
|
|
3140
3135
|
getObject(arg0).deleteObjectStore(getStringFromWasm0(arg1, arg2));
|
3141
3136
|
}, arguments);
|
3142
3137
|
};
|
3138
|
+
imports.wbg.__wbg_error_a16f2288166003c0 = function () {
|
3139
|
+
return handleError(function (arg0) {
|
3140
|
+
const ret = getObject(arg0).error;
|
3141
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
3142
|
+
}, arguments);
|
3143
|
+
};
|
3143
3144
|
imports.wbg.__wbindgen_is_falsy = function (arg0) {
|
3144
3145
|
const ret = !getObject(arg0);
|
3145
3146
|
return ret;
|
@@ -3262,54 +3263,18 @@ function __wbg_get_imports() {
|
|
3262
3263
|
return addHeapObject(ret);
|
3263
3264
|
}, arguments);
|
3264
3265
|
};
|
3265
|
-
imports.wbg.__wbg_openCursor_5d4f2d7a9e60117c = function () {
|
3266
|
-
return handleError(function (arg0) {
|
3267
|
-
const ret = getObject(arg0).openCursor();
|
3268
|
-
return addHeapObject(ret);
|
3269
|
-
}, arguments);
|
3270
|
-
};
|
3271
|
-
imports.wbg.__wbg_openCursor_88c75b521e6a6818 = function () {
|
3272
|
-
return handleError(function (arg0, arg1, arg2) {
|
3273
|
-
const ret = getObject(arg0).openCursor(getObject(arg1), takeObject(arg2));
|
3274
|
-
return addHeapObject(ret);
|
3275
|
-
}, arguments);
|
3276
|
-
};
|
3277
|
-
imports.wbg.__wbg_get_a9b507527c0f6958 = function () {
|
3278
|
-
return handleError(function (arg0, arg1) {
|
3279
|
-
const ret = getObject(arg0).get(getObject(arg1));
|
3280
|
-
return addHeapObject(ret);
|
3281
|
-
}, arguments);
|
3282
|
-
};
|
3283
|
-
imports.wbg.__wbg_openCursor_2da32f6b7767a8f6 = function () {
|
3284
|
-
return handleError(function (arg0) {
|
3285
|
-
const ret = getObject(arg0).openCursor();
|
3286
|
-
return addHeapObject(ret);
|
3287
|
-
}, arguments);
|
3288
|
-
};
|
3289
|
-
imports.wbg.__wbg_openCursor_63250aa904924858 = function () {
|
3290
|
-
return handleError(function (arg0, arg1) {
|
3291
|
-
const ret = getObject(arg0).openCursor(getObject(arg1));
|
3292
|
-
return addHeapObject(ret);
|
3293
|
-
}, arguments);
|
3294
|
-
};
|
3295
3266
|
imports.wbg.__wbg_openCursor_4a2cac5b1c5cf36b = function () {
|
3296
3267
|
return handleError(function (arg0, arg1, arg2) {
|
3297
3268
|
const ret = getObject(arg0).openCursor(getObject(arg1), takeObject(arg2));
|
3298
3269
|
return addHeapObject(ret);
|
3299
3270
|
}, arguments);
|
3300
3271
|
};
|
3301
|
-
imports.wbg.
|
3302
|
-
|
3303
|
-
const ret = getObject(arg0).objectStore(getStringFromWasm0(arg1, arg2));
|
3304
|
-
return addHeapObject(ret);
|
3305
|
-
}, arguments);
|
3306
|
-
};
|
3307
|
-
imports.wbg.__wbindgen_closure_wrapper1651 = function (arg0, arg1, arg2) {
|
3308
|
-
const ret = makeMutClosure(arg0, arg1, 160, __wbg_adapter_52);
|
3272
|
+
imports.wbg.__wbindgen_closure_wrapper1903 = function (arg0, arg1, arg2) {
|
3273
|
+
const ret = makeMutClosure(arg0, arg1, 158, __wbg_adapter_52);
|
3309
3274
|
return addHeapObject(ret);
|
3310
3275
|
};
|
3311
|
-
imports.wbg.
|
3312
|
-
const ret = makeMutClosure(arg0, arg1,
|
3276
|
+
imports.wbg.__wbindgen_closure_wrapper4483 = function (arg0, arg1, arg2) {
|
3277
|
+
const ret = makeMutClosure(arg0, arg1, 158, __wbg_adapter_55);
|
3313
3278
|
return addHeapObject(ret);
|
3314
3279
|
};
|
3315
3280
|
return imports;
|
@@ -3360,13 +3325,13 @@ var exports = /*#__PURE__*/Object.freeze({
|
|
3360
3325
|
CustomConfiguration: CustomConfiguration,
|
3361
3326
|
DecryptedMessage: DecryptedMessage,
|
3362
3327
|
FfiWireE2EIdentity: FfiWireE2EIdentity,
|
3328
|
+
GroupInfoBundle: GroupInfoBundle,
|
3363
3329
|
Invitee: Invitee,
|
3364
3330
|
MemberAddedMessages: MemberAddedMessages,
|
3365
3331
|
NewAcmeAuthz: NewAcmeAuthz,
|
3366
3332
|
NewAcmeOrder: NewAcmeOrder,
|
3367
3333
|
ProposalBundle: ProposalBundle,
|
3368
3334
|
ProteusAutoPrekeyBundle: ProteusAutoPrekeyBundle,
|
3369
|
-
PublicGroupStateBundle: PublicGroupStateBundle,
|
3370
3335
|
WireIdentity: WireIdentity,
|
3371
3336
|
WirePolicy: WirePolicy$1,
|
3372
3337
|
default: __wbg_init,
|
@@ -3376,7 +3341,7 @@ var exports = /*#__PURE__*/Object.freeze({
|
|
3376
3341
|
var wasm = async (opt = {}) => {
|
3377
3342
|
let {importHook, serverPath} = opt;
|
3378
3343
|
|
3379
|
-
let path = "assets/core_crypto_ffi-
|
3344
|
+
let path = "assets/core_crypto_ffi-0b935801.wasm";
|
3380
3345
|
|
3381
3346
|
if (serverPath != null) {
|
3382
3347
|
path = serverPath + /[^\/\\]*$/.exec(path)[0];
|
@@ -3511,28 +3476,28 @@ var WirePolicy;
|
|
3511
3476
|
WirePolicy[WirePolicy["Ciphertext"] = 2] = "Ciphertext";
|
3512
3477
|
})(WirePolicy || (WirePolicy = {}));
|
3513
3478
|
/**
|
3514
|
-
* Informs whether the
|
3515
|
-
* see [core_crypto::mls::conversation::
|
3479
|
+
* Informs whether the GroupInfo is confidential
|
3480
|
+
* see [core_crypto::mls::conversation::group_info::GroupInfoEncryptionType]
|
3516
3481
|
*/
|
3517
|
-
var
|
3518
|
-
(function (
|
3482
|
+
var GroupInfoEncryptionType;
|
3483
|
+
(function (GroupInfoEncryptionType) {
|
3519
3484
|
/**
|
3520
3485
|
* Unencrypted
|
3521
3486
|
*/
|
3522
|
-
|
3487
|
+
GroupInfoEncryptionType[GroupInfoEncryptionType["Plaintext"] = 1] = "Plaintext";
|
3523
3488
|
/**
|
3524
3489
|
* Encrypted in a JWE (not yet implemented)
|
3525
3490
|
*/
|
3526
|
-
|
3527
|
-
})(
|
3491
|
+
GroupInfoEncryptionType[GroupInfoEncryptionType["JweEncrypted"] = 2] = "JweEncrypted";
|
3492
|
+
})(GroupInfoEncryptionType || (GroupInfoEncryptionType = {}));
|
3528
3493
|
/**
|
3529
3494
|
* Represents different ways of carrying the Ratchet Tree with some optimizations to save some space
|
3530
|
-
* see [core_crypto::mls::conversation::
|
3495
|
+
* see [core_crypto::mls::conversation::group_info::RatchetTreeType]
|
3531
3496
|
*/
|
3532
3497
|
var RatchetTreeType;
|
3533
3498
|
(function (RatchetTreeType) {
|
3534
3499
|
/**
|
3535
|
-
* Complete
|
3500
|
+
* Complete GroupInfo
|
3536
3501
|
*/
|
3537
3502
|
RatchetTreeType[RatchetTreeType["Full"] = 1] = "Full";
|
3538
3503
|
/**
|
@@ -3571,10 +3536,6 @@ var ExternalProposalType;
|
|
3571
3536
|
* This allows to propose the addition of other clients to the MLS group/conversation
|
3572
3537
|
*/
|
3573
3538
|
ExternalProposalType[ExternalProposalType["Add"] = 0] = "Add";
|
3574
|
-
/**
|
3575
|
-
* This allows to propose the removal of clients from the MLS group/conversation
|
3576
|
-
*/
|
3577
|
-
ExternalProposalType[ExternalProposalType["Remove"] = 1] = "Remove";
|
3578
3539
|
})(ExternalProposalType || (ExternalProposalType = {}));
|
3579
3540
|
/**
|
3580
3541
|
* Wrapper for the WASM-compiled version of CoreCrypto
|
@@ -3895,14 +3856,14 @@ class CoreCrypto {
|
|
3895
3856
|
const ffiClients = clients.map((invitee) => new (__classPrivateFieldGet(CoreCrypto, _a, "f", _CoreCrypto_module).Invitee)(invitee.id, invitee.kp));
|
3896
3857
|
const ffiRet = await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").add_clients_to_conversation(conversationId, ffiClients));
|
3897
3858
|
ffiClients.forEach(c => c.free());
|
3898
|
-
const
|
3859
|
+
const gi = ffiRet.group_info;
|
3899
3860
|
const ret = {
|
3900
3861
|
welcome: ffiRet.welcome,
|
3901
3862
|
commit: ffiRet.commit,
|
3902
|
-
|
3903
|
-
encryptionType:
|
3904
|
-
ratchetTreeType:
|
3905
|
-
payload:
|
3863
|
+
groupInfo: {
|
3864
|
+
encryptionType: gi.encryption_type,
|
3865
|
+
ratchetTreeType: gi.ratchet_tree_type,
|
3866
|
+
payload: gi.payload
|
3906
3867
|
},
|
3907
3868
|
};
|
3908
3869
|
return ret;
|
@@ -3927,14 +3888,14 @@ class CoreCrypto {
|
|
3927
3888
|
async removeClientsFromConversation(conversationId, clientIds) {
|
3928
3889
|
try {
|
3929
3890
|
const ffiRet = await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").remove_clients_from_conversation(conversationId, clientIds));
|
3930
|
-
const
|
3891
|
+
const gi = ffiRet.group_info;
|
3931
3892
|
const ret = {
|
3932
3893
|
welcome: ffiRet.welcome,
|
3933
3894
|
commit: ffiRet.commit,
|
3934
|
-
|
3935
|
-
encryptionType:
|
3936
|
-
ratchetTreeType:
|
3937
|
-
payload:
|
3895
|
+
groupInfo: {
|
3896
|
+
encryptionType: gi.encryption_type,
|
3897
|
+
ratchetTreeType: gi.ratchet_tree_type,
|
3898
|
+
payload: gi.payload
|
3938
3899
|
},
|
3939
3900
|
};
|
3940
3901
|
return ret;
|
@@ -3957,14 +3918,14 @@ class CoreCrypto {
|
|
3957
3918
|
async updateKeyingMaterial(conversationId) {
|
3958
3919
|
try {
|
3959
3920
|
const ffiRet = await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").update_keying_material(conversationId));
|
3960
|
-
const
|
3921
|
+
const gi = ffiRet.group_info;
|
3961
3922
|
const ret = {
|
3962
3923
|
welcome: ffiRet.welcome,
|
3963
3924
|
commit: ffiRet.commit,
|
3964
|
-
|
3965
|
-
encryptionType:
|
3966
|
-
ratchetTreeType:
|
3967
|
-
payload:
|
3925
|
+
groupInfo: {
|
3926
|
+
encryptionType: gi.encryption_type,
|
3927
|
+
ratchetTreeType: gi.ratchet_tree_type,
|
3928
|
+
payload: gi.payload
|
3968
3929
|
},
|
3969
3930
|
};
|
3970
3931
|
return ret;
|
@@ -3990,14 +3951,14 @@ class CoreCrypto {
|
|
3990
3951
|
if (!ffiCommitBundle) {
|
3991
3952
|
return undefined;
|
3992
3953
|
}
|
3993
|
-
const
|
3954
|
+
const gi = ffiCommitBundle.group_info;
|
3994
3955
|
return {
|
3995
3956
|
welcome: ffiCommitBundle.welcome,
|
3996
3957
|
commit: ffiCommitBundle.commit,
|
3997
|
-
|
3998
|
-
encryptionType:
|
3999
|
-
ratchetTreeType:
|
4000
|
-
payload:
|
3958
|
+
groupInfo: {
|
3959
|
+
encryptionType: gi.encryption_type,
|
3960
|
+
ratchetTreeType: gi.ratchet_tree_type,
|
3961
|
+
payload: gi.payload
|
4001
3962
|
},
|
4002
3963
|
};
|
4003
3964
|
}
|
@@ -4040,27 +4001,21 @@ class CoreCrypto {
|
|
4040
4001
|
let addArgs = args;
|
4041
4002
|
return await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").new_external_add_proposal(args.conversationId, args.epoch, addArgs.ciphersuite, addArgs.credentialType));
|
4042
4003
|
}
|
4043
|
-
case ExternalProposalType.Remove: {
|
4044
|
-
if (!args.keyPackageRef) {
|
4045
|
-
throw new Error("keyPackageRef is not contained in the external proposal arguments");
|
4046
|
-
}
|
4047
|
-
return await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").new_external_remove_proposal(args.conversationId, args.epoch, args.keyPackageRef));
|
4048
|
-
}
|
4049
4004
|
default:
|
4050
4005
|
throw new Error("Invalid external proposal type!");
|
4051
4006
|
}
|
4052
4007
|
}
|
4053
4008
|
/**
|
4054
|
-
* Exports
|
4009
|
+
* Exports GroupInfo for use in external commits
|
4055
4010
|
*
|
4056
4011
|
* @param conversationId - MLS Conversation ID
|
4057
|
-
* @returns TLS-serialized MLS
|
4012
|
+
* @returns TLS-serialized MLS GroupInfo
|
4058
4013
|
*/
|
4059
|
-
async
|
4060
|
-
return await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").
|
4014
|
+
async exportGroupInfo(conversationId) {
|
4015
|
+
return await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").export_group_info(conversationId));
|
4061
4016
|
}
|
4062
4017
|
/**
|
4063
|
-
* Allows to create an external commit to "apply" to join a group through its
|
4018
|
+
* Allows to create an external commit to "apply" to join a group through its GroupInfo.
|
4064
4019
|
*
|
4065
4020
|
* If the Delivery Service accepts the external commit, you have to {@link CoreCrypto.mergePendingGroupFromExternalCommit}
|
4066
4021
|
* in order to get back a functional MLS group. On the opposite, if it rejects it, you can either retry by just
|
@@ -4069,26 +4024,26 @@ class CoreCrypto {
|
|
4069
4024
|
* {@link CoreCrypto.clearPendingGroupFromExternalCommit} in order not to bloat the user's storage but nothing
|
4070
4025
|
* bad can happen if you forget to except some storage space wasted.
|
4071
4026
|
*
|
4072
|
-
* @param
|
4027
|
+
* @param groupInfo - a TLS encoded GroupInfo fetched from the Delivery Service
|
4073
4028
|
* @param credentialType - kind of Credential to use for joining this group. If {@link CredentialType.Basic} is
|
4074
4029
|
* chosen and no Credential has been created yet for it, a new one will be generated.
|
4075
4030
|
* @param configuration - configuration of the MLS group
|
4076
4031
|
* When {@link CredentialType.X509} is chosen, it fails when no Credential has been created for the given {@link Ciphersuite}.
|
4077
4032
|
* @returns see {@link ConversationInitBundle}
|
4078
4033
|
*/
|
4079
|
-
async joinByExternalCommit(
|
4034
|
+
async joinByExternalCommit(groupInfo, credentialType, configuration = {}) {
|
4080
4035
|
try {
|
4081
4036
|
const { keyRotationSpan, wirePolicy } = configuration || {};
|
4082
4037
|
const config = new (__classPrivateFieldGet(CoreCrypto, _a, "f", _CoreCrypto_module).CustomConfiguration)(keyRotationSpan, wirePolicy);
|
4083
|
-
const ffiInitMessage = await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").join_by_external_commit(
|
4084
|
-
const
|
4038
|
+
const ffiInitMessage = await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").join_by_external_commit(groupInfo, config, credentialType));
|
4039
|
+
const gi = ffiInitMessage.group_info;
|
4085
4040
|
const ret = {
|
4086
4041
|
conversationId: ffiInitMessage.conversation_id,
|
4087
4042
|
commit: ffiInitMessage.commit,
|
4088
|
-
|
4089
|
-
encryptionType:
|
4090
|
-
ratchetTreeType:
|
4091
|
-
payload:
|
4043
|
+
groupInfo: {
|
4044
|
+
encryptionType: gi.encryption_type,
|
4045
|
+
ratchetTreeType: gi.ratchet_tree_type,
|
4046
|
+
payload: gi.payload
|
4092
4047
|
},
|
4093
4048
|
};
|
4094
4049
|
return ret;
|
@@ -4626,7 +4581,6 @@ class WireE2eIdentity {
|
|
4626
4581
|
* Verifies that the previous challenge has been completed.
|
4627
4582
|
*
|
4628
4583
|
* @param orderUrl `location` header from http response you got from {@link newOrderResponse}
|
4629
|
-
* @param account you found after {@link newAccountResponse}
|
4630
4584
|
* @param previousNonce `replay-nonce` response header from `POST /acme/{provisioner-name}/challenge/{challenge-id}`
|
4631
4585
|
* @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.4
|
4632
4586
|
*/
|
@@ -4656,7 +4610,6 @@ class WireE2eIdentity {
|
|
4656
4610
|
/**
|
4657
4611
|
* Final step before fetching the certificate.
|
4658
4612
|
*
|
4659
|
-
* @param order - order you got from {@link checkOrderResponse}
|
4660
4613
|
* @param previousNonce - `replay-nonce` response header from `POST /acme/{provisioner-name}/order/{order-id}`
|
4661
4614
|
* @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.4
|
4662
4615
|
*/
|
@@ -4700,4 +4653,4 @@ class WireE2eIdentity {
|
|
4700
4653
|
}
|
4701
4654
|
_WireE2eIdentity_e2ei = new WeakMap();
|
4702
4655
|
|
4703
|
-
export { Ciphersuite, CoreCrypto, CoreCryptoError, CredentialType, ExternalProposalType,
|
4656
|
+
export { Ciphersuite, CoreCrypto, CoreCryptoError, CredentialType, ExternalProposalType, GroupInfoEncryptionType, ProposalType, RatchetTreeType, WireE2eIdentity, WirePolicy };
|
Binary file
|