@wireapp/core 43.9.1 → 43.11.0
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 +6 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/Connection/AcmeServer/AcmeService.d.ts.map +1 -1
- package/lib/messagingProtocols/mls/E2EIdentityService/Connection/AcmeServer/AcmeService.js +25 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/Connection/AcmeServer/schema.d.ts +10 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/Connection/AcmeServer/schema.d.ts.map +1 -1
- package/lib/messagingProtocols/mls/E2EIdentityService/Connection/AcmeServer/schema.js +5 -1
- package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceExternal.d.ts +26 -3
- package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceExternal.d.ts.map +1 -1
- package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceExternal.js +93 -13
- package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceExternal.test.js +14 -4
- package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceInternal.d.ts +11 -2
- package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceInternal.d.ts.map +1 -1
- package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceInternal.js +19 -3
- package/lib/messagingProtocols/mls/E2EIdentityService/Steps/OidcChallenge.d.ts +2 -3
- package/lib/messagingProtocols/mls/E2EIdentityService/Steps/OidcChallenge.d.ts.map +1 -1
- package/lib/messagingProtocols/mls/E2EIdentityService/Steps/OidcChallenge.js +3 -4
- package/lib/messagingProtocols/mls/EventHandler/events/messageAdd/messageAdd.test.js +3 -1
- package/lib/messagingProtocols/mls/MLSService/MLSService.d.ts +1 -0
- package/lib/messagingProtocols/mls/MLSService/MLSService.d.ts.map +1 -1
- package/lib/messagingProtocols/mls/MLSService/MLSService.js +25 -3
- package/lib/messagingProtocols/mls/MLSService/MLSService.test.js +9 -3
- package/lib/storage/CoreDB.d.ts +7 -0
- package/lib/storage/CoreDB.d.ts.map +1 -1
- package/lib/storage/CoreDB.js +2 -0
- package/lib/util/RecurringTaskScheduler/RecurringTaskScheduler.d.ts +1 -0
- package/lib/util/RecurringTaskScheduler/RecurringTaskScheduler.d.ts.map +1 -1
- package/lib/util/RecurringTaskScheduler/RecurringTaskScheduler.js +3 -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,MAAM,UAAU,CAAC;AACtC,OAAO,EAAC,kBAAkB,E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AmB,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;IA2FnB,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
|
@@ -356,7 +356,8 @@ class Account extends commons_1.TypedEventEmitter {
|
|
|
356
356
|
const clientService = new client_2.ClientService(this.apiClient, proteusService, this.storeEngine);
|
|
357
357
|
if (clientType === CryptoClient_1.CryptoClientType.CORE_CRYPTO && (await this.isMlsEnabled())) {
|
|
358
358
|
mlsService = new mls_1.MLSService(this.apiClient, cryptoClient.getNativeClient(), this.db, this.recurringTaskScheduler, Object.assign({}, (_a = this.coreCryptoConfig) === null || _a === void 0 ? void 0 : _a.mls));
|
|
359
|
-
e2eServiceExternal = new E2EIdentityService_1.E2EIServiceExternal(cryptoClient.getNativeClient(), clientService, mlsService.config.cipherSuite);
|
|
359
|
+
e2eServiceExternal = new E2EIdentityService_1.E2EIServiceExternal(cryptoClient.getNativeClient(), this.db, this.recurringTaskScheduler, clientService, mlsService.config.cipherSuite);
|
|
360
|
+
mlsService.on('newCrlDistributionPoints', e2eServiceExternal.handleNewRemoteCrlDistributionPoints);
|
|
360
361
|
}
|
|
361
362
|
const connectionService = new connection_1.ConnectionService(this.apiClient);
|
|
362
363
|
const giphyService = new giphy_1.GiphyService(this.apiClient);
|
package/lib/messagingProtocols/mls/E2EIdentityService/Connection/AcmeServer/AcmeService.d.ts
CHANGED
|
@@ -11,7 +11,13 @@ export declare class AcmeService {
|
|
|
11
11
|
private extractLocation;
|
|
12
12
|
private postJoseRequest;
|
|
13
13
|
getDirectory(): GetDirectoryReturnValue;
|
|
14
|
+
getSelfCRL(): Promise<{
|
|
15
|
+
crl: Uint8Array;
|
|
16
|
+
url: string;
|
|
17
|
+
}>;
|
|
14
18
|
getLocalCertificateRoot(): Promise<string>;
|
|
19
|
+
getCRLFromDistributionPoint(distributionPointUrl: string): Promise<Uint8Array>;
|
|
20
|
+
getFederationCrossSignedCertificates(): Promise<string[]>;
|
|
15
21
|
getInitialNonce(url: AcmeDirectory['newNonce']): GetInitialNonceReturnValue;
|
|
16
22
|
createNewAccount(url: AcmeDirectory['newAccount'], payload: Uint8Array): Promise<PostJoseRequestReturnValue<{
|
|
17
23
|
status: string;
|
package/lib/messagingProtocols/mls/E2EIdentityService/Connection/AcmeServer/AcmeService.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcmeService.d.ts","sourceRoot":"","sources":["../../../../../../src/messagingProtocols/mls/E2EIdentityService/Connection/AcmeServer/AcmeService.ts"],"names":[],"mappings":"AAsBA,OAAO,EACL,uBAAuB,EACvB,0BAA0B,EAE1B,0BAA0B,EAC3B,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"AcmeService.d.ts","sourceRoot":"","sources":["../../../../../../src/messagingProtocols/mls/E2EIdentityService/Connection/AcmeServer/AcmeService.ts"],"names":[],"mappings":"AAsBA,OAAO,EACL,uBAAuB,EACvB,0BAA0B,EAE1B,0BAA0B,EAC3B,MAAM,qBAAqB,CAAC;AAoB7B,OAAO,EAAC,aAAa,EAAE,aAAa,EAAC,MAAM,yBAAyB,CAAC;AAErE,qBAAa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;;;IAQ9C,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU;CAO7D"}
|
|
@@ -32,6 +32,9 @@ class AcmeService {
|
|
|
32
32
|
this.axiosInstance = axios_1.default.create();
|
|
33
33
|
this.url = {
|
|
34
34
|
ROOTS: '/roots.pem',
|
|
35
|
+
CRL: '/crl',
|
|
36
|
+
PROXY_CRL: '/proxyCrl',
|
|
37
|
+
FEDERATION: '/federation',
|
|
35
38
|
};
|
|
36
39
|
}
|
|
37
40
|
get acmeBaseUrl() {
|
|
@@ -71,11 +74,33 @@ class AcmeService {
|
|
|
71
74
|
return undefined;
|
|
72
75
|
}
|
|
73
76
|
}
|
|
77
|
+
async getSelfCRL() {
|
|
78
|
+
const url = `${this.acmeBaseUrl}${this.url.CRL}`;
|
|
79
|
+
const { data } = await this.axiosInstance.get(url, {
|
|
80
|
+
responseType: 'arraybuffer',
|
|
81
|
+
});
|
|
82
|
+
const crl = schema_1.CrlResponseSchema.parse(data);
|
|
83
|
+
const crlUint8Array = new Uint8Array(crl);
|
|
84
|
+
return { url, crl: crlUint8Array };
|
|
85
|
+
}
|
|
74
86
|
async getLocalCertificateRoot() {
|
|
75
87
|
const { data } = await this.axiosInstance.get(`${this.acmeBaseUrl}${this.url.ROOTS}`);
|
|
76
88
|
const localCertificateRoot = schema_1.LocalCertificateRootResponseSchema.parse(data);
|
|
77
89
|
return localCertificateRoot;
|
|
78
90
|
}
|
|
91
|
+
async getCRLFromDistributionPoint(distributionPointUrl) {
|
|
92
|
+
const { data } = await this.axiosInstance.get(`${this.acmeBaseUrl}${this.url.PROXY_CRL}/${distributionPointUrl}`, {
|
|
93
|
+
responseType: 'arraybuffer',
|
|
94
|
+
});
|
|
95
|
+
const crl = schema_1.CrlResponseSchema.parse(data);
|
|
96
|
+
const crlUint8Array = new Uint8Array(crl);
|
|
97
|
+
return crlUint8Array;
|
|
98
|
+
}
|
|
99
|
+
async getFederationCrossSignedCertificates() {
|
|
100
|
+
const { data } = await this.axiosInstance.get(`${this.acmeBaseUrl}${this.url.FEDERATION}`);
|
|
101
|
+
const federationCrossSignedCertificates = schema_1.FederationCrossSignedCertificatesResponseSchema.parse(data);
|
|
102
|
+
return federationCrossSignedCertificates.crts;
|
|
103
|
+
}
|
|
79
104
|
async getInitialNonce(url) {
|
|
80
105
|
try {
|
|
81
106
|
const { headers } = await this.axiosInstance.head(url);
|
|
@@ -37,6 +37,16 @@ export declare const DirectoryResponseSchema: z.ZodObject<{
|
|
|
37
37
|
export type DirectoryResponseData = z.infer<typeof DirectoryResponseSchema>;
|
|
38
38
|
export declare const LocalCertificateRootResponseSchema: z.ZodString;
|
|
39
39
|
export type LocalCertificateRootResonseData = z.infer<typeof LocalCertificateRootResponseSchema>;
|
|
40
|
+
export declare const CrlResponseSchema: z.ZodEffects<z.ZodType<ArrayBuffer, z.ZodTypeDef, ArrayBuffer>, ArrayBuffer, ArrayBuffer>;
|
|
41
|
+
export type CrlResponseData = z.infer<typeof CrlResponseSchema>;
|
|
42
|
+
export declare const FederationCrossSignedCertificatesResponseSchema: z.ZodObject<{
|
|
43
|
+
crts: z.ZodArray<z.ZodString, "many">;
|
|
44
|
+
}, "strip", z.ZodTypeAny, {
|
|
45
|
+
crts: string[];
|
|
46
|
+
}, {
|
|
47
|
+
crts: string[];
|
|
48
|
+
}>;
|
|
49
|
+
export type FederationCrossSignedCertificatesResponseData = z.infer<typeof FederationCrossSignedCertificatesResponseSchema>;
|
|
40
50
|
export declare const NewAccountResponseSchema: z.ZodObject<{
|
|
41
51
|
status: z.ZodString;
|
|
42
52
|
orders: z.ZodString;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../../../src/messagingProtocols/mls/E2EIdentityService/Connection/AcmeServer/schema.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAKtB,eAAO,MAAM,yBAAyB;;;;;;EAEpC,CAAC;AAC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AAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEpF,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAc3C,CAAC;AACH,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAE9F,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAetC,CAAC;AACH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEpF,eAAO,MAAM,4BAA4B,aAAoB,CAAC;AAC9D,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../../../src/messagingProtocols/mls/E2EIdentityService/Connection/AcmeServer/schema.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAKtB,eAAO,MAAM,yBAAyB;;;;;;EAEpC,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E,eAAO,MAAM,4BAA4B;;;;;;EAEvC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAElF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;EAMlC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAE5E,eAAO,MAAM,kCAAkC,aAAoB,CAAC;AACpE,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAEjG,eAAO,MAAM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2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAetC,CAAC;AACH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEpF,eAAO,MAAM,4BAA4B,aAAoB,CAAC;AAC9D,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC"}
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
*
|
|
19
19
|
*/
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.GetCertificateResponseSchema = exports.FinalizeOrderResponseSchema = exports.CheckStatusOfOrderResponseSchema = exports.OidcChallengeResponseSchema = exports.DpopChallengeResponseSchema = exports.AuthorizationResponseSchema = exports.NewOrderResponseSchema = exports.NewAccountResponseSchema = exports.LocalCertificateRootResponseSchema = exports.DirectoryResponseSchema = exports.ResponseHeaderLocationSchema = exports.ResponseHeaderNonceSchema = void 0;
|
|
21
|
+
exports.GetCertificateResponseSchema = exports.FinalizeOrderResponseSchema = exports.CheckStatusOfOrderResponseSchema = exports.OidcChallengeResponseSchema = exports.DpopChallengeResponseSchema = exports.AuthorizationResponseSchema = exports.NewOrderResponseSchema = exports.NewAccountResponseSchema = exports.FederationCrossSignedCertificatesResponseSchema = exports.CrlResponseSchema = exports.LocalCertificateRootResponseSchema = exports.DirectoryResponseSchema = exports.ResponseHeaderLocationSchema = exports.ResponseHeaderNonceSchema = void 0;
|
|
22
22
|
const zod_1 = require("zod");
|
|
23
23
|
const nonOptionalString = zod_1.z.string().min(1);
|
|
24
24
|
const nonOptionalUrl = zod_1.z.string().url().min(1);
|
|
@@ -36,6 +36,10 @@ exports.DirectoryResponseSchema = zod_1.z.object({
|
|
|
36
36
|
keyChange: nonOptionalUrl,
|
|
37
37
|
});
|
|
38
38
|
exports.LocalCertificateRootResponseSchema = nonOptionalString;
|
|
39
|
+
exports.CrlResponseSchema = zod_1.z.instanceof(ArrayBuffer).refine(arr => arr.byteLength > 0, {
|
|
40
|
+
message: 'CRL is empty',
|
|
41
|
+
});
|
|
42
|
+
exports.FederationCrossSignedCertificatesResponseSchema = zod_1.z.object({ crts: zod_1.z.array(nonOptionalString) });
|
|
39
43
|
exports.NewAccountResponseSchema = zod_1.z.object({
|
|
40
44
|
status: nonOptionalString,
|
|
41
45
|
orders: nonOptionalUrl,
|
|
@@ -1,15 +1,25 @@
|
|
|
1
1
|
import { QualifiedId } from '@wireapp/api-client/lib/user';
|
|
2
|
+
import { TypedEventEmitter } from '@wireapp/commons';
|
|
2
3
|
import { Ciphersuite, CoreCrypto, E2eiConversationState, WireIdentity, DeviceStatus } from '@wireapp/core-crypto';
|
|
3
4
|
import { ClientService } from '../../../client';
|
|
5
|
+
import { CoreDatabase } from '../../../storage/CoreDB';
|
|
6
|
+
import { RecurringTaskScheduler } from '../../../util/RecurringTaskScheduler';
|
|
4
7
|
export type DeviceIdentity = Omit<WireIdentity, 'free' | 'status'> & {
|
|
5
8
|
status?: DeviceStatus;
|
|
6
9
|
deviceId: string;
|
|
7
10
|
};
|
|
8
|
-
|
|
11
|
+
type Events = {
|
|
12
|
+
remoteCrlChanged: undefined;
|
|
13
|
+
selfCrlChanged: undefined;
|
|
14
|
+
};
|
|
15
|
+
export declare class E2EIServiceExternal extends TypedEventEmitter<Events> {
|
|
9
16
|
private readonly coreCryptoClient;
|
|
17
|
+
private readonly coreDatabase;
|
|
18
|
+
private readonly recurringTaskScheduler;
|
|
10
19
|
private readonly clientService;
|
|
11
20
|
private readonly cipherSuite;
|
|
12
|
-
|
|
21
|
+
private _acmeService?;
|
|
22
|
+
constructor(coreCryptoClient: CoreCrypto, coreDatabase: CoreDatabase, recurringTaskScheduler: RecurringTaskScheduler, clientService: ClientService, cipherSuite: Ciphersuite);
|
|
13
23
|
isEnrollmentInProgress(): boolean;
|
|
14
24
|
clearAllProgress(): void;
|
|
15
25
|
getConversationState(conversationId: Uint8Array): Promise<E2eiConversationState>;
|
|
@@ -18,6 +28,9 @@ export declare class E2EIServiceExternal {
|
|
|
18
28
|
getDevicesIdentities(groupId: string, userClientsMap: Record<string, QualifiedId>): Promise<DeviceIdentity[]>;
|
|
19
29
|
isFreshMLSSelfClient(): Promise<boolean>;
|
|
20
30
|
private registerLocalCertificateRoot;
|
|
31
|
+
initialize(discoveryUrl: string): Promise<void>;
|
|
32
|
+
private get acmeService();
|
|
33
|
+
private registerCrossSignedCertificates;
|
|
21
34
|
/**
|
|
22
35
|
* This function is used to register different server certificates in CoreCrypto.
|
|
23
36
|
*
|
|
@@ -33,6 +46,16 @@ export declare class E2EIServiceExternal {
|
|
|
33
46
|
*
|
|
34
47
|
* @param discoveryUrl
|
|
35
48
|
*/
|
|
36
|
-
registerServerCertificates(
|
|
49
|
+
registerServerCertificates(): Promise<void>;
|
|
50
|
+
getCRLFromDistributionPoint(distributionPointUrl: string): Promise<Uint8Array>;
|
|
51
|
+
private scheduleCrlDistributionTimer;
|
|
52
|
+
private initialiseCrlDistributionTimers;
|
|
53
|
+
private addCrlDistributionTimer;
|
|
54
|
+
private cancelCrlDistributionTimer;
|
|
55
|
+
validateSelfCrl(): Promise<void>;
|
|
56
|
+
private validateRemoteCrlDistributionPoint;
|
|
57
|
+
private validateCrl;
|
|
58
|
+
handleNewRemoteCrlDistributionPoints(distributionPoints: string[]): Promise<void>;
|
|
37
59
|
}
|
|
60
|
+
export {};
|
|
38
61
|
//# 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;
|
|
1
|
+
{"version":3,"file":"E2EIServiceExternal.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/mls/E2EIdentityService/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,OAAO,CAAC,OAAO,CAAC;IAI3B,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,cAAc,EAAE,CAAC,CAAC;IA6CnG,oBAAoB,CAC/B,OAAO,EAAE,MAAM,EACf,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,GAC1C,OAAO,CAAC,cAAc,EAAE,CAAC;IAef,oBAAoB,IAAI,OAAO,CAAC,OAAO,CAAC;YAQvC,4BAA4B;IAO7B,UAAU,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI5D,OAAO,KAAK,WAAW,GAKtB;YAEa,+BAA+B;IAK7C;;;;;;;;;;;;;;OAcG;IACU,0BAA0B,IAAI,OAAO,CAAC,IAAI,CAAC;IA6B3C,2BAA2B,CAAC,oBAAoB,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAI3F,OAAO,CAAC,4BAA4B;YAStB,+BAA+B;YAQ/B,uBAAuB;YAKvB,0BAA0B;IAI3B,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;YAQ/B,kCAAkC;YASlC,WAAW;IAgBZ,oCAAoC,CAAC,kBAAkB,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAK/F"}
|
|
@@ -19,18 +19,25 @@
|
|
|
19
19
|
*/
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
21
|
exports.E2EIServiceExternal = void 0;
|
|
22
|
+
const TimeUtil_1 = require("@wireapp/commons/lib/util/TimeUtil");
|
|
22
23
|
const bazinga64_1 = require("bazinga64");
|
|
24
|
+
const commons_1 = require("@wireapp/commons");
|
|
23
25
|
const Connection_1 = require("./Connection");
|
|
24
26
|
const Helper_1 = require("./Helper");
|
|
25
27
|
const E2EIStorage_1 = require("./Storage/E2EIStorage");
|
|
26
28
|
const fullyQualifiedClientIdUtils_1 = require("../../../util/fullyQualifiedClientIdUtils");
|
|
27
29
|
const LocalStorageStore_1 = require("../../../util/LocalStorageStore");
|
|
30
|
+
const LowPrecisionTaskScheduler_1 = require("../../../util/LowPrecisionTaskScheduler");
|
|
28
31
|
// This export is meant to be accessible from the outside (e.g the Webapp / UI)
|
|
29
|
-
class E2EIServiceExternal {
|
|
30
|
-
constructor(coreCryptoClient, clientService, cipherSuite) {
|
|
32
|
+
class E2EIServiceExternal extends commons_1.TypedEventEmitter {
|
|
33
|
+
constructor(coreCryptoClient, coreDatabase, recurringTaskScheduler, clientService, cipherSuite) {
|
|
34
|
+
super();
|
|
31
35
|
this.coreCryptoClient = coreCryptoClient;
|
|
36
|
+
this.coreDatabase = coreDatabase;
|
|
37
|
+
this.recurringTaskScheduler = recurringTaskScheduler;
|
|
32
38
|
this.clientService = clientService;
|
|
33
39
|
this.cipherSuite = cipherSuite;
|
|
40
|
+
void this.initialiseCrlDistributionTimers();
|
|
34
41
|
}
|
|
35
42
|
// If we have a handle in the local storage, we are in the enrollment process (this handle is saved before oauth redirect)
|
|
36
43
|
isEnrollmentInProgress() {
|
|
@@ -80,11 +87,24 @@ class E2EIServiceExternal {
|
|
|
80
87
|
}
|
|
81
88
|
return typeof client.mls_public_keys.ed25519 !== 'string' || client.mls_public_keys.ed25519.length === 0;
|
|
82
89
|
}
|
|
83
|
-
async registerLocalCertificateRoot(
|
|
84
|
-
const localCertificateRoot = await
|
|
90
|
+
async registerLocalCertificateRoot(acmeService) {
|
|
91
|
+
const localCertificateRoot = await acmeService.getLocalCertificateRoot();
|
|
85
92
|
await this.coreCryptoClient.e2eiRegisterAcmeCA(localCertificateRoot);
|
|
86
93
|
return localCertificateRoot;
|
|
87
94
|
}
|
|
95
|
+
async initialize(discoveryUrl) {
|
|
96
|
+
this._acmeService = new Connection_1.AcmeService(discoveryUrl);
|
|
97
|
+
}
|
|
98
|
+
get acmeService() {
|
|
99
|
+
if (!this._acmeService) {
|
|
100
|
+
throw new Error('AcmeService not initialized');
|
|
101
|
+
}
|
|
102
|
+
return this._acmeService;
|
|
103
|
+
}
|
|
104
|
+
async registerCrossSignedCertificates(acmeService) {
|
|
105
|
+
const certificates = await acmeService.getFederationCrossSignedCertificates();
|
|
106
|
+
await Promise.all(certificates.map(cert => this.coreCryptoClient.e2eiRegisterIntermediateCA(cert)));
|
|
107
|
+
}
|
|
88
108
|
/**
|
|
89
109
|
* This function is used to register different server certificates in CoreCrypto.
|
|
90
110
|
*
|
|
@@ -100,21 +120,81 @@ class E2EIServiceExternal {
|
|
|
100
120
|
*
|
|
101
121
|
* @param discoveryUrl
|
|
102
122
|
*/
|
|
103
|
-
async registerServerCertificates(
|
|
123
|
+
async registerServerCertificates() {
|
|
104
124
|
const ROOT_CA_KEY = 'e2ei_root-registered';
|
|
105
125
|
const store = (0, LocalStorageStore_1.LocalStorageStore)(ROOT_CA_KEY);
|
|
106
|
-
const acmeService = new Connection_1.AcmeService(discoveryUrl);
|
|
107
126
|
// Register root certificate if not already registered
|
|
108
127
|
if (!store.has(ROOT_CA_KEY)) {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
store.add(ROOT_CA_KEY, 'true');
|
|
112
|
-
}
|
|
113
|
-
catch (error) {
|
|
114
|
-
console.error('Failed to register root certificate', error);
|
|
115
|
-
}
|
|
128
|
+
await this.registerLocalCertificateRoot(this.acmeService);
|
|
129
|
+
store.add(ROOT_CA_KEY, 'true');
|
|
116
130
|
}
|
|
117
131
|
// Register intermediate certificate and update it every 24 hours
|
|
132
|
+
const INTERMEDIATE_CA_KEY = 'update-intermediate-certificates';
|
|
133
|
+
const hasPendingTask = await this.recurringTaskScheduler.hasTask(INTERMEDIATE_CA_KEY);
|
|
134
|
+
const task = () => this.registerCrossSignedCertificates(this.acmeService);
|
|
135
|
+
// If the task was never registered, we run it once, and then register it to run every 24 hours
|
|
136
|
+
if (!hasPendingTask) {
|
|
137
|
+
await task();
|
|
138
|
+
}
|
|
139
|
+
await this.recurringTaskScheduler.registerTask({
|
|
140
|
+
every: TimeUtil_1.TimeInMillis.DAY,
|
|
141
|
+
key: INTERMEDIATE_CA_KEY,
|
|
142
|
+
task,
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
async getCRLFromDistributionPoint(distributionPointUrl) {
|
|
146
|
+
return this.acmeService.getCRLFromDistributionPoint(distributionPointUrl);
|
|
147
|
+
}
|
|
148
|
+
scheduleCrlDistributionTimer({ expiresAt, url }) {
|
|
149
|
+
LowPrecisionTaskScheduler_1.LowPrecisionTaskScheduler.addTask({
|
|
150
|
+
intervalDelay: TimeUtil_1.TimeInMillis.SECOND,
|
|
151
|
+
firingDate: expiresAt,
|
|
152
|
+
key: url,
|
|
153
|
+
task: () => this.validateRemoteCrlDistributionPoint(url),
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
async initialiseCrlDistributionTimers() {
|
|
157
|
+
const crls = await this.coreDatabase.getAll('crls');
|
|
158
|
+
for (const crl of crls) {
|
|
159
|
+
this.scheduleCrlDistributionTimer(crl);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
async addCrlDistributionTimer({ expiresAt, url }) {
|
|
163
|
+
await this.coreDatabase.add('crls', { expiresAt, url }, url);
|
|
164
|
+
this.scheduleCrlDistributionTimer({ expiresAt, url });
|
|
165
|
+
}
|
|
166
|
+
async cancelCrlDistributionTimer(url) {
|
|
167
|
+
await this.coreDatabase.delete('crls', url);
|
|
168
|
+
}
|
|
169
|
+
async validateSelfCrl() {
|
|
170
|
+
const { crl, url } = await this.acmeService.getSelfCRL();
|
|
171
|
+
await this.validateCrl(url, crl, async () => {
|
|
172
|
+
this.emit('selfCrlChanged');
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
async validateRemoteCrlDistributionPoint(distributionPointUrl) {
|
|
176
|
+
const domain = new URL(distributionPointUrl).hostname;
|
|
177
|
+
const crl = await this.getCRLFromDistributionPoint(domain);
|
|
178
|
+
await this.validateCrl(distributionPointUrl, crl, async () => {
|
|
179
|
+
this.emit('remoteCrlChanged');
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
async validateCrl(url, crl, onDirty) {
|
|
183
|
+
const { expiration, dirty } = await this.coreCryptoClient.e2eiRegisterCRL(url, crl);
|
|
184
|
+
await this.cancelCrlDistributionTimer(url);
|
|
185
|
+
//set a new timer that will execute a task once the CRL is expired
|
|
186
|
+
if (expiration) {
|
|
187
|
+
await this.addCrlDistributionTimer({ expiresAt: expiration, url });
|
|
188
|
+
}
|
|
189
|
+
//if it was dirty, trigger e2eiconversationstate for every conversation
|
|
190
|
+
if (dirty) {
|
|
191
|
+
await onDirty();
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
async handleNewRemoteCrlDistributionPoints(distributionPoints) {
|
|
195
|
+
for (const distributionPointUrl of distributionPoints) {
|
|
196
|
+
await this.validateRemoteCrlDistributionPoint(distributionPointUrl);
|
|
197
|
+
}
|
|
118
198
|
}
|
|
119
199
|
}
|
|
120
200
|
exports.E2EIServiceExternal = E2EIServiceExternal;
|
|
@@ -20,15 +20,25 @@
|
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
21
|
const core_crypto_1 = require("@wireapp/core-crypto");
|
|
22
22
|
const E2EIServiceExternal_1 = require("./E2EIServiceExternal");
|
|
23
|
+
const CoreDB_1 = require("../../../storage/CoreDB");
|
|
23
24
|
const PayloadHelper_1 = require("../../../test/PayloadHelper");
|
|
24
|
-
|
|
25
|
+
const RecurringTaskScheduler_1 = require("../../../util/RecurringTaskScheduler");
|
|
26
|
+
async function buildE2EIService() {
|
|
25
27
|
const coreCrypto = {
|
|
26
28
|
getUserIdentities: jest.fn(),
|
|
27
29
|
getClientIds: jest.fn().mockResolvedValue([]),
|
|
28
30
|
};
|
|
29
31
|
const clientService = {};
|
|
32
|
+
const mockedDb = await (0, CoreDB_1.openDB)('core-test-db');
|
|
33
|
+
const recurringTaskScheduler = new RecurringTaskScheduler_1.RecurringTaskScheduler({
|
|
34
|
+
delete: key => mockedDb.delete('recurringTasks', key),
|
|
35
|
+
get: async (key) => { var _a; return (_a = (await mockedDb.get('recurringTasks', key))) === null || _a === void 0 ? void 0 : _a.firingDate; },
|
|
36
|
+
set: async (key, timestamp) => {
|
|
37
|
+
await mockedDb.put('recurringTasks', { key, firingDate: timestamp });
|
|
38
|
+
},
|
|
39
|
+
});
|
|
30
40
|
return [
|
|
31
|
-
new E2EIServiceExternal_1.E2EIServiceExternal(coreCrypto, clientService, core_crypto_1.Ciphersuite.MLS_128_DHKEMP256_AES128GCM_SHA256_P256),
|
|
41
|
+
new E2EIServiceExternal_1.E2EIServiceExternal(coreCrypto, mockedDb, recurringTaskScheduler, clientService, core_crypto_1.Ciphersuite.MLS_128_DHKEMP256_AES128GCM_SHA256_P256),
|
|
32
42
|
{ coreCrypto },
|
|
33
43
|
];
|
|
34
44
|
}
|
|
@@ -47,7 +57,7 @@ const groupId = 'AAEAAhJrE+8TbFFUqiagedTYDUMAZWxuYS53aXJlLmxpbms=';
|
|
|
47
57
|
describe('E2EIServiceExternal', () => {
|
|
48
58
|
describe('getUsersIdentities', () => {
|
|
49
59
|
it('returns the user identities', async () => {
|
|
50
|
-
const [service, { coreCrypto }] = buildE2EIService();
|
|
60
|
+
const [service, { coreCrypto }] = await buildE2EIService();
|
|
51
61
|
const user1 = { domain: 'elna.wire.link', id: '48a1c3b0-4b0e-4bcd-93ad-64c7344b1534' };
|
|
52
62
|
const user2 = { domain: 'elna.wire.link', id: 'b7d287e4-7bbd-40e0-a550-6b18dcaf5f31' };
|
|
53
63
|
const userIds = [user1, user2];
|
|
@@ -60,7 +70,7 @@ describe('E2EIServiceExternal', () => {
|
|
|
60
70
|
expect(userIdentities.get(user2.id)).toHaveLength(1);
|
|
61
71
|
});
|
|
62
72
|
it('returns MLS basic devices with empty identity', async () => {
|
|
63
|
-
const [service, { coreCrypto }] = buildE2EIService();
|
|
73
|
+
const [service, { coreCrypto }] = await buildE2EIService();
|
|
64
74
|
const user1 = { domain: 'elna.wire.link', id: '48a1c3b0-4b0e-4bcd-93ad-64c7344b1534' };
|
|
65
75
|
const user2 = { domain: 'elna.wire.link', id: 'b7d287e4-7bbd-40e0-a550-6b18dcaf5f31' };
|
|
66
76
|
const userIds = [user1, user2];
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
import { TypedEventEmitter } from '@wireapp/commons';
|
|
1
2
|
import { InitParams, RotateBundle } from './E2EIService.types';
|
|
2
|
-
|
|
3
|
+
type Events = {
|
|
4
|
+
newCrlDistributionPoints: string[];
|
|
5
|
+
};
|
|
6
|
+
export declare class E2EIServiceInternal extends TypedEventEmitter<Events> {
|
|
3
7
|
private static instance;
|
|
4
8
|
private readonly logger;
|
|
5
9
|
private readonly coreCryptoClient;
|
|
@@ -59,6 +63,11 @@ export declare class E2EIServiceInternal {
|
|
|
59
63
|
* @param oAuthIdToken
|
|
60
64
|
* @returns
|
|
61
65
|
*/
|
|
62
|
-
startRefreshCertficateFlow(oAuthIdToken: string, hasActiveCertificate: boolean): Promise<
|
|
66
|
+
startRefreshCertficateFlow(oAuthIdToken: string, hasActiveCertificate: boolean): Promise<{
|
|
67
|
+
commits: Map<string, import("@wireapp/core-crypto").CommitBundle>;
|
|
68
|
+
newKeyPackages: Uint8Array[];
|
|
69
|
+
keyPackageRefsToRemove: Uint8Array[];
|
|
70
|
+
}>;
|
|
63
71
|
}
|
|
72
|
+
export {};
|
|
64
73
|
//# 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":"AAuBA,OAAO,EAAC,iBAAiB,EAAC,MAAM,kBAAkB,C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
+
var t = {};
|
|
22
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
23
|
+
t[p] = s[p];
|
|
24
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
25
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
26
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
27
|
+
t[p[i]] = s[p[i]];
|
|
28
|
+
}
|
|
29
|
+
return t;
|
|
30
|
+
};
|
|
20
31
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
21
32
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
22
33
|
};
|
|
@@ -24,6 +35,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
24
35
|
exports.E2EIServiceInternal = void 0;
|
|
25
36
|
const bazinga64_1 = require("bazinga64");
|
|
26
37
|
const logdown_1 = __importDefault(require("logdown"));
|
|
38
|
+
const commons_1 = require("@wireapp/commons");
|
|
27
39
|
const AcmeServer_1 = require("./Connection/AcmeServer");
|
|
28
40
|
const E2EIService_types_1 = require("./E2EIService.types");
|
|
29
41
|
const Helper_1 = require("./Helper");
|
|
@@ -34,8 +46,9 @@ const DpopChallenge_1 = require("./Steps/DpopChallenge");
|
|
|
34
46
|
const OidcChallenge_1 = require("./Steps/OidcChallenge");
|
|
35
47
|
const Order_1 = require("./Steps/Order");
|
|
36
48
|
const E2EIStorage_1 = require("./Storage/E2EIStorage");
|
|
37
|
-
class E2EIServiceInternal {
|
|
49
|
+
class E2EIServiceInternal extends commons_1.TypedEventEmitter {
|
|
38
50
|
constructor(coreCryptClient, apiClient, e2eiServiceExternal, keyPackagesAmount = 100) {
|
|
51
|
+
super();
|
|
39
52
|
this.logger = (0, logdown_1.default)('@wireapp/core/E2EIdentityServiceInternal');
|
|
40
53
|
this.isInitialized = false;
|
|
41
54
|
this.coreCryptoClient = coreCryptClient;
|
|
@@ -174,7 +187,6 @@ class E2EIServiceInternal {
|
|
|
174
187
|
}
|
|
175
188
|
// Step 7: Do OIDC client challenge
|
|
176
189
|
const oidcData = await (0, OidcChallenge_1.doWireOidcChallenge)({
|
|
177
|
-
coreCryptoClient: this.coreCryptoClient,
|
|
178
190
|
oAuthIdToken,
|
|
179
191
|
authData,
|
|
180
192
|
connection: this.acmeService,
|
|
@@ -223,7 +235,11 @@ class E2EIServiceInternal {
|
|
|
223
235
|
throw new Error('Error while trying to continue OAuth flow. No certificate received');
|
|
224
236
|
}
|
|
225
237
|
// Step 10: Initialize MLS with the certificate
|
|
226
|
-
|
|
238
|
+
const _a = await this.coreCryptoClient.e2eiRotateAll(this.identity, certificate, this.keyPackagesAmount), { crlNewDistributionPoints } = _a, rotateBundle = __rest(_a, ["crlNewDistributionPoints"]);
|
|
239
|
+
if (crlNewDistributionPoints && crlNewDistributionPoints.length > 0) {
|
|
240
|
+
this.emit('newCrlDistributionPoints', crlNewDistributionPoints);
|
|
241
|
+
}
|
|
242
|
+
return rotateBundle;
|
|
227
243
|
}
|
|
228
244
|
/**
|
|
229
245
|
* This function starts a new ACME enrollment flow for either a new client
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { AcmeService } from '../Connection/AcmeServer';
|
|
2
|
-
import {
|
|
2
|
+
import { E2eiEnrollment, Nonce } from '../E2EIService.types';
|
|
3
3
|
import { AuthData } from '../Storage/E2EIStorage.schema';
|
|
4
4
|
interface DoWireOidcChallengeParams {
|
|
5
|
-
coreCryptoClient: CoreCrypto;
|
|
6
5
|
authData: AuthData;
|
|
7
6
|
identity: E2eiEnrollment;
|
|
8
7
|
connection: AcmeService;
|
|
9
8
|
nonce: Nonce;
|
|
10
9
|
oAuthIdToken: string;
|
|
11
10
|
}
|
|
12
|
-
export declare const doWireOidcChallenge: ({
|
|
11
|
+
export declare const doWireOidcChallenge: ({ connection, authData, identity, nonce, oAuthIdToken, }: DoWireOidcChallengeParams) => Promise<import("../Connection/AcmeServer/AcmeService.types").PostJoseRequestReturnValue<{
|
|
13
12
|
type: string;
|
|
14
13
|
url: string;
|
|
15
14
|
target: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OidcChallenge.d.ts","sourceRoot":"","sources":["../../../../../src/messagingProtocols/mls/E2EIdentityService/Steps/OidcChallenge.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAC,WAAW,EAAC,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"OidcChallenge.d.ts","sourceRoot":"","sources":["../../../../../src/messagingProtocols/mls/E2EIdentityService/Steps/OidcChallenge.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAC,WAAW,EAAC,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAC,cAAc,EAAE,KAAK,EAAC,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAC,QAAQ,EAAC,MAAM,+BAA+B,CAAC;AAEvD,UAAU,yBAAyB;IACjC,QAAQ,EAAE,QAAQ,CAAC;IACnB,QAAQ,EAAE,cAAc,CAAC;IACzB,UAAU,EAAE,WAAW,CAAC;IACxB,KAAK,EAAE,KAAK,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,mBAAmB,6DAM7B,yBAAyB;;;;;;;;;;;GAiB3B,CAAC"}
|
|
@@ -20,18 +20,17 @@
|
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
21
|
exports.doWireOidcChallenge = void 0;
|
|
22
22
|
const bazinga64_1 = require("bazinga64");
|
|
23
|
-
const doWireOidcChallenge = async ({
|
|
23
|
+
const doWireOidcChallenge = async ({ connection, authData, identity, nonce, oAuthIdToken, }) => {
|
|
24
24
|
const { oidcChallenge } = authData.authorization;
|
|
25
25
|
if (!oidcChallenge) {
|
|
26
26
|
throw new Error('No wireOIDCChallenge defined');
|
|
27
27
|
}
|
|
28
|
-
const
|
|
29
|
-
const reqBody = await identity.newOidcChallengeRequest(oAuthIdToken, refreshToken, nonce);
|
|
28
|
+
const reqBody = await identity.newOidcChallengeRequest(oAuthIdToken, nonce);
|
|
30
29
|
const oidcChallengeResponse = await connection.validateOidcChallenge(oidcChallenge.url, reqBody);
|
|
31
30
|
if (!oidcChallengeResponse) {
|
|
32
31
|
throw new Error('No response received while validating OIDC challenge');
|
|
33
32
|
}
|
|
34
|
-
await identity.newOidcChallengeResponse(
|
|
33
|
+
await identity.newOidcChallengeResponse(bazinga64_1.Converter.stringToArrayBufferViewUTF8(JSON.stringify(oidcChallengeResponse.data)));
|
|
35
34
|
return oidcChallengeResponse;
|
|
36
35
|
};
|
|
37
36
|
exports.doWireOidcChallenge = doWireOidcChallenge;
|
|
@@ -63,7 +63,9 @@ describe('handleMLSMessageAdd', () => {
|
|
|
63
63
|
const mockGroupId = 'AAEAAH87aajaQ011i+rNLmwpy0sAZGl5YS53aXJlLmxpbms=';
|
|
64
64
|
const message = createMockedMessage();
|
|
65
65
|
jest.spyOn(mockedMLSService, 'decryptMessage').mockResolvedValueOnce({
|
|
66
|
-
proposals: [
|
|
66
|
+
proposals: [
|
|
67
|
+
{ proposal: new Uint8Array(), proposalRef: new Uint8Array(), free: () => { }, crlNewDistributionPoints: [] },
|
|
68
|
+
],
|
|
67
69
|
commitDelay: 2000,
|
|
68
70
|
message,
|
|
69
71
|
hasEpochChanged: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MLSService.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/mls/MLSService/MLSService.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAqB,gBAAgB,EAAC,MAAM,gCAAgC,CAAC;AACzF,OAAO,EAAC,sBAAsB,EAAE,kBAAkB,EAAC,MAAM,sCAAsC,CAAC;AAChG,OAAO,EAAC,8BAA8B,EAAE,2BAA2B,EAAC,MAAM,+BAA+B,CAAC;AAE1G,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAEzD,OAA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AM,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,mBAAmB,EAAE,mBAAmB,EACxC,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,gBAAgB,EACxB,SAAS,EAAE,MAAM,EACjB,YAAY,CAAC,EAAE,MAAM,GACpB,OAAO,CAAC,sBAAsB,CAAC;CAmEnC"}
|
|
@@ -182,7 +182,13 @@ class MLSService extends commons_1.TypedEventEmitter {
|
|
|
182
182
|
if (keyPackages.length < 1) {
|
|
183
183
|
throw new Error('Empty list of keys provided to addUsersToExistingConversation');
|
|
184
184
|
}
|
|
185
|
-
return this.processCommitAction(groupIdBytes, () =>
|
|
185
|
+
return this.processCommitAction(groupIdBytes, async () => {
|
|
186
|
+
const _a = await this.coreCryptoClient.addClientsToConversation(groupIdBytes, keyPackages), { crlNewDistributionPoints } = _a, commitBundle = __rest(_a, ["crlNewDistributionPoints"]);
|
|
187
|
+
if (crlNewDistributionPoints && crlNewDistributionPoints.length > 0) {
|
|
188
|
+
this.emit('newCrlDistributionPoints', crlNewDistributionPoints);
|
|
189
|
+
}
|
|
190
|
+
return commitBundle;
|
|
191
|
+
});
|
|
186
192
|
}
|
|
187
193
|
async getKeyPackagesPayload(qualifiedUsers) {
|
|
188
194
|
/**
|
|
@@ -230,7 +236,10 @@ class MLSService extends commons_1.TypedEventEmitter {
|
|
|
230
236
|
const credentialType = await this.getCredentialType();
|
|
231
237
|
const generateCommit = async () => {
|
|
232
238
|
const groupInfo = await getGroupInfo();
|
|
233
|
-
const _a = await this.coreCryptoClient.joinByExternalCommit(groupInfo, credentialType), { conversationId } = _a, commitBundle = __rest(_a, ["conversationId"]);
|
|
239
|
+
const _a = await this.coreCryptoClient.joinByExternalCommit(groupInfo, credentialType), { conversationId, crlNewDistributionPoints } = _a, commitBundle = __rest(_a, ["conversationId", "crlNewDistributionPoints"]);
|
|
240
|
+
if (crlNewDistributionPoints && crlNewDistributionPoints.length > 0) {
|
|
241
|
+
this.emit('newCrlDistributionPoints', crlNewDistributionPoints);
|
|
242
|
+
}
|
|
234
243
|
return { groupId: conversationId, commitBundle };
|
|
235
244
|
};
|
|
236
245
|
const { commitBundle, groupId } = await generateCommit();
|
|
@@ -251,11 +260,21 @@ class MLSService extends commons_1.TypedEventEmitter {
|
|
|
251
260
|
return bazinga64_1.Encoder.toBase64(key).asString;
|
|
252
261
|
}
|
|
253
262
|
async processWelcomeMessage(welcomeMessage) {
|
|
254
|
-
|
|
263
|
+
const response = await this.coreCryptoClient.processWelcomeMessage(welcomeMessage);
|
|
264
|
+
//FIXME: this is temporary (it should be camel case), we wait for the update from core-crypto side
|
|
265
|
+
const { id, crl_new_distribution_points: crlNewDistributionPoints } = response;
|
|
266
|
+
if (crlNewDistributionPoints && crlNewDistributionPoints.length > 0) {
|
|
267
|
+
this.emit('newCrlDistributionPoints', crlNewDistributionPoints);
|
|
268
|
+
}
|
|
269
|
+
return id;
|
|
255
270
|
}
|
|
256
271
|
async decryptMessage(conversationId, payload) {
|
|
257
272
|
try {
|
|
258
273
|
const decryptedMessage = await this.coreCryptoClient.decryptMessage(conversationId, payload);
|
|
274
|
+
const { crlNewDistributionPoints } = decryptedMessage;
|
|
275
|
+
if (crlNewDistributionPoints && crlNewDistributionPoints.length > 0) {
|
|
276
|
+
this.emit('newCrlDistributionPoints', crlNewDistributionPoints);
|
|
277
|
+
}
|
|
259
278
|
return decryptedMessage;
|
|
260
279
|
}
|
|
261
280
|
catch (error) {
|
|
@@ -632,6 +651,9 @@ class MLSService extends commons_1.TypedEventEmitter {
|
|
|
632
651
|
discoveryUrl,
|
|
633
652
|
keyPackagesAmount: nbPrekeys,
|
|
634
653
|
});
|
|
654
|
+
instance.on('newCrlDistributionPoints', crlDistributionPoints => {
|
|
655
|
+
this.emit('newCrlDistributionPoints', crlDistributionPoints);
|
|
656
|
+
});
|
|
635
657
|
// If we don't have an OAuth id token, we need to start the certificate process with Oauth
|
|
636
658
|
if (!oAuthIdToken) {
|
|
637
659
|
const data = await instance.startCertificateProcess(hasActiveCertificate);
|
|
@@ -262,7 +262,9 @@ describe('MLSService', () => {
|
|
|
262
262
|
jest.spyOn(apiClient.api.client, 'getMLSKeyPackageCount').mockResolvedValueOnce(numberOfKeysBelowThreshold);
|
|
263
263
|
jest.spyOn(coreCrypto, 'clientValidKeypackagesCount').mockResolvedValueOnce(numberOfKeysBelowThreshold);
|
|
264
264
|
jest.spyOn(apiClient.api.client, 'uploadMLSKeyPackages').mockResolvedValueOnce(undefined);
|
|
265
|
-
jest
|
|
265
|
+
jest
|
|
266
|
+
.spyOn(coreCrypto, 'processWelcomeMessage')
|
|
267
|
+
.mockResolvedValueOnce({ id: new Uint8Array(), crlNewDistributionPoints: [], free: () => { } });
|
|
266
268
|
jest.spyOn(mlsService, 'scheduleKeyMaterialRenewal').mockImplementation(jest.fn());
|
|
267
269
|
const mockedMLSWelcomeEvent = {
|
|
268
270
|
type: event_1.CONVERSATION_EVENT.MLS_WELCOME_MESSAGE,
|
|
@@ -286,7 +288,9 @@ describe('MLSService', () => {
|
|
|
286
288
|
jest.spyOn(coreCrypto, 'clientValidKeypackagesCount').mockResolvedValueOnce(numberOfKeysAboveThreshold);
|
|
287
289
|
jest.spyOn(apiClient.api.client, 'getMLSKeyPackageCount').mockResolvedValueOnce(numberOfKeysAboveThreshold);
|
|
288
290
|
jest.spyOn(apiClient.api.client, 'uploadMLSKeyPackages').mockResolvedValueOnce(undefined);
|
|
289
|
-
jest
|
|
291
|
+
jest
|
|
292
|
+
.spyOn(coreCrypto, 'processWelcomeMessage')
|
|
293
|
+
.mockResolvedValueOnce({ id: new Uint8Array(), crlNewDistributionPoints: [], free: () => { } });
|
|
290
294
|
jest.spyOn(mlsService, 'scheduleKeyMaterialRenewal').mockImplementation(jest.fn());
|
|
291
295
|
const mockedMLSWelcomeEvent = {
|
|
292
296
|
type: event_1.CONVERSATION_EVENT.MLS_WELCOME_MESSAGE,
|
|
@@ -311,7 +315,9 @@ describe('MLSService', () => {
|
|
|
311
315
|
jest.spyOn(coreCrypto, 'clientValidKeypackagesCount').mockResolvedValueOnce(numberOfKeysBelowThreshold);
|
|
312
316
|
jest.spyOn(apiClient.api.client, 'getMLSKeyPackageCount').mockResolvedValueOnce(numberOfKeysAboveThreshold);
|
|
313
317
|
jest.spyOn(apiClient.api.client, 'uploadMLSKeyPackages').mockResolvedValueOnce(undefined);
|
|
314
|
-
jest
|
|
318
|
+
jest
|
|
319
|
+
.spyOn(coreCrypto, 'processWelcomeMessage')
|
|
320
|
+
.mockResolvedValueOnce({ id: new Uint8Array(), crlNewDistributionPoints: [], free: () => { } });
|
|
315
321
|
jest.spyOn(mlsService, 'scheduleKeyMaterialRenewal').mockImplementation(jest.fn());
|
|
316
322
|
const mockedMLSWelcomeEvent = {
|
|
317
323
|
type: event_1.CONVERSATION_EVENT.MLS_WELCOME_MESSAGE,
|
package/lib/storage/CoreDB.d.ts
CHANGED
|
@@ -38,6 +38,13 @@ interface CoreDBSchema extends DBSchema {
|
|
|
38
38
|
groupId: string;
|
|
39
39
|
};
|
|
40
40
|
};
|
|
41
|
+
crls: {
|
|
42
|
+
key: string;
|
|
43
|
+
value: {
|
|
44
|
+
expiresAt: number;
|
|
45
|
+
url: string;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
41
48
|
}
|
|
42
49
|
export type CoreDatabase = IDBPDatabase<CoreDBSchema>;
|
|
43
50
|
export declare function openDB(dbName: string): Promise<CoreDatabase>;
|
|
@@ -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;CACH;AAED,MAAM,MAAM,YAAY,GAAG,YAAY,CAAC,YAAY,CAAC,CAAC;AAEtD,wBAAsB,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAqBlE;AAED,wBAAsB,QAAQ,CAAC,EAAE,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAE9D"}
|
package/lib/storage/CoreDB.js
CHANGED
|
@@ -13,6 +13,7 @@ export declare class RecurringTaskScheduler {
|
|
|
13
13
|
constructor(storage: RecurringTaskSchedulerStorage);
|
|
14
14
|
readonly registerTask: ({ every, task, key }: TaskParams) => Promise<void>;
|
|
15
15
|
readonly cancelTask: (taskKey: string) => Promise<void>;
|
|
16
|
+
readonly hasTask: (taskKey: string) => Promise<boolean>;
|
|
16
17
|
}
|
|
17
18
|
export {};
|
|
18
19
|
//# sourceMappingURL=RecurringTaskScheduler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RecurringTaskScheduler.d.ts","sourceRoot":"","sources":["../../../src/util/RecurringTaskScheduler/RecurringTaskScheduler.ts"],"names":[],"mappings":"AAwBA,UAAU,6BAA6B;IACrC,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACvD,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAClD,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACxC;AAED,UAAU,UAAU;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;IACvC,GAAG,EAAE,MAAM,CAAC;CACb;AAED,qBAAa,sBAAsB;IACrB,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,6BAA6B;IAEnE,SAAgB,YAAY,yBAA8B,UAAU,KAAG,QAAQ,IAAI,CAAC,CAwBlF;IAEF,SAAgB,UAAU,YAAmB,MAAM,KAAG,QAAQ,IAAI,CAAC,CAIjE;CACH"}
|
|
1
|
+
{"version":3,"file":"RecurringTaskScheduler.d.ts","sourceRoot":"","sources":["../../../src/util/RecurringTaskScheduler/RecurringTaskScheduler.ts"],"names":[],"mappings":"AAwBA,UAAU,6BAA6B;IACrC,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACvD,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAClD,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACxC;AAED,UAAU,UAAU;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;IACvC,GAAG,EAAE,MAAM,CAAC;CACb;AAED,qBAAa,sBAAsB;IACrB,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,6BAA6B;IAEnE,SAAgB,YAAY,yBAA8B,UAAU,KAAG,QAAQ,IAAI,CAAC,CAwBlF;IAEF,SAAgB,UAAU,YAAmB,MAAM,KAAG,QAAQ,IAAI,CAAC,CAIjE;IAEF,SAAgB,OAAO,YAAmB,MAAM,KAAG,QAAQ,OAAO,CAAC,CAEjE;CACH"}
|
|
@@ -55,6 +55,9 @@ class RecurringTaskScheduler {
|
|
|
55
55
|
TaskScheduler_1.TaskScheduler.cancelTask(taskKey);
|
|
56
56
|
LowPrecisionTaskScheduler_1.LowPrecisionTaskScheduler.cancelTask({ intervalDelay: commons_1.TimeUtil.TimeInMillis.MINUTE, key: taskKey });
|
|
57
57
|
};
|
|
58
|
+
this.hasTask = async (taskKey) => {
|
|
59
|
+
return !!(await this.storage.get(taskKey));
|
|
60
|
+
};
|
|
58
61
|
}
|
|
59
62
|
}
|
|
60
63
|
exports.RecurringTaskScheduler = RecurringTaskScheduler;
|
package/package.json
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"@wireapp/api-client": "^26.10.1",
|
|
15
15
|
"@wireapp/commons": "^5.2.4",
|
|
16
|
-
"@wireapp/core-crypto": "1.0.0-rc.
|
|
16
|
+
"@wireapp/core-crypto": "1.0.0-rc.34",
|
|
17
17
|
"@wireapp/cryptobox": "12.8.0",
|
|
18
18
|
"@wireapp/promise-queue": "^2.2.9",
|
|
19
19
|
"@wireapp/protocol-messaging": "1.44.0",
|
|
@@ -61,6 +61,6 @@
|
|
|
61
61
|
"test:coverage": "jest --coverage",
|
|
62
62
|
"watch": "tsc --watch"
|
|
63
63
|
},
|
|
64
|
-
"version": "43.
|
|
65
|
-
"gitHead": "
|
|
64
|
+
"version": "43.11.0",
|
|
65
|
+
"gitHead": "105c7f1f6861fa5e0d1be247e5366e91d5ba528d"
|
|
66
66
|
}
|