@wireapp/core 46.0.0 → 46.0.1
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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AC,qBAAqB,CAAC;IAKtF,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;IA2DxD,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,7 +29,7 @@ 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
|
-
//
|
|
32
|
+
//TODO: coreCrypto types are wrong here. They return a string (the key of the enum) instead of the enum value
|
|
33
33
|
function fixDeviceStatus(value) {
|
|
34
34
|
const fixedValue = core_crypto_1.DeviceStatus[value];
|
|
35
35
|
if (!fixedValue) {
|
|
@@ -37,6 +37,17 @@ function fixDeviceStatus(value) {
|
|
|
37
37
|
}
|
|
38
38
|
return fixedValue;
|
|
39
39
|
}
|
|
40
|
+
//TODO: coreCrypto types are wrong here. They return a string (the key of the enum) instead of the enum value
|
|
41
|
+
function fixCredentialType(value) {
|
|
42
|
+
if (typeof value === 'number') {
|
|
43
|
+
return value;
|
|
44
|
+
}
|
|
45
|
+
const fixedValue = core_crypto_1.CredentialType[value];
|
|
46
|
+
if (!fixedValue) {
|
|
47
|
+
throw new Error(`Invalid credentialType value: ${value}`);
|
|
48
|
+
}
|
|
49
|
+
return fixedValue;
|
|
50
|
+
}
|
|
40
51
|
// TODO coreCrypto types are wrong here. They return a string (the key of the enum) instead of the enum value
|
|
41
52
|
function fixConversationState(value) {
|
|
42
53
|
const fixedValue = core_crypto_1.E2eiConversationState[value];
|
|
@@ -101,7 +112,7 @@ class E2EIServiceExternal extends commons_1.TypedEventEmitter {
|
|
|
101
112
|
.map(fullyQualifiedId => (0, fullyQualifiedClientIdUtils_1.parseFullQualifiedClientId)(fullyQualifiedId));
|
|
102
113
|
const mappedUserIdentities = new Map();
|
|
103
114
|
for (const userId of userIds) {
|
|
104
|
-
const identities = (userIdentities.get(userId.id) || []).map(identity => (Object.assign(Object.assign({}, identity), { status: fixDeviceStatus(identity.status), deviceId: (0, fullyQualifiedClientIdUtils_1.parseFullQualifiedClientId)(identity.clientId).client, qualifiedUserId: userId })));
|
|
115
|
+
const identities = (userIdentities.get(userId.id) || []).map(identity => (Object.assign(Object.assign({}, identity), { status: fixDeviceStatus(identity.status), credentialType: fixCredentialType(identity.credentialType), deviceId: (0, fullyQualifiedClientIdUtils_1.parseFullQualifiedClientId)(identity.clientId).client, qualifiedUserId: userId })));
|
|
105
116
|
const basicMLSDevices = allUsersMLSDevices
|
|
106
117
|
.filter(({ user }) => user === userId.id)
|
|
107
118
|
// filtering devices that have a valid identity
|
|
@@ -116,7 +127,7 @@ class E2EIServiceExternal extends commons_1.TypedEventEmitter {
|
|
|
116
127
|
async getDevicesIdentities(groupId, userClientsMap) {
|
|
117
128
|
const clientIds = Object.entries(userClientsMap).map(([clientId, userId]) => (0, Helper_1.getE2EIClientId)(clientId, userId.id, userId.domain).asBytes);
|
|
118
129
|
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] })));
|
|
130
|
+
return deviceIdentities.map(identity => (Object.assign(Object.assign({}, identity), { deviceId: (0, fullyQualifiedClientIdUtils_1.parseFullQualifiedClientId)(identity.clientId).client, credentialType: fixCredentialType(identity.credentialType), qualifiedUserId: userClientsMap[identity.clientId] })));
|
|
120
131
|
}
|
|
121
132
|
async isFreshMLSSelfClient() {
|
|
122
133
|
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