@wireapp/core 28.6.1 → 28.7.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/CHANGELOG.md +27 -0
- package/package.json +4 -4
- package/src/main/Account.d.ts +1 -1
- package/src/main/Account.js +8 -7
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,33 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [28.7.0](https://github.com/wireapp/wire-web-packages/tree/main/packages/core/compare/@wireapp/core@28.6.3...@wireapp/core@28.7.0) (2022-07-20)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **core:** update core-crypto and pass entropy to crypto-core ([#4336](https://github.com/wireapp/wire-web-packages/tree/main/packages/core/issues/4336)) ([0cc685f](https://github.com/wireapp/wire-web-packages/tree/main/packages/core/commit/0cc685f90ee7100b4930f9a59de4aece4ed62ba7))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [28.6.3](https://github.com/wireapp/wire-web-packages/tree/main/packages/core/compare/@wireapp/core@28.6.2...@wireapp/core@28.6.3) (2022-07-19)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @wireapp/core
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## [28.6.2](https://github.com/wireapp/wire-web-packages/tree/main/packages/core/compare/@wireapp/core@28.6.1...@wireapp/core@28.6.2) (2022-07-19)
|
|
26
|
+
|
|
27
|
+
**Note:** Version bump only for package @wireapp/core
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
6
33
|
## [28.6.1](https://github.com/wireapp/wire-web-packages/tree/main/packages/core/compare/@wireapp/core@28.6.0...@wireapp/core@28.6.1) (2022-07-18)
|
|
7
34
|
|
|
8
35
|
**Note:** Version bump only for package @wireapp/core
|
package/package.json
CHANGED
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
},
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@open-wc/webpack-import-meta-loader": "0.4.7",
|
|
7
|
-
"@otak/core-crypto": "0.3.0-beta-
|
|
7
|
+
"@otak/core-crypto": "0.3.0-beta-2",
|
|
8
8
|
"@types/long": "4.0.1",
|
|
9
9
|
"@types/node": "~14",
|
|
10
|
-
"@wireapp/api-client": "19.16.
|
|
10
|
+
"@wireapp/api-client": "19.16.1",
|
|
11
11
|
"@wireapp/commons": "4.3.0",
|
|
12
12
|
"@wireapp/cryptobox": "12.8.0",
|
|
13
13
|
"@wireapp/store-engine-dexie": "1.6.10",
|
|
@@ -77,6 +77,6 @@
|
|
|
77
77
|
"test:node": "nyc jasmine --config=jasmine.json",
|
|
78
78
|
"watch": "tsc ---watch"
|
|
79
79
|
},
|
|
80
|
-
"version": "28.
|
|
81
|
-
"gitHead": "
|
|
80
|
+
"version": "28.7.0",
|
|
81
|
+
"gitHead": "81ee05d7db9fafc791e28648cc6a859faa5398e3"
|
|
82
82
|
}
|
package/src/main/Account.d.ts
CHANGED
|
@@ -162,7 +162,7 @@ export declare class Account<T = any> extends EventEmitter {
|
|
|
162
162
|
localClient: RegisteredClient;
|
|
163
163
|
}>;
|
|
164
164
|
initServices(context: Context): Promise<void>;
|
|
165
|
-
loadAndValidateLocalClient(): Promise<RegisteredClient>;
|
|
165
|
+
loadAndValidateLocalClient(entropyData?: Uint8Array): Promise<RegisteredClient>;
|
|
166
166
|
private createMLSClient;
|
|
167
167
|
private registerClient;
|
|
168
168
|
private resetContext;
|
package/src/main/Account.js
CHANGED
|
@@ -178,7 +178,7 @@ class Account extends events_1.EventEmitter {
|
|
|
178
178
|
throw new Error('Services are not set.');
|
|
179
179
|
}
|
|
180
180
|
try {
|
|
181
|
-
const localClient = await this.loadAndValidateLocalClient();
|
|
181
|
+
const localClient = await this.loadAndValidateLocalClient(entropyData);
|
|
182
182
|
return { isNewClient: false, localClient };
|
|
183
183
|
}
|
|
184
184
|
catch (error) {
|
|
@@ -254,17 +254,17 @@ class Account extends events_1.EventEmitter {
|
|
|
254
254
|
user: userService,
|
|
255
255
|
};
|
|
256
256
|
}
|
|
257
|
-
async loadAndValidateLocalClient() {
|
|
257
|
+
async loadAndValidateLocalClient(entropyData) {
|
|
258
258
|
await this.service.cryptography.initCryptobox();
|
|
259
259
|
const loadedClient = await this.service.client.getLocalClient();
|
|
260
260
|
await this.apiClient.api.client.getClient(loadedClient.id);
|
|
261
261
|
this.apiClient.context.clientId = loadedClient.id;
|
|
262
262
|
if (this.mlsConfig) {
|
|
263
|
-
this.coreCryptoClient = await this.createMLSClient(loadedClient, this.apiClient.context, this.mlsConfig);
|
|
263
|
+
this.coreCryptoClient = await this.createMLSClient(loadedClient, this.apiClient.context, this.mlsConfig, entropyData);
|
|
264
264
|
}
|
|
265
265
|
return loadedClient;
|
|
266
266
|
}
|
|
267
|
-
async createMLSClient(client, context, mlsConfig) {
|
|
267
|
+
async createMLSClient(client, context, mlsConfig, entropyData) {
|
|
268
268
|
const coreCryptoKeyId = 'corecrypto-key';
|
|
269
269
|
const { CoreCrypto } = await Promise.resolve().then(() => __importStar(require('@otak/core-crypto')));
|
|
270
270
|
const dbName = `secrets-${this.generateDbName(context)}`;
|
|
@@ -282,6 +282,7 @@ class Account extends events_1.EventEmitter {
|
|
|
282
282
|
key: bazinga64_1.Encoder.toBase64(key).asString,
|
|
283
283
|
clientId: `${userId}:${client.id}@${domain}`,
|
|
284
284
|
wasmFilePath: mlsConfig.coreCrypoWasmFilePath,
|
|
285
|
+
entropySeed: entropyData,
|
|
285
286
|
});
|
|
286
287
|
}
|
|
287
288
|
async registerClient(loginData, clientInfo = coreDefaultClient, entropyData) {
|
|
@@ -291,8 +292,8 @@ class Account extends events_1.EventEmitter {
|
|
|
291
292
|
this.logger.info(`Creating new client {mls: ${!!this.mlsConfig}}`);
|
|
292
293
|
const registeredClient = await this.service.client.register(loginData, clientInfo, entropyData);
|
|
293
294
|
if (this.mlsConfig) {
|
|
294
|
-
this.coreCryptoClient = await this.createMLSClient(registeredClient, this.apiClient.context, this.mlsConfig);
|
|
295
|
-
await this.service.client.uploadMLSPublicKeys(this.coreCryptoClient.clientPublicKey(), registeredClient.id);
|
|
295
|
+
this.coreCryptoClient = await this.createMLSClient(registeredClient, this.apiClient.context, this.mlsConfig, entropyData);
|
|
296
|
+
await this.service.client.uploadMLSPublicKeys(await this.coreCryptoClient.clientPublicKey(), registeredClient.id);
|
|
296
297
|
await this.service.client.uploadMLSKeyPackages(await this.coreCryptoClient.clientKeypackages(this.nbPrekeys), registeredClient.id);
|
|
297
298
|
}
|
|
298
299
|
this.apiClient.context.clientId = registeredClient.id;
|
|
@@ -380,7 +381,7 @@ class Account extends events_1.EventEmitter {
|
|
|
380
381
|
}
|
|
381
382
|
generateDbName(context) {
|
|
382
383
|
const clientType = context.clientType === client_1.ClientType.NONE ? '' : `@${context.clientType}`;
|
|
383
|
-
return `wire@${this.apiClient.config.urls.name}@${context.userId}
|
|
384
|
+
return `wire@${this.apiClient.config.urls.name}@${context.userId}${clientType}`;
|
|
384
385
|
}
|
|
385
386
|
async initEngine(context) {
|
|
386
387
|
const dbName = this.generateDbName(context);
|