@wireapp/core 44.0.5 → 44.0.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/lib/Account.d.ts.map +1 -1
- package/lib/Account.js +2 -1
- package/lib/messagingProtocols/mls/E2EIdentityService/Connection/AcmeServer/AcmeService.d.ts +3 -3
- package/lib/messagingProtocols/mls/E2EIdentityService/Connection/AcmeServer/schema.d.ts +8 -8
- package/lib/messagingProtocols/mls/E2EIdentityService/E2EIService.types.d.ts +0 -24
- package/lib/messagingProtocols/mls/E2EIdentityService/E2EIService.types.d.ts.map +1 -1
- package/lib/messagingProtocols/mls/E2EIdentityService/E2EIService.types.js +1 -2
- package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceExternal.d.ts +2 -5
- package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceExternal.d.ts.map +1 -1
- package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceExternal.js +9 -14
- package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceExternal.test.js +2 -2
- package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceInternal.d.ts +8 -26
- package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceInternal.d.ts.map +1 -1
- package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceInternal.js +25 -92
- package/lib/messagingProtocols/mls/EventHandler/events/messageAdd/messageAdd.test.js +1 -3
- 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 +7 -20
- package/lib/messagingProtocols/mls/MLSService/MLSService.test.js +3 -3
- package/lib/messagingProtocols/proteus/ProteusService/CryptoClient/CoreCryptoWrapper/CoreCryptoWrapper.d.ts +1 -0
- 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/lib/messagingProtocols/proteus/ProteusService/CryptoClient/CryptoClient.types.d.ts +1 -0
- package/lib/messagingProtocols/proteus/ProteusService/CryptoClient/CryptoClient.types.d.ts.map +1 -1
- package/lib/messagingProtocols/proteus/ProteusService/CryptoClient/CryptoboxWrapper.d.ts +1 -0
- package/lib/messagingProtocols/proteus/ProteusService/CryptoClient/CryptoboxWrapper.d.ts.map +1 -1
- package/lib/messagingProtocols/proteus/ProteusService/CryptoClient/CryptoboxWrapper.js +1 -0
- package/package.json +3 -3
package/lib/Account.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Account.d.ts","sourceRoot":"","sources":["../src/Account.ts"],"names":[],"mappings":"AAmBA,OAAO,EACL,YAAY,EAGZ,OAAO,EACP,MAAM,EAEN,SAAS,EAEV,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAuB,UAAU,EAAE,gBAAgB,EAAC,MAAM,iCAAiC,CAAC;AAEnG,OAAO,KAAK,MAAM,MAAM,+BAA+B,CAAC;AASxD,OAAO,EAAC,SAAS,EAAE,eAAe,EAAC,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAC,iBAAiB,EAAC,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAC,UAAU,EAAe,MAAM,uBAAuB,CAAC;AAE/D,OAAO,EAAC,cAAc,EAAC,MAAM,YAAY,CAAC;AAE1C,OAAO,EAAC,gBAAgB,EAAC,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAC,UAAU,EAAE,aAAa,EAAC,MAAM,WAAW,CAAC;AACpD,OAAO,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAChD,OAAO,EAAC,YAAY,EAAE,mBAAmB,EAAC,MAAM,iBAAiB,CAAC;AAElE,OAAO,EAAC,sBAAsB,EAAC,MAAM,8DAA8D,CAAC;AACpG,OAAO,EAAC,YAAY,EAAC,MA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,MAAM,EAAE,gBAAgB,EAAE,cAAc,GAAE,OAAe;YA2BnE,iBAAiB;IA2B/B;;;;;;OAMG;IACH,sBAAsB,CAAC,aAAa,EAAE,aAAa;IAItC,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAoF1D,OAAO,CAAC,YAAY;IAMpB;;;OAGG;IACU,MAAM,CAAC,SAAS,GAAE,OAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IAU9D;;OAEG;YACW,IAAI;IAQlB;;;;;;OAMG;IACI,MAAM,CAAC,EACZ,OAAkB,EAClB,wBAAmC,EACnC,4BAAuC,EACvC,qBAAgC,EAChC,MAAc,GACf,GAAE;QACD;;;;WAIG;QACH,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,mBAAmB,EAAE,MAAM,EAAE,kBAAkB,KAAK,IAAI,CAAC;QAE7E;;WAEG;QACH,4BAA4B,CAAC,EAAE,CAAC,EAAC,IAAI,EAAE,KAAK,EAAC,EAAE;YAAC,IAAI,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAC,KAAK,IAAI,CAAC;QAEtF;;WAEG;QACH,wBAAwB,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;QAE5D;;;;;;WAMG;QACH,qBAAqB,CAAC,EAAE,CAAC,cAAc,EAAE,MAAM,KAAK,IAAI,CAAC;QAEzD;;WAEG;QACH,MAAM,CAAC,EAAE,OAAO,CAAC;KACb,GAAG,MAAM,IAAI;IAgGnB,OAAO,CAAC,cAAc;IAKtB,OAAO,CAAC,kBAAkB;IAI1B,OAAO,CAAC,uBAAuB;YAIjB,UAAU;IAuBxB,OAAO,CAAC,yBAAyB,CAS/B;CACH"}
|
package/lib/Account.js
CHANGED
|
@@ -196,7 +196,7 @@ class Account extends commons_1.TypedEventEmitter {
|
|
|
196
196
|
teamId,
|
|
197
197
|
id: this.userId,
|
|
198
198
|
};
|
|
199
|
-
return this.service.mls.enrollE2EI(discoveryUrl,
|
|
199
|
+
return this.service.mls.enrollE2EI(discoveryUrl, user, this.currentClient, this.options.nbPrekeys, certificateTtl, oAuthIdToken);
|
|
200
200
|
}
|
|
201
201
|
get clientId() {
|
|
202
202
|
return this.apiClient.validatedClientId;
|
|
@@ -326,6 +326,7 @@ class Account extends commons_1.TypedEventEmitter {
|
|
|
326
326
|
const accountService = new account_1.AccountService(this.apiClient);
|
|
327
327
|
const assetService = new conversation_1.AssetService(this.apiClient);
|
|
328
328
|
const [clientType, cryptoClient] = await this.buildCryptoClient(context, this.storeEngine, this.encryptedDb);
|
|
329
|
+
this.logger.info(`CryptoClient of type ${clientType} created (version ${cryptoClient.version})`);
|
|
329
330
|
let mlsService;
|
|
330
331
|
let e2eServiceExternal;
|
|
331
332
|
const proteusService = new proteus_1.ProteusService(this.apiClient, cryptoClient, {
|
package/lib/messagingProtocols/mls/E2EIdentityService/Connection/AcmeServer/AcmeService.d.ts
CHANGED
|
@@ -27,13 +27,13 @@ export declare class AcmeService {
|
|
|
27
27
|
createNewOrder(url: AcmeDirectory['newOrder'], payload: Uint8Array): Promise<PostJoseRequestReturnValue<{
|
|
28
28
|
status: string;
|
|
29
29
|
expires: string;
|
|
30
|
+
authorizations: string[];
|
|
30
31
|
notBefore: string;
|
|
31
32
|
notAfter: string;
|
|
32
33
|
identifiers: {
|
|
33
34
|
type: string;
|
|
34
35
|
value: string;
|
|
35
36
|
}[];
|
|
36
|
-
authorizations: string[];
|
|
37
37
|
finalize: string;
|
|
38
38
|
}>>;
|
|
39
39
|
getAuthorization(url: string, payload: Uint8Array): Promise<PostJoseRequestReturnValue<{
|
|
@@ -74,13 +74,13 @@ export declare class AcmeService {
|
|
|
74
74
|
id: string;
|
|
75
75
|
status: string;
|
|
76
76
|
expires: string;
|
|
77
|
+
authorizations: string[];
|
|
77
78
|
notBefore: string;
|
|
78
79
|
notAfter: string;
|
|
79
80
|
identifiers: {
|
|
80
81
|
type: string;
|
|
81
82
|
value: string;
|
|
82
83
|
}[];
|
|
83
|
-
authorizations: string[];
|
|
84
84
|
finalize: string;
|
|
85
85
|
}>>;
|
|
86
86
|
finalizeOrder(url: string, payload: Uint8Array): Promise<PostJoseRequestReturnValue<{
|
|
@@ -88,13 +88,13 @@ export declare class AcmeService {
|
|
|
88
88
|
certificate: string;
|
|
89
89
|
status: string;
|
|
90
90
|
expires: string;
|
|
91
|
+
authorizations: string[];
|
|
91
92
|
notBefore: string;
|
|
92
93
|
notAfter: string;
|
|
93
94
|
identifiers: {
|
|
94
95
|
type: string;
|
|
95
96
|
value: string;
|
|
96
97
|
}[];
|
|
97
|
-
authorizations: string[];
|
|
98
98
|
finalize: string;
|
|
99
99
|
}>>;
|
|
100
100
|
getCertificate(url: string, payload: Uint8Array): Promise<PostJoseRequestReturnValue<string>>;
|
|
@@ -22,14 +22,14 @@ export declare const DirectoryResponseSchema: z.ZodObject<{
|
|
|
22
22
|
revokeCert: z.ZodString;
|
|
23
23
|
keyChange: z.ZodString;
|
|
24
24
|
}, "strip", z.ZodTypeAny, {
|
|
25
|
-
newAccount: string;
|
|
26
25
|
newNonce: string;
|
|
26
|
+
newAccount: string;
|
|
27
27
|
newOrder: string;
|
|
28
28
|
revokeCert: string;
|
|
29
29
|
keyChange: string;
|
|
30
30
|
}, {
|
|
31
|
-
newAccount: string;
|
|
32
31
|
newNonce: string;
|
|
32
|
+
newAccount: string;
|
|
33
33
|
newOrder: string;
|
|
34
34
|
revokeCert: string;
|
|
35
35
|
keyChange: string;
|
|
@@ -81,24 +81,24 @@ export declare const NewOrderResponseSchema: z.ZodObject<{
|
|
|
81
81
|
}, "strip", z.ZodTypeAny, {
|
|
82
82
|
status: string;
|
|
83
83
|
expires: string;
|
|
84
|
+
authorizations: string[];
|
|
84
85
|
notBefore: string;
|
|
85
86
|
notAfter: string;
|
|
86
87
|
identifiers: {
|
|
87
88
|
type: string;
|
|
88
89
|
value: string;
|
|
89
90
|
}[];
|
|
90
|
-
authorizations: string[];
|
|
91
91
|
finalize: string;
|
|
92
92
|
}, {
|
|
93
93
|
status: string;
|
|
94
94
|
expires: string;
|
|
95
|
+
authorizations: string[];
|
|
95
96
|
notBefore: string;
|
|
96
97
|
notAfter: string;
|
|
97
98
|
identifiers: {
|
|
98
99
|
type: string;
|
|
99
100
|
value: string;
|
|
100
101
|
}[];
|
|
101
|
-
authorizations: string[];
|
|
102
102
|
finalize: string;
|
|
103
103
|
}>;
|
|
104
104
|
export type NewOrderResponseData = z.infer<typeof NewOrderResponseSchema>;
|
|
@@ -247,25 +247,25 @@ export declare const CheckStatusOfOrderResponseSchema: z.ZodObject<{
|
|
|
247
247
|
id: string;
|
|
248
248
|
status: string;
|
|
249
249
|
expires: string;
|
|
250
|
+
authorizations: string[];
|
|
250
251
|
notBefore: string;
|
|
251
252
|
notAfter: string;
|
|
252
253
|
identifiers: {
|
|
253
254
|
type: string;
|
|
254
255
|
value: string;
|
|
255
256
|
}[];
|
|
256
|
-
authorizations: string[];
|
|
257
257
|
finalize: string;
|
|
258
258
|
}, {
|
|
259
259
|
id: string;
|
|
260
260
|
status: string;
|
|
261
261
|
expires: string;
|
|
262
|
+
authorizations: string[];
|
|
262
263
|
notBefore: string;
|
|
263
264
|
notAfter: string;
|
|
264
265
|
identifiers: {
|
|
265
266
|
type: string;
|
|
266
267
|
value: string;
|
|
267
268
|
}[];
|
|
268
|
-
authorizations: string[];
|
|
269
269
|
finalize: string;
|
|
270
270
|
}>;
|
|
271
271
|
export type CheckStatusOfOrderResponseData = z.infer<typeof CheckStatusOfOrderResponseSchema>;
|
|
@@ -293,26 +293,26 @@ export declare const FinalizeOrderResponseSchema: z.ZodObject<{
|
|
|
293
293
|
certificate: string;
|
|
294
294
|
status: string;
|
|
295
295
|
expires: string;
|
|
296
|
+
authorizations: string[];
|
|
296
297
|
notBefore: string;
|
|
297
298
|
notAfter: string;
|
|
298
299
|
identifiers: {
|
|
299
300
|
type: string;
|
|
300
301
|
value: string;
|
|
301
302
|
}[];
|
|
302
|
-
authorizations: string[];
|
|
303
303
|
finalize: string;
|
|
304
304
|
}, {
|
|
305
305
|
id: string;
|
|
306
306
|
certificate: string;
|
|
307
307
|
status: string;
|
|
308
308
|
expires: string;
|
|
309
|
+
authorizations: string[];
|
|
309
310
|
notBefore: string;
|
|
310
311
|
notAfter: string;
|
|
311
312
|
identifiers: {
|
|
312
313
|
type: string;
|
|
313
314
|
value: string;
|
|
314
315
|
}[];
|
|
315
|
-
authorizations: string[];
|
|
316
316
|
finalize: string;
|
|
317
317
|
}>;
|
|
318
318
|
export type FinalizeOrderResponseData = z.infer<typeof FinalizeOrderResponseSchema>;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import { APIClient } from '@wireapp/api-client';
|
|
2
1
|
import { E2eiEnrollment, Ciphersuite, CoreCrypto, RotateBundle, WireIdentity, E2eiConversationState, CredentialType } from '@wireapp/core-crypto';
|
|
3
|
-
import { E2EIServiceExternal } from './E2EIServiceExternal';
|
|
4
|
-
import { NewCrlDistributionPointsPayload } from '../MLSService/MLSService.types';
|
|
5
2
|
/**
|
|
6
3
|
* Proxy types relevant to the E2EIService from CoreCrypto
|
|
7
4
|
*/
|
|
@@ -22,25 +19,4 @@ export type User = {
|
|
|
22
19
|
export type Account = Uint8Array;
|
|
23
20
|
export type Nonce = string;
|
|
24
21
|
export type KeyAuth = NewAcmeAuthzOriginal['keyauth'];
|
|
25
|
-
export interface FinishOidcChallengeParams {
|
|
26
|
-
oidcChallenge: AcmeChallenge;
|
|
27
|
-
nonce: Nonce;
|
|
28
|
-
account: Account;
|
|
29
|
-
}
|
|
30
|
-
export interface GetNewCertificateParams {
|
|
31
|
-
discoveryUrl: string;
|
|
32
|
-
}
|
|
33
|
-
export interface InitParams {
|
|
34
|
-
apiClient: APIClient;
|
|
35
|
-
coreCryptClient: CoreCrypto;
|
|
36
|
-
e2eiServiceExternal: E2EIServiceExternal;
|
|
37
|
-
user?: User;
|
|
38
|
-
clientId?: string;
|
|
39
|
-
skipInit?: boolean;
|
|
40
|
-
/** number of seconds the certificate should be valid */
|
|
41
|
-
certificateTtl: number;
|
|
42
|
-
discoveryUrl?: string;
|
|
43
|
-
keyPackagesAmount: number;
|
|
44
|
-
dispatchNewCrlDistributionPoints: (payload: NewCrlDistributionPointsPayload) => void;
|
|
45
|
-
}
|
|
46
22
|
//# sourceMappingURL=E2EIService.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"E2EIService.types.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/mls/E2EIdentityService/E2EIService.types.ts"],"names":[],"mappings":"AAmBA,OAAO,
|
|
1
|
+
{"version":3,"file":"E2EIService.types.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/mls/E2EIdentityService/E2EIService.types.ts"],"names":[],"mappings":"AAmBA,OAAO,EACL,cAAc,EACd,WAAW,EACX,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,qBAAqB,EACrB,cAAc,EACf,MAAM,sBAAsB,CAAC;AAE9B;;GAEG;AACH,KAAK,QAAQ,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;AACnC,KAAK,oBAAoB,GAAG,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC;AAC9F,MAAM,MAAM,aAAa,GAAG,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC;AAC/F,MAAM,MAAM,aAAa,GAAG,QAAQ,CAAC,WAAW,CAAC,oBAAoB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;AACrF,MAAM,MAAM,YAAY,GAAG,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC;AAC7F,MAAM,MAAM,YAAY,GAAG,IAAI,CAC7B,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,kBAAkB,CAAC,CAAC,CAAC,EACvD,YAAY,GAAG,SAAS,GAAG,WAAW,CACvC,CAAC;AACF,OAAO,EAAC,cAAc,EAAE,WAAW,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,qBAAqB,EAAE,cAAc,EAAC,CAAC;AAEpH,MAAM,MAAM,IAAI,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AACF,MAAM,MAAM,OAAO,GAAG,UAAU,CAAC;AACjC,MAAM,MAAM,KAAK,GAAG,MAAM,CAAC;AAC3B,MAAM,MAAM,OAAO,GAAG,oBAAoB,CAAC,SAAS,CAAC,CAAC"}
|
|
@@ -18,11 +18,10 @@
|
|
|
18
18
|
*
|
|
19
19
|
*/
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.CredentialType = exports.E2eiConversationState = exports.
|
|
21
|
+
exports.CredentialType = exports.E2eiConversationState = exports.CoreCrypto = exports.Ciphersuite = exports.E2eiEnrollment = void 0;
|
|
22
22
|
const core_crypto_1 = require("@wireapp/core-crypto");
|
|
23
23
|
Object.defineProperty(exports, "E2eiEnrollment", { enumerable: true, get: function () { return core_crypto_1.E2eiEnrollment; } });
|
|
24
24
|
Object.defineProperty(exports, "Ciphersuite", { enumerable: true, get: function () { return core_crypto_1.Ciphersuite; } });
|
|
25
25
|
Object.defineProperty(exports, "CoreCrypto", { enumerable: true, get: function () { return core_crypto_1.CoreCrypto; } });
|
|
26
|
-
Object.defineProperty(exports, "WireIdentity", { enumerable: true, get: function () { return core_crypto_1.WireIdentity; } });
|
|
27
26
|
Object.defineProperty(exports, "E2eiConversationState", { enumerable: true, get: function () { return core_crypto_1.E2eiConversationState; } });
|
|
28
27
|
Object.defineProperty(exports, "CredentialType", { enumerable: true, get: function () { return core_crypto_1.CredentialType; } });
|
|
@@ -45,19 +45,16 @@ export declare class E2EIServiceExternal extends TypedEventEmitter<Events> {
|
|
|
45
45
|
* - It must be updated every 24 hours.
|
|
46
46
|
*
|
|
47
47
|
* Both must be registered before the first enrollment.
|
|
48
|
-
*
|
|
49
|
-
* @param discoveryUrl
|
|
50
48
|
*/
|
|
51
49
|
registerServerCertificates(): Promise<void>;
|
|
52
|
-
getCRLFromDistributionPoint(distributionPointUrl: string): Promise<Uint8Array>;
|
|
53
50
|
private scheduleCrlDistributionTimer;
|
|
54
51
|
private initialiseCrlDistributionTimers;
|
|
55
52
|
private addCrlDistributionTimer;
|
|
56
53
|
private cancelCrlDistributionTimer;
|
|
57
54
|
validateSelfCrl(): Promise<void>;
|
|
58
|
-
private
|
|
55
|
+
private validateCrlDistributionPoint;
|
|
59
56
|
private validateCrl;
|
|
60
|
-
private
|
|
57
|
+
private handleNewCrlDistributionPoints;
|
|
61
58
|
}
|
|
62
59
|
export {};
|
|
63
60
|
//# sourceMappingURL=E2EIServiceExternal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"E2EIServiceExternal.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/mls/E2EIdentityService/E2EIServiceExternal.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAIzD,OAAO,EAAC,iBAAiB,EAAC,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAC,UAAU,EAAE,qBAAqB,EAAE,YAAY,EAAE,YAAY,EAAC,MAAM,sBAAsB,CAAC;AAMnG,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAC,YAAY,EAAC,MAAM,yBAAyB,CAAC;AAKrD,OAAO,EAAC,sBAAsB,EAAC,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAEzC,MAAM,MAAM,c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AAO,CAAC;YAQvC,4BAA4B;IAO7B,UAAU,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI5D,OAAO,KAAK,WAAW,GAKtB;YAEa,+BAA+B;IAK7C;;;;;;;;;;;;OAYG;IACU,0BAA0B,IAAI,OAAO,CAAC,IAAI,CAAC;IA6BxD,OAAO,CAAC,4BAA4B;YAStB,+BAA+B;YAQ/B,uBAAuB;YAKvB,0BAA0B;IAI3B,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;YAQ/B,4BAA4B;YAS5B,WAAW;YAkBX,8BAA8B;CAK7C"}
|
|
@@ -39,7 +39,7 @@ class E2EIServiceExternal extends commons_1.TypedEventEmitter {
|
|
|
39
39
|
this.clientService = clientService;
|
|
40
40
|
this.mlsService = mlsService;
|
|
41
41
|
void this.initialiseCrlDistributionTimers();
|
|
42
|
-
mlsService.on('newCrlDistributionPoints', this.
|
|
42
|
+
mlsService.on('newCrlDistributionPoints', distributionPoints => this.handleNewCrlDistributionPoints(distributionPoints));
|
|
43
43
|
}
|
|
44
44
|
// If we have a handle in the local storage, we are in the enrollment process (this handle is saved before oauth redirect)
|
|
45
45
|
isEnrollmentInProgress() {
|
|
@@ -75,13 +75,13 @@ class E2EIServiceExternal extends commons_1.TypedEventEmitter {
|
|
|
75
75
|
.map(fullyQualifiedId => (0, fullyQualifiedClientIdUtils_1.parseFullQualifiedClientId)(fullyQualifiedId));
|
|
76
76
|
const mappedUserIdentities = new Map();
|
|
77
77
|
for (const userId of userIds) {
|
|
78
|
-
const identities = (userIdentities.get(userId.id) || []).map(identity => (Object.assign(Object.assign({}, identity), { deviceId: (0, fullyQualifiedClientIdUtils_1.parseFullQualifiedClientId)(identity.
|
|
78
|
+
const identities = (userIdentities.get(userId.id) || []).map(identity => (Object.assign(Object.assign({}, identity), { deviceId: (0, fullyQualifiedClientIdUtils_1.parseFullQualifiedClientId)(identity.clientId).client })));
|
|
79
79
|
const basicMLSDevices = allUsersMLSDevices
|
|
80
80
|
.filter(({ user }) => user === userId.id)
|
|
81
81
|
// filtering devices that have a valid identity
|
|
82
82
|
.filter(({ client }) => !identities.map(identity => identity.deviceId).includes(client))
|
|
83
83
|
// map basic MLS devices to "fake" identity object
|
|
84
|
-
.map(id => (Object.assign(Object.assign({}, id), { deviceId: id.client, thumbprint: '', user: '', certificate: '', displayName: '', handle: '', clientId: id.client })));
|
|
84
|
+
.map(id => (Object.assign(Object.assign({}, id), { deviceId: id.client, thumbprint: '', user: '', certificate: '', displayName: '', handle: '', notAfter: BigInt(0), notBefore: BigInt(0), serialNumber: '', clientId: id.client })));
|
|
85
85
|
mappedUserIdentities.set(userId.id, [...identities, ...basicMLSDevices]);
|
|
86
86
|
}
|
|
87
87
|
return mappedUserIdentities;
|
|
@@ -90,7 +90,7 @@ class E2EIServiceExternal extends commons_1.TypedEventEmitter {
|
|
|
90
90
|
async getDevicesIdentities(groupId, userClientsMap) {
|
|
91
91
|
const clientIds = Object.entries(userClientsMap).map(([clientId, userId]) => (0, Helper_1.getE2EIClientId)(clientId, userId.id, userId.domain).asBytes);
|
|
92
92
|
const deviceIdentities = await this.coreCryptoClient.getDeviceIdentities(bazinga64_1.Decoder.fromBase64(groupId).asBytes, clientIds);
|
|
93
|
-
return deviceIdentities.map(identity => (Object.assign(Object.assign({}, identity), { deviceId: (0, fullyQualifiedClientIdUtils_1.parseFullQualifiedClientId)(identity.
|
|
93
|
+
return deviceIdentities.map(identity => (Object.assign(Object.assign({}, identity), { deviceId: (0, fullyQualifiedClientIdUtils_1.parseFullQualifiedClientId)(identity.clientId).client })));
|
|
94
94
|
}
|
|
95
95
|
async isFreshMLSSelfClient() {
|
|
96
96
|
const client = await this.clientService.loadClient();
|
|
@@ -129,8 +129,6 @@ class E2EIServiceExternal extends commons_1.TypedEventEmitter {
|
|
|
129
129
|
* - It must be updated every 24 hours.
|
|
130
130
|
*
|
|
131
131
|
* Both must be registered before the first enrollment.
|
|
132
|
-
*
|
|
133
|
-
* @param discoveryUrl
|
|
134
132
|
*/
|
|
135
133
|
async registerServerCertificates() {
|
|
136
134
|
const ROOT_CA_KEY = 'e2ei_root-registered';
|
|
@@ -154,15 +152,12 @@ class E2EIServiceExternal extends commons_1.TypedEventEmitter {
|
|
|
154
152
|
task,
|
|
155
153
|
});
|
|
156
154
|
}
|
|
157
|
-
async getCRLFromDistributionPoint(distributionPointUrl) {
|
|
158
|
-
return this.acmeService.getCRLFromDistributionPoint(distributionPointUrl);
|
|
159
|
-
}
|
|
160
155
|
scheduleCrlDistributionTimer({ expiresAt, url }) {
|
|
161
156
|
LowPrecisionTaskScheduler_1.LowPrecisionTaskScheduler.addTask({
|
|
162
157
|
intervalDelay: TimeUtil_1.TimeInMillis.SECOND,
|
|
163
158
|
firingDate: expiresAt,
|
|
164
159
|
key: url,
|
|
165
|
-
task: () => this.
|
|
160
|
+
task: () => this.validateCrlDistributionPoint(url),
|
|
166
161
|
});
|
|
167
162
|
}
|
|
168
163
|
async initialiseCrlDistributionTimers() {
|
|
@@ -184,9 +179,9 @@ class E2EIServiceExternal extends commons_1.TypedEventEmitter {
|
|
|
184
179
|
this.emit('selfCrlChanged');
|
|
185
180
|
});
|
|
186
181
|
}
|
|
187
|
-
async
|
|
182
|
+
async validateCrlDistributionPoint(distributionPointUrl) {
|
|
188
183
|
const domain = new URL(distributionPointUrl).hostname;
|
|
189
|
-
const crl = await this.getCRLFromDistributionPoint(domain);
|
|
184
|
+
const crl = await this.acmeService.getCRLFromDistributionPoint(domain);
|
|
190
185
|
await this.validateCrl(distributionPointUrl, crl, async () => {
|
|
191
186
|
this.emit('remoteCrlChanged');
|
|
192
187
|
});
|
|
@@ -204,9 +199,9 @@ class E2EIServiceExternal extends commons_1.TypedEventEmitter {
|
|
|
204
199
|
await onDirty();
|
|
205
200
|
}
|
|
206
201
|
}
|
|
207
|
-
async
|
|
202
|
+
async handleNewCrlDistributionPoints(distributionPoints) {
|
|
208
203
|
for (const distributionPointUrl of distributionPoints) {
|
|
209
|
-
await this.
|
|
204
|
+
await this.validateCrlDistributionPoint(distributionPointUrl);
|
|
210
205
|
}
|
|
211
206
|
}
|
|
212
207
|
}
|
|
@@ -47,7 +47,7 @@ async function buildE2EIService() {
|
|
|
47
47
|
}
|
|
48
48
|
function generateCoreCryptoIdentity({ userId, status = 'Valid', deviceId = (0, PayloadHelper_1.getUUID)(), }) {
|
|
49
49
|
return {
|
|
50
|
-
|
|
50
|
+
clientId: `${userId}:${deviceId}@elna.wire.link`,
|
|
51
51
|
handle: 'adrian_wire2@elna.wire.link',
|
|
52
52
|
display_name: 'Adrian Weiss 2',
|
|
53
53
|
domain: 'elna.wire.link',
|
|
@@ -84,7 +84,7 @@ describe('E2EIServiceExternal', () => {
|
|
|
84
84
|
const encoder = new TextEncoder();
|
|
85
85
|
coreCrypto.getUserIdentities.mockResolvedValue(new Map([[user1.id, user1Identities]]));
|
|
86
86
|
const allClients = [
|
|
87
|
-
...user1Identities.map(identity => identity.
|
|
87
|
+
...user1Identities.map(identity => identity.clientId),
|
|
88
88
|
`${user1.id}:74a50c1f4352b41f@elna.wire.link`,
|
|
89
89
|
`${user2.id}:452cb4c65f0369a8@elna.wire.link`,
|
|
90
90
|
];
|
|
@@ -1,22 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { APIClient } from '@wireapp/api-client';
|
|
2
|
+
import { CoreCrypto, RotateBundle } from './E2EIService.types';
|
|
3
3
|
import { InitialData } from './Storage/E2EIStorage.schema';
|
|
4
4
|
export declare class E2EIServiceInternal {
|
|
5
5
|
private readonly coreCryptoClient;
|
|
6
6
|
private readonly apiClient;
|
|
7
|
-
private readonly e2eiServiceExternal;
|
|
8
7
|
/** number of seconds the certificate should be valid */
|
|
9
8
|
private readonly certificateTtl;
|
|
10
9
|
private readonly keyPackagesAmount;
|
|
11
|
-
private readonly
|
|
12
|
-
private static instance;
|
|
10
|
+
private readonly initialData;
|
|
13
11
|
private readonly logger;
|
|
14
|
-
private
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
get acmeService(): AcmeService;
|
|
19
|
-
get initialData(): InitialData;
|
|
12
|
+
private acmeService;
|
|
13
|
+
constructor(coreCryptoClient: CoreCrypto, apiClient: APIClient,
|
|
14
|
+
/** number of seconds the certificate should be valid */
|
|
15
|
+
certificateTtl: number, keyPackagesAmount: number, initialData: InitialData);
|
|
20
16
|
startCertificateProcess(hasActiveCertificate: boolean): Promise<{
|
|
21
17
|
challenge: {
|
|
22
18
|
url: string;
|
|
@@ -34,7 +30,6 @@ export declare class E2EIServiceInternal {
|
|
|
34
30
|
*/
|
|
35
31
|
renewCertificate(oAuthIdToken: string, hasActiveCertificate: boolean): Promise<RotateBundle>;
|
|
36
32
|
private initIdentity;
|
|
37
|
-
private init;
|
|
38
33
|
private getDirectory;
|
|
39
34
|
private getInitialNonce;
|
|
40
35
|
/**
|
|
@@ -52,19 +47,6 @@ export declare class E2EIServiceInternal {
|
|
|
52
47
|
* @param oAuthIdToken
|
|
53
48
|
* @returns RotateBundle
|
|
54
49
|
*/
|
|
55
|
-
private
|
|
56
|
-
/**
|
|
57
|
-
* This function starts a new ACME enrollment flow for either a new client
|
|
58
|
-
* or a client that wants to refresh its certificate but has no valid refresh token
|
|
59
|
-
*/
|
|
60
|
-
private startNewOAuthFlow;
|
|
61
|
-
/**
|
|
62
|
-
* This function continues an ACME flow for either a new client
|
|
63
|
-
* or a client that wants to refresh its certificate but has no valid refresh token
|
|
64
|
-
*
|
|
65
|
-
* @param oAuthIdToken
|
|
66
|
-
* @returns RotateBundle | undefined
|
|
67
|
-
*/
|
|
68
|
-
private continueOAuthFlow;
|
|
50
|
+
private getRotateBundle;
|
|
69
51
|
}
|
|
70
52
|
//# sourceMappingURL=E2EIServiceInternal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"E2EIServiceInternal.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/mls/E2EIdentityService/E2EIServiceInternal.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"E2EIServiceInternal.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/mls/E2EIdentityService/E2EIServiceInternal.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAG9C,OAAO,EAA6B,UAAU,EAAkB,YAAY,EAAC,MAAM,qBAAqB,CAAC;AASzG,OAAO,EAAW,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAEnE,qBAAa,mBAAmB;IAK5B,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IACjC,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,wDAAwD;IACxD,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAClC,OAAO,CAAC,QAAQ,CAAC,WAAW;IAT9B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAuD;IAC9E,OAAO,CAAC,WAAW,CAAc;gBAGd,gBAAgB,EAAE,UAAU,EAC5B,SAAS,EAAE,SAAS;IACrC,wDAAwD;IACvC,cAAc,EAAE,MAAM,EACtB,iBAAiB,EAAE,MAAM,EACzB,WAAW,EAAE,WAAW;IAM9B,uBAAuB,CAAC,oBAAoB,EAAE,OAAO;;;;;;;;IAkBrD,0BAA0B,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC;IAYhG;;;;;OAKG;IACU,gBAAgB,CAAC,YAAY,EAAE,MAAM,EAAE,oBAAoB,EAAE,OAAO;YASnE,YAAY;YAuBZ,YAAY;YAUZ,eAAe;IAQ7B;;;;;OAKG;YACW,uBAAuB;IAyCrC;;;;;;;OAOG;YACW,eAAe;CA6D9B"}
|
|
@@ -35,59 +35,38 @@ const OidcChallenge_1 = require("./Steps/OidcChallenge");
|
|
|
35
35
|
const Order_1 = require("./Steps/Order");
|
|
36
36
|
const E2EIStorage_1 = require("./Storage/E2EIStorage");
|
|
37
37
|
class E2EIServiceInternal {
|
|
38
|
-
constructor(coreCryptoClient, apiClient,
|
|
38
|
+
constructor(coreCryptoClient, apiClient,
|
|
39
39
|
/** number of seconds the certificate should be valid */
|
|
40
|
-
certificateTtl, keyPackagesAmount,
|
|
40
|
+
certificateTtl, keyPackagesAmount, initialData) {
|
|
41
41
|
this.coreCryptoClient = coreCryptoClient;
|
|
42
42
|
this.apiClient = apiClient;
|
|
43
|
-
this.e2eiServiceExternal = e2eiServiceExternal;
|
|
44
43
|
this.certificateTtl = certificateTtl;
|
|
45
44
|
this.keyPackagesAmount = keyPackagesAmount;
|
|
46
|
-
this.
|
|
45
|
+
this.initialData = initialData;
|
|
47
46
|
this.logger = (0, logdown_1.default)('@wireapp/core/E2EIdentityServiceInternal');
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
static async getInstance(params) {
|
|
51
|
-
if (!E2EIServiceInternal.instance) {
|
|
52
|
-
if (!params) {
|
|
53
|
-
throw new Error('E2EIServiceInternal is not initialized. Please call getInstance with params.');
|
|
54
|
-
}
|
|
55
|
-
const { skipInit = false, coreCryptClient, apiClient, e2eiServiceExternal, keyPackagesAmount, dispatchNewCrlDistributionPoints, certificateTtl, } = params;
|
|
56
|
-
E2EIServiceInternal.instance = new E2EIServiceInternal(coreCryptClient, apiClient, e2eiServiceExternal, certificateTtl, keyPackagesAmount, dispatchNewCrlDistributionPoints);
|
|
57
|
-
if (!skipInit) {
|
|
58
|
-
const { discoveryUrl, user, clientId } = params;
|
|
59
|
-
if (!discoveryUrl || !user || !clientId) {
|
|
60
|
-
throw new Error('discoveryUrl, user and clientId are required to initialize E2EIServiceInternal');
|
|
61
|
-
}
|
|
62
|
-
await E2EIServiceInternal.instance.init({ clientId, discoveryUrl, user });
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
return E2EIServiceInternal.instance;
|
|
66
|
-
}
|
|
67
|
-
get acmeService() {
|
|
68
|
-
if (!this._acmeService) {
|
|
69
|
-
throw new Error('Error while trying to get AcmeService. E2EIServiceInternal has not been initialized');
|
|
70
|
-
}
|
|
71
|
-
return this._acmeService;
|
|
72
|
-
}
|
|
73
|
-
get initialData() {
|
|
74
|
-
if (!this._initialData) {
|
|
75
|
-
throw new Error('Error while trying to get InitialData. E2EIServiceInternal has not been initialized');
|
|
76
|
-
}
|
|
77
|
-
return this._initialData;
|
|
47
|
+
const { discoveryUrl } = initialData;
|
|
48
|
+
this.acmeService = new AcmeServer_1.AcmeService(discoveryUrl);
|
|
78
49
|
}
|
|
79
50
|
async startCertificateProcess(hasActiveCertificate) {
|
|
80
|
-
// Step 0: Check if we have a handle in local storage
|
|
81
|
-
// If we don't have a handle, we need to start a new OAuth flow
|
|
82
51
|
const identity = await this.initIdentity(hasActiveCertificate);
|
|
83
|
-
|
|
52
|
+
// Store the values in local storage for later use (e.g. in the continue flow)
|
|
53
|
+
const { orderUrl, authChallenges } = await this.getEnrollmentChallenges(identity);
|
|
54
|
+
const { authorization: { keyauth, oidcChallenge }, } = authChallenges;
|
|
55
|
+
// store auth data for continuing the flow later on
|
|
56
|
+
const handle = await this.coreCryptoClient.e2eiEnrollmentStash(identity);
|
|
57
|
+
E2EIStorage_1.E2EIStorage.store.handle(bazinga64_1.Encoder.toBase64(handle).asString);
|
|
58
|
+
E2EIStorage_1.E2EIStorage.store.authData(authChallenges);
|
|
59
|
+
E2EIStorage_1.E2EIStorage.store.orderData({ orderUrl });
|
|
60
|
+
return { challenge: oidcChallenge, keyAuth: keyauth };
|
|
84
61
|
}
|
|
85
62
|
async continueCertificateProcess(oAuthIdToken) {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
63
|
+
const handle = E2EIStorage_1.E2EIStorage.get.handle();
|
|
64
|
+
const identity = await this.coreCryptoClient.e2eiEnrollmentStashPop(bazinga64_1.Decoder.fromBase64(handle).asBytes);
|
|
65
|
+
if (!identity) {
|
|
66
|
+
throw new Error('Error while trying to continue OAuth flow. No enrollment in progress found');
|
|
89
67
|
}
|
|
90
|
-
|
|
68
|
+
const authData = E2EIStorage_1.E2EIStorage.get.authData();
|
|
69
|
+
return this.getRotateBundle(identity, oAuthIdToken, authData);
|
|
91
70
|
}
|
|
92
71
|
/**
|
|
93
72
|
* This function starts a ACME refresh flow for an existing client with a valid refresh token
|
|
@@ -98,7 +77,7 @@ class E2EIServiceInternal {
|
|
|
98
77
|
async renewCertificate(oAuthIdToken, hasActiveCertificate) {
|
|
99
78
|
const identity = await this.initIdentity(hasActiveCertificate);
|
|
100
79
|
const authData = await this.getEnrollmentChallenges(identity);
|
|
101
|
-
return this.
|
|
80
|
+
return this.getRotateBundle(identity, oAuthIdToken, authData.authChallenges);
|
|
102
81
|
}
|
|
103
82
|
// ############ Internal Functions ############
|
|
104
83
|
async initIdentity(hasActiveCertificate) {
|
|
@@ -109,14 +88,6 @@ class E2EIServiceInternal {
|
|
|
109
88
|
? this.coreCryptoClient.e2eiNewRotateEnrollment(this.certificateTtl, ciphersuite, user.displayName, user.handle, user.teamId)
|
|
110
89
|
: this.coreCryptoClient.e2eiNewActivationEnrollment(user.displayName, user.handle, this.certificateTtl, ciphersuite, user.teamId);
|
|
111
90
|
}
|
|
112
|
-
async init(params) {
|
|
113
|
-
const { user, clientId, discoveryUrl } = params;
|
|
114
|
-
if (!user || !clientId) {
|
|
115
|
-
throw new Error('user and clientId are required to initialize E2eIdentityService');
|
|
116
|
-
}
|
|
117
|
-
this._initialData = { user, clientId, discoveryUrl };
|
|
118
|
-
this._acmeService = new AcmeServer_1.AcmeService(discoveryUrl);
|
|
119
|
-
}
|
|
120
91
|
async getDirectory(identity, connection) {
|
|
121
92
|
const directory = await connection.getDirectory();
|
|
122
93
|
if (directory) {
|
|
@@ -181,7 +152,7 @@ class E2EIServiceInternal {
|
|
|
181
152
|
* @param oAuthIdToken
|
|
182
153
|
* @returns RotateBundle
|
|
183
154
|
*/
|
|
184
|
-
async
|
|
155
|
+
async getRotateBundle(identity, oAuthIdToken, authData) {
|
|
185
156
|
// Step 7: Do OIDC client challenge
|
|
186
157
|
const oidcData = await (0, OidcChallenge_1.doWireOidcChallenge)({
|
|
187
158
|
oAuthIdToken,
|
|
@@ -190,7 +161,7 @@ class E2EIServiceInternal {
|
|
|
190
161
|
identity,
|
|
191
162
|
nonce: authData.nonce,
|
|
192
163
|
});
|
|
193
|
-
this.logger.log('
|
|
164
|
+
this.logger.log('oidc data', oidcData);
|
|
194
165
|
if (!oidcData.data.validated) {
|
|
195
166
|
throw new Error('Error while trying to continue OAuth flow. OIDC challenge not validated');
|
|
196
167
|
}
|
|
@@ -206,7 +177,7 @@ class E2EIServiceInternal {
|
|
|
206
177
|
expirySecs: 30,
|
|
207
178
|
nonce: oidcData.nonce,
|
|
208
179
|
});
|
|
209
|
-
this.logger.log('
|
|
180
|
+
this.logger.log('dpop data', dpopData);
|
|
210
181
|
if (!(0, Helper_1.isResponseStatusValid)(dpopData.data.status)) {
|
|
211
182
|
throw new Error('Error while trying to continue OAuth flow. DPOP challenge not validated');
|
|
212
183
|
}
|
|
@@ -232,45 +203,7 @@ class E2EIServiceInternal {
|
|
|
232
203
|
throw new Error('Error while trying to continue OAuth flow. No certificate received');
|
|
233
204
|
}
|
|
234
205
|
// Step 10: Initialize MLS with the certificate
|
|
235
|
-
|
|
236
|
-
this.dispatchNewCrlDistributionPoints(rotateBundle);
|
|
237
|
-
return rotateBundle;
|
|
238
|
-
}
|
|
239
|
-
/**
|
|
240
|
-
* This function starts a new ACME enrollment flow for either a new client
|
|
241
|
-
* or a client that wants to refresh its certificate but has no valid refresh token
|
|
242
|
-
*/
|
|
243
|
-
async startNewOAuthFlow(identity) {
|
|
244
|
-
if (this.e2eiServiceExternal.isEnrollmentInProgress()) {
|
|
245
|
-
throw new Error('Error while trying to start OAuth flow. There is already a flow in progress');
|
|
246
|
-
}
|
|
247
|
-
const { authChallenges, orderUrl } = await this.getEnrollmentChallenges(identity);
|
|
248
|
-
const { authorization: { oidcChallenge: wireOidcChallenge, keyauth }, } = authChallenges;
|
|
249
|
-
if (!wireOidcChallenge || !keyauth) {
|
|
250
|
-
throw new Error('missing wireOidcChallenge or keyauth');
|
|
251
|
-
}
|
|
252
|
-
// stash the identity for later use
|
|
253
|
-
const handle = await this.coreCryptoClient.e2eiEnrollmentStash(identity);
|
|
254
|
-
// Store the values in local storage for later use (e.g. in the continue flow)
|
|
255
|
-
E2EIStorage_1.E2EIStorage.store.handle(bazinga64_1.Encoder.toBase64(handle).asString);
|
|
256
|
-
E2EIStorage_1.E2EIStorage.store.authData(authChallenges);
|
|
257
|
-
E2EIStorage_1.E2EIStorage.store.orderData({ orderUrl });
|
|
258
|
-
// we need to pass back the aquired wireOidcChallenge to the UI
|
|
259
|
-
return { challenge: wireOidcChallenge, keyAuth: keyauth };
|
|
260
|
-
}
|
|
261
|
-
/**
|
|
262
|
-
* This function continues an ACME flow for either a new client
|
|
263
|
-
* or a client that wants to refresh its certificate but has no valid refresh token
|
|
264
|
-
*
|
|
265
|
-
* @param oAuthIdToken
|
|
266
|
-
* @returns RotateBundle | undefined
|
|
267
|
-
*/
|
|
268
|
-
async continueOAuthFlow(oAuthIdToken) {
|
|
269
|
-
const handle = E2EIStorage_1.E2EIStorage.get.handle();
|
|
270
|
-
const authData = E2EIStorage_1.E2EIStorage.get.authData();
|
|
271
|
-
const identity = await this.coreCryptoClient.e2eiEnrollmentStashPop(bazinga64_1.Decoder.fromBase64(handle).asBytes);
|
|
272
|
-
this.logger.log('retrieved identity from stash');
|
|
273
|
-
return this.getRotateBundleAndStoreCertificateData(identity, oAuthIdToken, authData);
|
|
206
|
+
return this.coreCryptoClient.e2eiRotateAll(identity, certificate, this.keyPackagesAmount);
|
|
274
207
|
}
|
|
275
208
|
}
|
|
276
209
|
exports.E2EIServiceInternal = E2EIServiceInternal;
|
|
@@ -63,9 +63,7 @@ describe('handleMLSMessageAdd', () => {
|
|
|
63
63
|
const mockGroupId = 'AAEAAH87aajaQ011i+rNLmwpy0sAZGl5YS53aXJlLmxpbms=';
|
|
64
64
|
const message = createMockedMessage();
|
|
65
65
|
jest.spyOn(mockedMLSService, 'decryptMessage').mockResolvedValueOnce({
|
|
66
|
-
proposals: [
|
|
67
|
-
{ proposal: new Uint8Array(), proposalRef: new Uint8Array(), crlNewDistributionPoints: [], free: () => { } },
|
|
68
|
-
],
|
|
66
|
+
proposals: [{ proposal: new Uint8Array(), proposalRef: new Uint8Array(), crlNewDistributionPoints: [] }],
|
|
69
67
|
commitDelay: 2000,
|
|
70
68
|
crlNewDistributionPoints: [],
|
|
71
69
|
message,
|
|
@@ -10,7 +10,7 @@ import { MLSServiceConfig } from './MLSService.types';
|
|
|
10
10
|
import { KeyPackageClaimUser } from '../../../conversation';
|
|
11
11
|
import { CoreDatabase } from '../../../storage/CoreDB';
|
|
12
12
|
import { RecurringTaskScheduler } from '../../../util/RecurringTaskScheduler';
|
|
13
|
-
import { AcmeChallenge,
|
|
13
|
+
import { AcmeChallenge, User } from '../E2EIdentityService';
|
|
14
14
|
import { ClientId, HandlePendingProposalsParams } from '../types';
|
|
15
15
|
export declare const optionalToUint8Array: (array: Uint8Array | []) => Uint8Array;
|
|
16
16
|
type EnrollmentProcessState = {
|
|
@@ -223,7 +223,7 @@ export declare class MLSService extends TypedEventEmitter<Events> {
|
|
|
223
223
|
* @param oAuthIdToken The OAuth id token if the user is already authenticated
|
|
224
224
|
* @returns AcmeChallenge if the user is not authenticated, true if the user is authenticated
|
|
225
225
|
*/
|
|
226
|
-
enrollE2EI(discoveryUrl: string,
|
|
226
|
+
enrollE2EI(discoveryUrl: string, user: User, client: RegisteredClient, nbPrekeys: number, certificateTtl: number, oAuthIdToken?: string): Promise<EnrollmentProcessState>;
|
|
227
227
|
}
|
|
228
228
|
export {};
|
|
229
229
|
//# sourceMappingURL=MLSService.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MLSService.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/mls/MLSService/MLSService.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAqB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B,oBAAoB;IAOrB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAe7D;;;;;;;OAOG;IACU,sBAAsB,CAAC,EAAC,SAAS,EAAE,OAAO,EAAE,SAAS,EAAC,EAAE,4BAA4B;YAWnF,4BAA4B;YAU5B,0BAA0B;IAKxC,OAAO,CAAC,6BAA6B;IAIrC;;;;OAIG;IACU,sBAAsB,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,UAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IA4BvF;;;;OAIG;IACU,+BAA+B;IAiB5C;;;;OAIG;IACU,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,QAAQ,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAC,EAAE,CAAC;IAY9F,wBAAwB,CACnC,KAAK,EAAE,8BAA8B,EACrC,yBAAyB,EAAE,CACzB,cAAc,EAAE,WAAW,EAC3B,iBAAiB,CAAC,EAAE,kBAAkB,KACnC,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAgBrB,4BAA4B,CAAC,KAAK,EAAE,2BAA2B,EAAE,QAAQ,EAAE,MAAM;IAcjF,oBAAoB,CAAC,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,UAAU,EAAE;IASjF;;;;;;;;OAQG;IACU,UAAU,CACrB,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,gBAAgB,EACxB,SAAS,EAAE,MAAM,EACjB,cAAc,EAAE,MAAM,EACtB,YAAY,CAAC,EAAE,MAAM,GACpB,OAAO,CAAC,sBAAsB,CAAC;CAqDnC"}
|
|
@@ -514,7 +514,8 @@ class MLSService extends commons_1.TypedEventEmitter {
|
|
|
514
514
|
*/
|
|
515
515
|
async uploadMLSPublicKeys(client) {
|
|
516
516
|
// If we've already updated a client with its public key, there's no need to do it again.
|
|
517
|
-
const
|
|
517
|
+
const credentialType = await this.getCredentialType();
|
|
518
|
+
const publicKey = await this.coreCryptoClient.clientPublicKey(this.config.cipherSuite, credentialType);
|
|
518
519
|
return this.apiClient.api.client.putClient(client.id, {
|
|
519
520
|
mls_public_keys: { ed25519: btoa(bazinga64_1.Converter.arrayBufferViewToBaselineString(publicKey)) },
|
|
520
521
|
});
|
|
@@ -664,34 +665,20 @@ class MLSService extends commons_1.TypedEventEmitter {
|
|
|
664
665
|
* @param oAuthIdToken The OAuth id token if the user is already authenticated
|
|
665
666
|
* @returns AcmeChallenge if the user is not authenticated, true if the user is authenticated
|
|
666
667
|
*/
|
|
667
|
-
async enrollE2EI(discoveryUrl,
|
|
668
|
+
async enrollE2EI(discoveryUrl, user, client, nbPrekeys, certificateTtl, oAuthIdToken) {
|
|
668
669
|
const hasActiveCertificate = await this.coreCryptoClient.e2eiIsEnabled(this.config.cipherSuite);
|
|
669
|
-
const
|
|
670
|
-
apiClient: this.apiClient,
|
|
671
|
-
coreCryptClient: this.coreCryptoClient,
|
|
672
|
-
e2eiServiceExternal,
|
|
673
|
-
user,
|
|
674
|
-
clientId: client.id,
|
|
675
|
-
discoveryUrl,
|
|
676
|
-
keyPackagesAmount: nbPrekeys,
|
|
677
|
-
dispatchNewCrlDistributionPoints: payload => this.dispatchNewCrlDistributionPoints(payload),
|
|
678
|
-
certificateTtl,
|
|
679
|
-
});
|
|
670
|
+
const e2eiServiceInternal = new E2EIServiceInternal_1.E2EIServiceInternal(this.coreCryptoClient, this.apiClient, certificateTtl, nbPrekeys, { user, clientId: client.id, discoveryUrl });
|
|
680
671
|
// If we don't have an OAuth id token, we need to start the certificate process with Oauth
|
|
681
672
|
if (!oAuthIdToken) {
|
|
682
|
-
const data = await
|
|
683
|
-
const oidcChallenge = data.challenge;
|
|
684
|
-
if (!oidcChallenge) {
|
|
685
|
-
throw new Error('Not oidc challenge found');
|
|
686
|
-
}
|
|
673
|
+
const data = await e2eiServiceInternal.startCertificateProcess(hasActiveCertificate);
|
|
687
674
|
return { status: 'authentication', authenticationChallenge: data };
|
|
688
675
|
}
|
|
689
676
|
// If we have an OAuth id token, we can continue the certificate process / start a refresh
|
|
690
677
|
const rotateBundle = !hasActiveCertificate
|
|
691
678
|
? // If we are not refreshing the active certificate, we need to continue the certificate process with Oauth
|
|
692
|
-
await
|
|
679
|
+
await e2eiServiceInternal.continueCertificateProcess(oAuthIdToken)
|
|
693
680
|
: // If we are refreshing the active certificate, can start the refresh process
|
|
694
|
-
await
|
|
681
|
+
await e2eiServiceInternal.renewCertificate(oAuthIdToken, hasActiveCertificate);
|
|
695
682
|
if (rotateBundle === undefined) {
|
|
696
683
|
throw new Error('Could not get the rotate bundle');
|
|
697
684
|
}
|
|
@@ -298,7 +298,7 @@ describe('MLSService', () => {
|
|
|
298
298
|
jest.spyOn(apiClient.api.client, 'uploadMLSKeyPackages').mockResolvedValueOnce(undefined);
|
|
299
299
|
jest
|
|
300
300
|
.spyOn(coreCrypto, 'processWelcomeMessage')
|
|
301
|
-
.mockResolvedValueOnce({ id: new Uint8Array(), crlNewDistributionPoints: []
|
|
301
|
+
.mockResolvedValueOnce({ id: new Uint8Array(), crlNewDistributionPoints: [] });
|
|
302
302
|
jest.spyOn(mlsService, 'scheduleKeyMaterialRenewal').mockImplementation(jest.fn());
|
|
303
303
|
const mockedMLSWelcomeEvent = {
|
|
304
304
|
type: event_1.CONVERSATION_EVENT.MLS_WELCOME_MESSAGE,
|
|
@@ -324,7 +324,7 @@ describe('MLSService', () => {
|
|
|
324
324
|
jest.spyOn(apiClient.api.client, 'uploadMLSKeyPackages').mockResolvedValueOnce(undefined);
|
|
325
325
|
jest
|
|
326
326
|
.spyOn(coreCrypto, 'processWelcomeMessage')
|
|
327
|
-
.mockResolvedValueOnce({ id: new Uint8Array(), crlNewDistributionPoints: []
|
|
327
|
+
.mockResolvedValueOnce({ id: new Uint8Array(), crlNewDistributionPoints: [] });
|
|
328
328
|
jest.spyOn(mlsService, 'scheduleKeyMaterialRenewal').mockImplementation(jest.fn());
|
|
329
329
|
const mockedMLSWelcomeEvent = {
|
|
330
330
|
type: event_1.CONVERSATION_EVENT.MLS_WELCOME_MESSAGE,
|
|
@@ -351,7 +351,7 @@ describe('MLSService', () => {
|
|
|
351
351
|
jest.spyOn(apiClient.api.client, 'uploadMLSKeyPackages').mockResolvedValueOnce(undefined);
|
|
352
352
|
jest
|
|
353
353
|
.spyOn(coreCrypto, 'processWelcomeMessage')
|
|
354
|
-
.mockResolvedValueOnce({ id: new Uint8Array(), crlNewDistributionPoints: []
|
|
354
|
+
.mockResolvedValueOnce({ id: new Uint8Array(), crlNewDistributionPoints: [] });
|
|
355
355
|
jest.spyOn(mlsService, 'scheduleKeyMaterialRenewal').mockImplementation(jest.fn());
|
|
356
356
|
const mockedMLSWelcomeEvent = {
|
|
357
357
|
type: event_1.CONVERSATION_EVENT.MLS_WELCOME_MESSAGE,
|
|
@@ -17,6 +17,7 @@ export declare class CoreCryptoWrapper implements CryptoClient {
|
|
|
17
17
|
private readonly coreCrypto;
|
|
18
18
|
private readonly config;
|
|
19
19
|
private readonly prekeyTracker;
|
|
20
|
+
readonly version: string;
|
|
20
21
|
constructor(coreCrypto: CoreCrypto, config: ClientConfig);
|
|
21
22
|
getNativeClient(): CoreCrypto;
|
|
22
23
|
encrypt(sessions: string[], plainText: Uint8Array): Promise<Map<string, Uint8Array>>;
|
|
@@ -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,EAAc,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAC;AAItD,OAAO,EAAoB,YAAY,EAAC,MAAM,+CAA+C,CAAC;AAC9F,OAAO,EAAC,YAAY,EAAC,MAAM,uBAAuB,CAAC;AAEnD,KAAK,MAAM,GAAG;IACZ,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;IAC5D,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC1C,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,KAAK,YAAY,GAAG,IAAI,CAAC,MAAM,EAAE,mBAAmB,GAAG,cAAc,CAAC,GAAG;IACvE,MAAM,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7B,CAAC;AAEF,wBAAsB,WAAW,CAC/B,WAAW,EAAE,UAAU,EACvB,EAAC,YAAY,EAAE,iBAAiB,EAAE,SAAS,EAAE,YAAY,EAAC,EAAE,MAAM,GACjE,OAAO,CAAC,iBAAiB,CAAC,CAsB5B;AAED,qBAAa,iBAAkB,YAAW,YAAY;
|
|
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,UAAU,EAAC,MAAM,uBAAuB,CAAC;AAItD,OAAO,EAAoB,YAAY,EAAC,MAAM,+CAA+C,CAAC;AAC9F,OAAO,EAAC,YAAY,EAAC,MAAM,uBAAuB,CAAC;AAEnD,KAAK,MAAM,GAAG;IACZ,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;IAC5D,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,CAAC,OAAO,EA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AAS,EAAE,MAAM;IAUnC,kBAAkB;IAIlB,oBAAoB,CAAC,MAAM,EAAE,MAAM;IAIzC;;;;OAIG;IACH,OAAO,CAAC,OAAO;IAgBT,IAAI;CAIX"}
|
|
@@ -54,6 +54,7 @@ class CoreCryptoWrapper {
|
|
|
54
54
|
constructor(coreCrypto, config) {
|
|
55
55
|
this.coreCrypto = coreCrypto;
|
|
56
56
|
this.config = config;
|
|
57
|
+
this.version = core_crypto_1.CoreCrypto.version();
|
|
57
58
|
this.prekeyTracker = new PrekeysTracker_1.PrekeyTracker(this, config);
|
|
58
59
|
}
|
|
59
60
|
getNativeClient() {
|
|
@@ -8,6 +8,7 @@ export declare enum CryptoClientType {
|
|
|
8
8
|
CRYPTOBOX = 1
|
|
9
9
|
}
|
|
10
10
|
export interface CryptoClient<T = unknown> {
|
|
11
|
+
readonly version: string;
|
|
11
12
|
getNativeClient(): T;
|
|
12
13
|
encrypt(sessions: string[], plainText: Uint8Array): Promise<Map<string, Uint8Array>>;
|
|
13
14
|
decrypt(sessionId: string, message: Uint8Array): Promise<Uint8Array>;
|
package/lib/messagingProtocols/proteus/ProteusService/CryptoClient/CryptoClient.types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CryptoClient.types.d.ts","sourceRoot":"","sources":["../../../../../src/messagingProtocols/proteus/ProteusService/CryptoClient/CryptoClient.types.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,MAAM,EAAC,MAAM,8BAA8B,CAAC;AAEpD,MAAM,MAAM,cAAc,GAAG;IAAC,OAAO,EAAE,MAAM,EAAE,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAC,CAAC;AAErE,oBAAY,gBAAgB;IAC1B,WAAW,IAAA;IACX,SAAS,IAAA;CACV;AAED,MAAM,WAAW,YAAY,CAAC,CAAC,GAAG,OAAO;IACvC,eAAe,IAAI,CAAC,CAAC;IACrB,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,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I,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACvB"}
|
|
1
|
+
{"version":3,"file":"CryptoClient.types.d.ts","sourceRoot":"","sources":["../../../../../src/messagingProtocols/proteus/ProteusService/CryptoClient/CryptoClient.types.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,MAAM,EAAC,MAAM,8BAA8B,CAAC;AAEpD,MAAM,MAAM,cAAc,GAAG;IAAC,OAAO,EAAE,MAAM,EAAE,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAC,CAAC;AAErE,oBAAY,gBAAgB;IAC1B,WAAW,IAAA;IACX,SAAS,IAAA;CACV;AAED,MAAM,WAAW,YAAY,CAAC,CAAC,GAAG,OAAO;IACvC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,eAAe,IAAI,CAAC,CAAC;IACrB,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC;IACrF,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAErE;;OAEG;IACH,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvC;;OAEG;IACH,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IACzE,cAAc,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAClC,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACzD,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAChF,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxE,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACnD,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9C,aAAa,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAChD,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAC7B,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3C,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACpC;;OAEG;IACH,oBAAoB,CAAC,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACrD,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACvB"}
|
|
@@ -10,6 +10,7 @@ export declare function buildClient(storeEngine: CRUDEngine, config: Config & {
|
|
|
10
10
|
}): CryptoboxWrapper;
|
|
11
11
|
export declare class CryptoboxWrapper implements CryptoClient {
|
|
12
12
|
private readonly cryptobox;
|
|
13
|
+
readonly version: string;
|
|
13
14
|
constructor(cryptobox: Cryptobox, config: Config);
|
|
14
15
|
getNativeClient(): Cryptobox;
|
|
15
16
|
encrypt(sessions: string[], plainText: Uint8Array): Promise<Map<string, Uint8Array>>;
|
package/lib/messagingProtocols/proteus/ProteusService/CryptoClient/CryptoboxWrapper.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CryptoboxWrapper.d.ts","sourceRoot":"","sources":["../../../../../src/messagingProtocols/proteus/ProteusService/CryptoClient/CryptoboxWrapper.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,MAAM,EAAC,MAAM,8BAA8B,CAAC;AAEpD,OAAO,EAAC,SAAS,EAAC,MAAM,oBA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IxC,IAAI;IAIJ,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,UAAU;;;;;;;;;;IAkB/C,cAAc;IAId,oBAAoB,CAAC,SAAS,EAAE,MAAM;IAK5C,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU;IAInD,aAAa;IAIb,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU;IAIvD,aAAa,CAAC,SAAS,EAAE,MAAM;IAQ/B,WAAW;IAIX,aAAa,CAAC,SAAS,EAAE,MAAM;IAI/B,SAAS;;;;IAKT,iBAAiB,CAAC,SAAS,EAAE,MAAM;IAOnC,kBAAkB;IAIlB,IAAI;CACX"}
|
|
@@ -29,6 +29,7 @@ exports.buildClient = buildClient;
|
|
|
29
29
|
class CryptoboxWrapper {
|
|
30
30
|
constructor(cryptobox, config) {
|
|
31
31
|
this.cryptobox = cryptobox;
|
|
32
|
+
this.version = '1.0.0';
|
|
32
33
|
this.cryptobox.on(cryptobox_1.Cryptobox.TOPIC.NEW_PREKEYS, prekeys => {
|
|
33
34
|
const serializedPreKeys = prekeys.map(prekey => this.cryptobox.serialize_prekey(prekey));
|
|
34
35
|
config.onNewPrekeys(serializedPreKeys);
|
package/package.json
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"@wireapp/api-client": "^26.10.10",
|
|
15
15
|
"@wireapp/commons": "^5.2.5",
|
|
16
|
-
"@wireapp/core-crypto": "1.0.0-rc.
|
|
16
|
+
"@wireapp/core-crypto": "1.0.0-rc.40",
|
|
17
17
|
"@wireapp/cryptobox": "12.8.0",
|
|
18
18
|
"@wireapp/promise-queue": "^2.2.10",
|
|
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": "44.0.
|
|
64
|
-
"gitHead": "
|
|
63
|
+
"version": "44.0.7",
|
|
64
|
+
"gitHead": "68a211bf9ec5451d5ff85dbea8ecfb7be0440d2f"
|
|
65
65
|
}
|