@wireapp/core 46.0.0 → 46.0.2
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.
|
@@ -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,EAAiB,MAAM,sBAAsB,CAAC;AAMnH,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAC,YAAY,EAAC,MAAM,yBAAyB,CAAC;AAGrD,OAAO,EAAC,sBAAsB,EAAuB,MAAM,+BAA+B,CAAC;AAC3F,OAAO,EAAC,sBAAsB,EAAC,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAEzC,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,YAAY,EAAE,MAAM,GAAG,QAAQ,CAAC,GAAG;IACnE,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,WAAW,CAAC;CAC9B,CAAC;AAEF,KAAK,MAAM,GAAG;IACZ,UAAU,EAAE;QAAC,MAAM,EAAE,MAAM,CAAA;KAAC,CAAC;CAC9B,CAAC;
|
|
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;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C,qBAAqB,CAAC;IAItF,aAAa,IAAI,OAAO,CAAC,OAAO,CAAC;IAI3B,0BAA0B,CACrC,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,GAAG,CAAC,sBAAsB,EAAE,cAAc,EAAE,CAAC,GAAG,SAAS,CAAC;IAsBxD,kBAAkB,CAC7B,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,WAAW,EAAE,GACrB,OAAO,CAAC,GAAG,CAAC,sBAAsB,EAAE,cAAc,EAAE,CAAC,GAAG,SAAS,CAAC;IAyDxD,oBAAoB,CAC/B,OAAO,EAAE,MAAM,EACf,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,GAC1C,OAAO,CAAC,cAAc,EAAE,CAAC;IAiBf,oBAAoB,IAAI,OAAO,CAAC,OAAO,CAAC;YAKvC,4BAA4B;IAO1C;;;;;OAKG;IACU,UAAU,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAM5D,OAAO,KAAK,WAAW,GAKtB;YAEa,+BAA+B;IAK7C;;;;;;;;;;;;OAYG;YACW,0BAA0B;IA2BxC,OAAO,CAAC,4BAA4B;YAStB,+BAA+B;YAQ/B,uBAAuB;YAKvB,0BAA0B;YAI1B,4BAA4B;YAO5B,WAAW;YAkBX,8BAA8B;CAM7C"}
|
|
@@ -29,22 +29,6 @@ const E2EIStorage_1 = require("./Storage/E2EIStorage");
|
|
|
29
29
|
const fullyQualifiedClientIdUtils_1 = require("../../../util/fullyQualifiedClientIdUtils");
|
|
30
30
|
const LowPrecisionTaskScheduler_1 = require("../../../util/LowPrecisionTaskScheduler");
|
|
31
31
|
const qualifiedIdUtil_1 = require("../../../util/qualifiedIdUtil");
|
|
32
|
-
// TODO coreCrypto types are wrong here. They return a string (the key of the enum) instead of the enum value
|
|
33
|
-
function fixDeviceStatus(value) {
|
|
34
|
-
const fixedValue = core_crypto_1.DeviceStatus[value];
|
|
35
|
-
if (!fixedValue) {
|
|
36
|
-
throw new Error(`Invalid device status: ${value}`);
|
|
37
|
-
}
|
|
38
|
-
return fixedValue;
|
|
39
|
-
}
|
|
40
|
-
// TODO coreCrypto types are wrong here. They return a string (the key of the enum) instead of the enum value
|
|
41
|
-
function fixConversationState(value) {
|
|
42
|
-
const fixedValue = core_crypto_1.E2eiConversationState[value];
|
|
43
|
-
if (!fixedValue) {
|
|
44
|
-
throw new Error(`Invalid conversation status: ${value}`);
|
|
45
|
-
}
|
|
46
|
-
return fixedValue;
|
|
47
|
-
}
|
|
48
32
|
// This export is meant to be accessible from the outside (e.g the Webapp / UI)
|
|
49
33
|
class E2EIServiceExternal extends commons_1.TypedEventEmitter {
|
|
50
34
|
constructor(coreCryptoClient, coreDatabase, recurringTaskScheduler, clientService, mlsService) {
|
|
@@ -66,8 +50,7 @@ class E2EIServiceExternal extends commons_1.TypedEventEmitter {
|
|
|
66
50
|
return this.enrollmentStorage.deletePendingEnrollmentData();
|
|
67
51
|
}
|
|
68
52
|
async getConversationState(conversationId) {
|
|
69
|
-
|
|
70
|
-
return fixConversationState(state);
|
|
53
|
+
return this.coreCryptoClient.e2eiConversationState(conversationId);
|
|
71
54
|
}
|
|
72
55
|
isE2EIEnabled() {
|
|
73
56
|
return this.coreCryptoClient.e2eiIsEnabled(this.mlsService.config.defaultCiphersuite);
|
|
@@ -101,7 +84,7 @@ class E2EIServiceExternal extends commons_1.TypedEventEmitter {
|
|
|
101
84
|
.map(fullyQualifiedId => (0, fullyQualifiedClientIdUtils_1.parseFullQualifiedClientId)(fullyQualifiedId));
|
|
102
85
|
const mappedUserIdentities = new Map();
|
|
103
86
|
for (const userId of userIds) {
|
|
104
|
-
const identities = (userIdentities.get(userId.id) || []).map(identity => (Object.assign(Object.assign({}, identity), {
|
|
87
|
+
const identities = (userIdentities.get(userId.id) || []).map(identity => (Object.assign(Object.assign({}, identity), { deviceId: (0, fullyQualifiedClientIdUtils_1.parseFullQualifiedClientId)(identity.clientId).client, qualifiedUserId: userId })));
|
|
105
88
|
const basicMLSDevices = allUsersMLSDevices
|
|
106
89
|
.filter(({ user }) => user === userId.id)
|
|
107
90
|
// filtering devices that have a valid identity
|
|
@@ -116,7 +99,7 @@ class E2EIServiceExternal extends commons_1.TypedEventEmitter {
|
|
|
116
99
|
async getDevicesIdentities(groupId, userClientsMap) {
|
|
117
100
|
const clientIds = Object.entries(userClientsMap).map(([clientId, userId]) => (0, Helper_1.getE2EIClientId)(clientId, userId.id, userId.domain).asBytes);
|
|
118
101
|
const deviceIdentities = await this.coreCryptoClient.getDeviceIdentities(bazinga64_1.Decoder.fromBase64(groupId).asBytes, clientIds);
|
|
119
|
-
return deviceIdentities.map(identity => (Object.assign(Object.assign({}, identity), { deviceId: (0, fullyQualifiedClientIdUtils_1.parseFullQualifiedClientId)(identity.clientId).client, qualifiedUserId: userClientsMap[identity.clientId] })));
|
|
102
|
+
return deviceIdentities.map(identity => (Object.assign(Object.assign({}, identity), { deviceId: (0, fullyQualifiedClientIdUtils_1.parseFullQualifiedClientId)(identity.clientId).client, credentialType: identity.credentialType, qualifiedUserId: userClientsMap[identity.clientId] })));
|
|
120
103
|
}
|
|
121
104
|
async isFreshMLSSelfClient() {
|
|
122
105
|
const client = await this.clientService.loadClient();
|
|
@@ -23,6 +23,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
23
23
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
24
|
const TimeUtil_1 = require("@wireapp/commons/lib/util/TimeUtil");
|
|
25
25
|
const axios_1 = __importDefault(require("axios"));
|
|
26
|
+
const core_crypto_1 = require("@wireapp/core-crypto");
|
|
26
27
|
const E2EIServiceExternal_1 = require("./E2EIServiceExternal");
|
|
27
28
|
const CoreDB_1 = require("../../../storage/CoreDB");
|
|
28
29
|
const PayloadHelper_1 = require("../../../test/PayloadHelper");
|
|
@@ -64,6 +65,7 @@ function generateCoreCryptoIdentity({ userId, status = 'Valid', deviceId = (0, P
|
|
|
64
65
|
certificate: '-----BEGIN CERTIFICATE-----\nMIICRTCCAeqgAwIBAgIQcpcbKbgHLM5qoB7xgxm6BTAKBggqhkjOPQQDAjAuMSww\nKgYDVQQDEyNlbG5hLndpcmUubGluayBFMkVJIEludGVybWVkaWF0ZSBDQTAeFw0y\nMzExMjIxMTIwMDVaFw0yMzExMjQxMTIwMDVaMDIxFzAVBgNVBAoTDmVsbmEud2ly\nZS5saW5rMRcwFQYDVQQDEw5BZHJpYW4gV2Vpc3MgMjAqMAUGAytlcAMhAMwP5B9X\nwanLL7JUmHEc1SJYAvHUvMnL1MS/D4CK3JaMo4IBEzCCAQ8wDgYDVR0PAQH/BAQD\nAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjAdBgNVHQ4EFgQUrIPC\nem20zAl1ybZqXm2LkvD2U1swHwYDVR0jBBgwFoAU5bQTjX1Ps09suTYe4tzXUKgl\nN9YwdwYDVR0RBHAwboYpaW06d2lyZWFwcD0lNDBhZHJpYW5fd2lyZTJAZWxuYS53\naXJlLmxpbmuGQWltOndpcmVhcHA9U0tIRHNFc09TODJUcldUSE5Fc1ZOQS9lYjll\nMDM4NjE4MzllOWRhQGVsbmEud2lyZS5saW5rMCUGDCsGAQQBgqRkxihAAQQVMBMC\nAQYEDGRlZmF1bHR0ZWFtcwQAMAoGCCqGSM49BAMCA0kAMEYCIQCQQHVAd6wjp2A+\nVvKIXu4oVlCMZkAUATU5bXY4njvapwIhAO8rION7Mz5rSjixJsdEL8E+HHsNvCax\ndjrSL0FL9SM6\n-----END CERTIFICATE-----\n',
|
|
65
66
|
status,
|
|
66
67
|
thumbprint: 'mNyAo88vAF5s7v0UWBNxlQKxP3dfT91A-4PbuzEA5uQ',
|
|
68
|
+
credentialType: core_crypto_1.CredentialType.X509,
|
|
67
69
|
};
|
|
68
70
|
}
|
|
69
71
|
const groupId = 'AAEAAhJrE+8TbFFUqiagedTYDUMAZWxuYS53aXJlLmxpbms=';
|
package/package.json
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"@wireapp/api-client": "^27.0.0",
|
|
15
15
|
"@wireapp/commons": "^5.2.7",
|
|
16
|
-
"@wireapp/core-crypto": "1.0.0-rc.
|
|
16
|
+
"@wireapp/core-crypto": "1.0.0-rc.57",
|
|
17
17
|
"@wireapp/cryptobox": "12.8.0",
|
|
18
18
|
"@wireapp/priority-queue": "^2.1.5",
|
|
19
19
|
"@wireapp/promise-queue": "^2.3.2",
|
|
@@ -61,6 +61,6 @@
|
|
|
61
61
|
"test:coverage": "jest --coverage",
|
|
62
62
|
"watch": "tsc --watch"
|
|
63
63
|
},
|
|
64
|
-
"version": "46.0.
|
|
65
|
-
"gitHead": "
|
|
64
|
+
"version": "46.0.2",
|
|
65
|
+
"gitHead": "513482497a7453787794de78f36a064908916d95"
|
|
66
66
|
}
|