matrix-js-sdk 28.1.0 → 28.2.0-rc.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.
- package/CHANGELOG.md +17 -1
- package/dist/browser-matrix.js +1458 -391
- package/dist/browser-matrix.js.map +32 -22
- package/dist/browser-matrix.min.js +5 -5
- package/dist/browser-matrix.min.js.map +1 -1
- package/git-revision.txt +1 -1
- package/lib/ReEmitter.js +1 -1
- package/lib/ReEmitter.js.map +1 -1
- package/lib/ToDeviceMessageQueue.js +1 -1
- package/lib/ToDeviceMessageQueue.js.map +1 -1
- package/lib/autodiscovery.js +17 -18
- package/lib/autodiscovery.js.map +1 -1
- package/lib/client.d.ts +14 -0
- package/lib/client.d.ts.map +1 -1
- package/lib/client.js +59 -85
- package/lib/client.js.map +1 -1
- package/lib/common-crypto/CryptoBackend.d.ts +41 -0
- package/lib/common-crypto/CryptoBackend.d.ts.map +1 -1
- package/lib/common-crypto/CryptoBackend.js.map +1 -1
- package/lib/common-crypto/base64.d.ts +22 -0
- package/lib/common-crypto/base64.d.ts.map +1 -0
- package/lib/common-crypto/base64.js +55 -0
- package/lib/common-crypto/base64.js.map +1 -0
- package/lib/content-helpers.js +16 -16
- package/lib/content-helpers.js.map +1 -1
- package/lib/crypto/CrossSigning.js +3 -3
- package/lib/crypto/CrossSigning.js.map +1 -1
- package/lib/crypto/DeviceList.js +11 -14
- package/lib/crypto/DeviceList.js.map +1 -1
- package/lib/crypto/EncryptionSetup.js +3 -10
- package/lib/crypto/EncryptionSetup.js.map +1 -1
- package/lib/crypto/OlmDevice.js +1 -1
- package/lib/crypto/OlmDevice.js.map +1 -1
- package/lib/crypto/OutgoingRoomKeyRequestManager.js +19 -20
- package/lib/crypto/OutgoingRoomKeyRequestManager.js.map +1 -1
- package/lib/crypto/RoomList.js +1 -1
- package/lib/crypto/RoomList.js.map +1 -1
- package/lib/crypto/SecretSharing.js +1 -1
- package/lib/crypto/SecretSharing.js.map +1 -1
- package/lib/crypto/SecretStorage.js +0 -4
- package/lib/crypto/SecretStorage.js.map +1 -1
- package/lib/crypto/algorithms/base.js +0 -14
- package/lib/crypto/algorithms/base.js.map +1 -1
- package/lib/crypto/algorithms/megolm.js +22 -31
- package/lib/crypto/algorithms/megolm.js.map +1 -1
- package/lib/crypto/backup.d.ts +17 -0
- package/lib/crypto/backup.d.ts.map +1 -1
- package/lib/crypto/backup.js +29 -8
- package/lib/crypto/backup.js.map +1 -1
- package/lib/crypto/dehydration.js +1 -5
- package/lib/crypto/dehydration.js.map +1 -1
- package/lib/crypto/deviceinfo.js +1 -1
- package/lib/crypto/deviceinfo.js.map +1 -1
- package/lib/crypto/index.d.ts +10 -2
- package/lib/crypto/index.d.ts.map +1 -1
- package/lib/crypto/index.js +133 -68
- package/lib/crypto/index.js.map +1 -1
- package/lib/crypto/keybackup.d.ts +1 -16
- package/lib/crypto/keybackup.d.ts.map +1 -1
- package/lib/crypto/keybackup.js.map +1 -1
- package/lib/crypto/olmlib.js +21 -21
- package/lib/crypto/olmlib.js.map +1 -1
- package/lib/crypto/recoverykey.d.ts.map +1 -1
- package/lib/crypto/recoverykey.js +3 -2
- package/lib/crypto/recoverykey.js.map +1 -1
- package/lib/crypto/store/indexeddb-crypto-store-backend.js +1 -1
- package/lib/crypto/store/indexeddb-crypto-store-backend.js.map +1 -1
- package/lib/crypto/store/indexeddb-crypto-store.js +0 -2
- package/lib/crypto/store/indexeddb-crypto-store.js.map +1 -1
- package/lib/crypto/store/memory-crypto-store.js +16 -16
- package/lib/crypto/store/memory-crypto-store.js.map +1 -1
- package/lib/crypto/verification/Base.js +6 -13
- package/lib/crypto/verification/Base.js.map +1 -1
- package/lib/crypto/verification/QRCode.js +0 -1
- package/lib/crypto/verification/QRCode.js.map +1 -1
- package/lib/crypto/verification/SAS.js +0 -4
- package/lib/crypto/verification/SAS.js.map +1 -1
- package/lib/crypto/verification/request/InRoomChannel.js +0 -1
- package/lib/crypto/verification/request/InRoomChannel.js.map +1 -1
- package/lib/crypto/verification/request/ToDeviceChannel.js +0 -1
- package/lib/crypto/verification/request/ToDeviceChannel.js.map +1 -1
- package/lib/crypto/verification/request/VerificationRequest.js +5 -7
- package/lib/crypto/verification/request/VerificationRequest.js.map +1 -1
- package/lib/crypto-api/keybackup.d.ts +15 -0
- package/lib/crypto-api/keybackup.d.ts.map +1 -1
- package/lib/crypto-api/keybackup.js.map +1 -1
- package/lib/crypto-api.d.ts +53 -0
- package/lib/crypto-api.d.ts.map +1 -1
- package/lib/crypto-api.js +55 -29
- package/lib/crypto-api.js.map +1 -1
- package/lib/embedded.d.ts +2 -1
- package/lib/embedded.d.ts.map +1 -1
- package/lib/embedded.js +29 -14
- package/lib/embedded.js.map +1 -1
- package/lib/event-mapper.js +17 -17
- package/lib/event-mapper.js.map +1 -1
- package/lib/extensible_events_v1/MessageEvent.js +31 -31
- package/lib/extensible_events_v1/MessageEvent.js.map +1 -1
- package/lib/extensible_events_v1/PollEndEvent.js +24 -24
- package/lib/extensible_events_v1/PollEndEvent.js.map +1 -1
- package/lib/extensible_events_v1/PollResponseEvent.js +0 -1
- package/lib/extensible_events_v1/PollResponseEvent.js.map +1 -1
- package/lib/extensible_events_v1/PollStartEvent.js +44 -44
- package/lib/extensible_events_v1/PollStartEvent.js.map +1 -1
- package/lib/filter.js +17 -19
- package/lib/filter.js.map +1 -1
- package/lib/http-api/errors.js +4 -6
- package/lib/http-api/errors.js.map +1 -1
- package/lib/http-api/fetch.js +1 -1
- package/lib/http-api/fetch.js.map +1 -1
- package/lib/http-api/index.js +1 -1
- package/lib/http-api/index.js.map +1 -1
- package/lib/interactive-auth.js +6 -16
- package/lib/interactive-auth.js.map +1 -1
- package/lib/matrixrtc/CallMembership.d.ts +31 -0
- package/lib/matrixrtc/CallMembership.d.ts.map +1 -0
- package/lib/matrixrtc/CallMembership.js +80 -0
- package/lib/matrixrtc/CallMembership.js.map +1 -0
- package/lib/matrixrtc/MatrixRTCSession.d.ts +81 -0
- package/lib/matrixrtc/MatrixRTCSession.d.ts.map +1 -0
- package/lib/matrixrtc/MatrixRTCSession.js +345 -0
- package/lib/matrixrtc/MatrixRTCSession.js.map +1 -0
- package/lib/matrixrtc/MatrixRTCSessionManager.d.ts +38 -0
- package/lib/matrixrtc/MatrixRTCSessionManager.d.ts.map +1 -0
- package/lib/matrixrtc/MatrixRTCSessionManager.js +116 -0
- package/lib/matrixrtc/MatrixRTCSessionManager.js.map +1 -0
- package/lib/matrixrtc/focus.d.ts +9 -0
- package/lib/matrixrtc/focus.d.ts.map +1 -0
- package/lib/matrixrtc/focus.js +6 -0
- package/lib/matrixrtc/focus.js.map +1 -0
- package/lib/models/MSC3089Branch.js +16 -16
- package/lib/models/MSC3089Branch.js.map +1 -1
- package/lib/models/MSC3089TreeSpace.js +16 -17
- package/lib/models/MSC3089TreeSpace.js.map +1 -1
- package/lib/models/beacon.js +3 -8
- package/lib/models/beacon.js.map +1 -1
- package/lib/models/device.js +14 -16
- package/lib/models/device.js.map +1 -1
- package/lib/models/event-context.js +1 -2
- package/lib/models/event-context.js.map +1 -1
- package/lib/models/event-timeline-set.js +1 -7
- package/lib/models/event-timeline-set.js.map +1 -1
- package/lib/models/event-timeline.js +4 -8
- package/lib/models/event-timeline.js.map +1 -1
- package/lib/models/event.d.ts +1 -1
- package/lib/models/event.js +7 -25
- package/lib/models/event.js.map +1 -1
- package/lib/models/poll.js +4 -8
- package/lib/models/poll.js.map +1 -1
- package/lib/models/read-receipt.js +0 -1
- package/lib/models/read-receipt.js.map +1 -1
- package/lib/models/related-relations.js +0 -3
- package/lib/models/related-relations.js.map +1 -1
- package/lib/models/relations-container.js +2 -2
- package/lib/models/relations-container.js.map +1 -1
- package/lib/models/relations.js +3 -4
- package/lib/models/relations.js.map +1 -1
- package/lib/models/room-member.js +2 -20
- package/lib/models/room-member.js.map +1 -1
- package/lib/models/room-state.js +3 -3
- package/lib/models/room-state.js.map +1 -1
- package/lib/models/room.d.ts +1 -1
- package/lib/models/room.d.ts.map +1 -1
- package/lib/models/room.js +40 -76
- package/lib/models/room.js.map +1 -1
- package/lib/models/thread.js +21 -32
- package/lib/models/thread.js.map +1 -1
- package/lib/models/user.js +1 -20
- package/lib/models/user.js.map +1 -1
- package/lib/oidc/authorize.js +16 -16
- package/lib/oidc/authorize.js.map +1 -1
- package/lib/oidc/discovery.js +16 -16
- package/lib/oidc/discovery.js.map +1 -1
- package/lib/pushprocessor.js +17 -17
- package/lib/pushprocessor.js.map +1 -1
- package/lib/receipt-accumulator.js +1 -1
- package/lib/receipt-accumulator.js.map +1 -1
- package/lib/rendezvous/MSC3906Rendezvous.js +2 -5
- package/lib/rendezvous/MSC3906Rendezvous.js.map +1 -1
- package/lib/rendezvous/channels/MSC3903ECDHv2RendezvousChannel.js +1 -4
- package/lib/rendezvous/channels/MSC3903ECDHv2RendezvousChannel.js.map +1 -1
- package/lib/rendezvous/transports/MSC3886SimpleHttpRendezvousTransport.js +1 -8
- package/lib/rendezvous/transports/MSC3886SimpleHttpRendezvousTransport.js.map +1 -1
- package/lib/room-hierarchy.js +4 -8
- package/lib/room-hierarchy.js.map +1 -1
- package/lib/rust-crypto/CrossSigningIdentity.d.ts +1 -5
- package/lib/rust-crypto/CrossSigningIdentity.d.ts.map +1 -1
- package/lib/rust-crypto/CrossSigningIdentity.js +1 -4
- package/lib/rust-crypto/CrossSigningIdentity.js.map +1 -1
- package/lib/rust-crypto/KeyClaimManager.js +1 -2
- package/lib/rust-crypto/KeyClaimManager.js.map +1 -1
- package/lib/rust-crypto/OutgoingRequestProcessor.js +16 -16
- package/lib/rust-crypto/OutgoingRequestProcessor.js.map +1 -1
- package/lib/rust-crypto/RoomEncryptor.js +0 -3
- package/lib/rust-crypto/RoomEncryptor.js.map +1 -1
- package/lib/rust-crypto/backup.d.ts +20 -2
- package/lib/rust-crypto/backup.d.ts.map +1 -1
- package/lib/rust-crypto/backup.js +39 -4
- package/lib/rust-crypto/backup.js.map +1 -1
- package/lib/rust-crypto/index.d.ts.map +1 -1
- package/lib/rust-crypto/index.js +1 -0
- package/lib/rust-crypto/index.js.map +1 -1
- package/lib/rust-crypto/rust-crypto.d.ts +39 -3
- package/lib/rust-crypto/rust-crypto.d.ts.map +1 -1
- package/lib/rust-crypto/rust-crypto.js +260 -61
- package/lib/rust-crypto/rust-crypto.js.map +1 -1
- package/lib/rust-crypto/verification.js +5 -7
- package/lib/rust-crypto/verification.js.map +1 -1
- package/lib/scheduler.js +2 -2
- package/lib/scheduler.js.map +1 -1
- package/lib/sliding-sync-sdk.js +4 -7
- package/lib/sliding-sync-sdk.js.map +1 -1
- package/lib/sliding-sync.js +23 -28
- package/lib/sliding-sync.js.map +1 -1
- package/lib/store/indexeddb-local-backend.js +6 -10
- package/lib/store/indexeddb-local-backend.js.map +1 -1
- package/lib/store/indexeddb-remote-backend.js +8 -11
- package/lib/store/indexeddb-remote-backend.js.map +1 -1
- package/lib/store/indexeddb-store-worker.js +1 -2
- package/lib/store/indexeddb-store-worker.js.map +1 -1
- package/lib/store/indexeddb.js +0 -1
- package/lib/store/indexeddb.js.map +1 -1
- package/lib/store/memory.js +0 -3
- package/lib/store/memory.js.map +1 -1
- package/lib/sync-accumulator.d.ts +11 -1
- package/lib/sync-accumulator.d.ts.map +1 -1
- package/lib/sync-accumulator.js +55 -4
- package/lib/sync-accumulator.js.map +1 -1
- package/lib/sync.d.ts.map +1 -1
- package/lib/sync.js +53 -39
- package/lib/sync.js.map +1 -1
- package/lib/timeline-window.js +2 -6
- package/lib/timeline-window.js.map +1 -1
- package/lib/utils.js +18 -18
- package/lib/utils.js.map +1 -1
- package/lib/webrtc/audioContext.js +1 -1
- package/lib/webrtc/audioContext.js.map +1 -1
- package/lib/webrtc/call.js +35 -73
- package/lib/webrtc/call.js.map +1 -1
- package/lib/webrtc/callEventHandler.js +1 -6
- package/lib/webrtc/callEventHandler.js.map +1 -1
- package/lib/webrtc/callFeed.js +2 -17
- package/lib/webrtc/callFeed.js.map +1 -1
- package/lib/webrtc/groupCall.d.ts +7 -1
- package/lib/webrtc/groupCall.d.ts.map +1 -1
- package/lib/webrtc/groupCall.js +47 -33
- package/lib/webrtc/groupCall.js.map +1 -1
- package/lib/webrtc/groupCallEventHandler.d.ts.map +1 -1
- package/lib/webrtc/groupCallEventHandler.js +3 -2
- package/lib/webrtc/groupCallEventHandler.js.map +1 -1
- package/lib/webrtc/mediaHandler.js +3 -7
- package/lib/webrtc/mediaHandler.js.map +1 -1
- package/lib/webrtc/stats/callStatsReportGatherer.js +19 -22
- package/lib/webrtc/stats/callStatsReportGatherer.js.map +1 -1
- package/lib/webrtc/stats/groupCallStats.js +4 -5
- package/lib/webrtc/stats/groupCallStats.js.map +1 -1
- package/lib/webrtc/stats/media/mediaSsrcHandler.js +1 -1
- package/lib/webrtc/stats/media/mediaSsrcHandler.js.map +1 -1
- package/lib/webrtc/stats/media/mediaTrackStats.js +3 -3
- package/lib/webrtc/stats/media/mediaTrackStats.js.map +1 -1
- package/lib/webrtc/stats/media/mediaTrackStatsHandler.js +1 -1
- package/lib/webrtc/stats/media/mediaTrackStatsHandler.js.map +1 -1
- package/package.json +4 -4
- package/src/client.ts +66 -23
- package/src/common-crypto/CryptoBackend.ts +45 -0
- package/src/common-crypto/base64.ts +46 -0
- package/src/crypto/backup.ts +30 -0
- package/src/crypto/index.ts +90 -3
- package/src/crypto/keybackup.ts +3 -20
- package/src/crypto/recoverykey.ts +3 -4
- package/src/crypto-api/keybackup.ts +19 -0
- package/src/crypto-api.ts +63 -0
- package/src/embedded.ts +28 -1
- package/src/matrixrtc/CallMembership.ts +95 -0
- package/src/matrixrtc/MatrixRTCSession.ts +418 -0
- package/src/matrixrtc/MatrixRTCSessionManager.ts +128 -0
- package/src/matrixrtc/focus.ts +24 -0
- package/src/models/event.ts +1 -1
- package/src/models/room.ts +11 -5
- package/src/rust-crypto/CrossSigningIdentity.ts +0 -4
- package/src/rust-crypto/backup.ts +56 -2
- package/src/rust-crypto/index.ts +3 -0
- package/src/rust-crypto/rust-crypto.ts +282 -44
- package/src/sync-accumulator.ts +63 -1
- package/src/sync.ts +26 -1
- package/src/webrtc/groupCall.ts +43 -6
- package/src/webrtc/groupCallEventHandler.ts +3 -0
|
@@ -31,25 +31,29 @@ var _backup = require("./backup");
|
|
|
31
31
|
var _ReEmitter = require("../ReEmitter");
|
|
32
32
|
var _randomstring = require("../randomstring");
|
|
33
33
|
var _errors = require("../errors");
|
|
34
|
+
var _base = require("../common-crypto/base64");
|
|
35
|
+
var _algorithms = require("../crypto/algorithms");
|
|
34
36
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
35
37
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
36
|
-
function ownKeys(
|
|
37
|
-
function _objectSpread(
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
38
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
39
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } /*
|
|
40
|
+
Copyright 2022-2023 The Matrix.org Foundation C.I.C.
|
|
41
|
+
|
|
42
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
43
|
+
you may not use this file except in compliance with the License.
|
|
44
|
+
You may obtain a copy of the License at
|
|
45
|
+
|
|
46
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
47
|
+
|
|
48
|
+
Unless required by applicable law or agreed to in writing, software
|
|
49
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
50
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
51
|
+
See the License for the specific language governing permissions and
|
|
52
|
+
limitations under the License.
|
|
53
|
+
*/
|
|
52
54
|
const ALL_VERIFICATION_METHODS = ["m.sas.v1", "m.qr_code.scan.v1", "m.qr_code.show.v1", "m.reciprocate.v1"];
|
|
55
|
+
const KEY_BACKUP_CHECK_RATE_LIMIT = 5000; // ms
|
|
56
|
+
|
|
53
57
|
/**
|
|
54
58
|
* An implementation of {@link CryptoBackend} using the Rust matrix-sdk-crypto.
|
|
55
59
|
*
|
|
@@ -69,24 +73,22 @@ class RustCrypto extends _typedEventEmitter.TypedEventEmitter {
|
|
|
69
73
|
secretStorage, /** Crypto callbacks provided by the application */
|
|
70
74
|
cryptoCallbacks) {
|
|
71
75
|
super();
|
|
72
|
-
this.olmMachine = olmMachine;
|
|
73
|
-
this.http = http;
|
|
74
|
-
this.userId = userId;
|
|
75
|
-
this.secretStorage = secretStorage;
|
|
76
|
-
this.cryptoCallbacks = cryptoCallbacks;
|
|
77
76
|
(0, _defineProperty2.default)(this, "globalErrorOnUnknownDevices", false);
|
|
78
77
|
(0, _defineProperty2.default)(this, "_trustCrossSignedDevices", true);
|
|
79
78
|
/** whether {@link stop} has been called */
|
|
80
79
|
(0, _defineProperty2.default)(this, "stopped", false);
|
|
81
80
|
/** whether {@link outgoingRequestLoop} is currently running */
|
|
82
81
|
(0, _defineProperty2.default)(this, "outgoingRequestLoopRunning", false);
|
|
82
|
+
/**
|
|
83
|
+
* whether we check the outgoing requests queue again after the current check finishes.
|
|
84
|
+
*
|
|
85
|
+
* This should never be `true` unless `outgoingRequestLoopRunning` is also true.
|
|
86
|
+
*/
|
|
87
|
+
(0, _defineProperty2.default)(this, "outgoingRequestLoopOneMoreLoop", false);
|
|
83
88
|
/** mapping of roomId → encryptor class */
|
|
84
89
|
(0, _defineProperty2.default)(this, "roomEncryptors", {});
|
|
85
|
-
(0, _defineProperty2.default)(this, "
|
|
86
|
-
|
|
87
|
-
(0, _defineProperty2.default)(this, "outgoingRequestProcessor", void 0);
|
|
88
|
-
(0, _defineProperty2.default)(this, "crossSigningIdentity", void 0);
|
|
89
|
-
(0, _defineProperty2.default)(this, "backupManager", void 0);
|
|
90
|
+
(0, _defineProperty2.default)(this, "sessionLastCheckAttemptedTime", {});
|
|
91
|
+
// When did we last try to check the server for a given session id?
|
|
90
92
|
(0, _defineProperty2.default)(this, "reemitter", new _ReEmitter.TypedReEmitter(this));
|
|
91
93
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
92
94
|
//
|
|
@@ -98,18 +100,51 @@ class RustCrypto extends _typedEventEmitter.TypedEventEmitter {
|
|
|
98
100
|
* The verification methods we offer to the other side during an interactive verification.
|
|
99
101
|
*/
|
|
100
102
|
(0, _defineProperty2.default)(this, "_supportedVerificationMethods", ALL_VERIFICATION_METHODS);
|
|
103
|
+
this.olmMachine = olmMachine;
|
|
104
|
+
this.http = http;
|
|
105
|
+
this.userId = userId;
|
|
106
|
+
this.secretStorage = secretStorage;
|
|
107
|
+
this.cryptoCallbacks = cryptoCallbacks;
|
|
101
108
|
this.outgoingRequestProcessor = new _OutgoingRequestProcessor.OutgoingRequestProcessor(olmMachine, http);
|
|
102
109
|
this.keyClaimManager = new _KeyClaimManager.KeyClaimManager(olmMachine, this.outgoingRequestProcessor);
|
|
103
|
-
this.eventDecryptor = new EventDecryptor(olmMachine);
|
|
110
|
+
this.eventDecryptor = new EventDecryptor(olmMachine, this);
|
|
104
111
|
this.backupManager = new _backup.RustBackupManager(olmMachine, http, this.outgoingRequestProcessor);
|
|
105
112
|
this.reemitter.reEmit(this.backupManager, [_crypto2.CryptoEvent.KeyBackupStatus, _crypto2.CryptoEvent.KeyBackupSessionsRemaining, _crypto2.CryptoEvent.KeyBackupFailed]);
|
|
113
|
+
this.crossSigningIdentity = new _CrossSigningIdentity.CrossSigningIdentity(olmMachine, this.outgoingRequestProcessor, secretStorage);
|
|
114
|
+
}
|
|
106
115
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
116
|
+
/**
|
|
117
|
+
* Attempts to retrieve a session from a key backup, if enough time
|
|
118
|
+
* has elapsed since the last check for this session id.
|
|
119
|
+
*/
|
|
120
|
+
async queryKeyBackupRateLimited(targetRoomId, targetSessionId) {
|
|
121
|
+
const backupKeys = await this.olmMachine.getBackupKeys();
|
|
122
|
+
if (!backupKeys.decryptionKey) return;
|
|
123
|
+
const version = backupKeys.backupVersion;
|
|
124
|
+
const now = new Date().getTime();
|
|
125
|
+
if (!this.sessionLastCheckAttemptedTime[targetSessionId] || now - this.sessionLastCheckAttemptedTime[targetSessionId] > KEY_BACKUP_CHECK_RATE_LIMIT) {
|
|
126
|
+
this.sessionLastCheckAttemptedTime[targetSessionId] = now;
|
|
127
|
+
const path = (0, _utils.encodeUri)("/room_keys/keys/$roomId/$sessionId", {
|
|
128
|
+
$roomId: targetRoomId,
|
|
129
|
+
$sessionId: targetSessionId
|
|
130
|
+
});
|
|
131
|
+
const res = await this.http.authedRequest(_httpApi.Method.Get, path, {
|
|
132
|
+
version
|
|
133
|
+
}, undefined, {
|
|
134
|
+
prefix: _httpApi.ClientPrefix.V3
|
|
135
|
+
});
|
|
136
|
+
if (this.stopped) return;
|
|
137
|
+
const backupDecryptor = new _backup.RustBackupDecryptor(backupKeys.decryptionKey);
|
|
138
|
+
if (res) {
|
|
139
|
+
const sessionsToImport = {};
|
|
140
|
+
sessionsToImport[targetSessionId] = res;
|
|
141
|
+
const keys = await backupDecryptor.decryptSessions(sessionsToImport);
|
|
142
|
+
for (const k of keys) {
|
|
143
|
+
k.room_id = targetRoomId;
|
|
144
|
+
}
|
|
145
|
+
await this.importRoomKeys(keys);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
113
148
|
}
|
|
114
149
|
|
|
115
150
|
/**
|
|
@@ -167,6 +202,12 @@ class RustCrypto extends _typedEventEmitter.TypedEventEmitter {
|
|
|
167
202
|
}
|
|
168
203
|
return await this.eventDecryptor.attemptEventDecryption(event);
|
|
169
204
|
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Implementation of (deprecated) {@link MatrixClient#getEventEncryptionInfo}.
|
|
208
|
+
*
|
|
209
|
+
* @param event - event to inspect
|
|
210
|
+
*/
|
|
170
211
|
getEventEncryptionInfo(event) {
|
|
171
212
|
var _event$getSenderKey;
|
|
172
213
|
// TODO: make this work properly. Or better, replace it.
|
|
@@ -245,7 +286,7 @@ class RustCrypto extends _typedEventEmitter.TypedEventEmitter {
|
|
|
245
286
|
stage: "load_keys",
|
|
246
287
|
failures: 0
|
|
247
288
|
};
|
|
248
|
-
opts === null || opts === void 0 || (_opts$progressCallbac = opts.progressCallback) === null || _opts$progressCallbac === void 0
|
|
289
|
+
opts === null || opts === void 0 || (_opts$progressCallbac = opts.progressCallback) === null || _opts$progressCallbac === void 0 || _opts$progressCallbac.call(opts, importOpt);
|
|
249
290
|
});
|
|
250
291
|
}
|
|
251
292
|
|
|
@@ -555,7 +596,7 @@ class RustCrypto extends _typedEventEmitter.TypedEventEmitter {
|
|
|
555
596
|
}
|
|
556
597
|
const secretStorageKeyObject = await this.secretStorage.addKey(_secretStorage.SECRET_STORAGE_ALGORITHM_V1_AES, secretStorageKey.keyInfo);
|
|
557
598
|
await this.secretStorage.setDefaultKeyId(secretStorageKeyObject.keyId);
|
|
558
|
-
(_this$cryptoCallbacks = (_this$cryptoCallbacks2 = this.cryptoCallbacks).cacheSecretStorageKey) === null || _this$cryptoCallbacks === void 0
|
|
599
|
+
(_this$cryptoCallbacks = (_this$cryptoCallbacks2 = this.cryptoCallbacks).cacheSecretStorageKey) === null || _this$cryptoCallbacks === void 0 || _this$cryptoCallbacks.call(_this$cryptoCallbacks2, secretStorageKeyObject.keyId, secretStorageKeyObject.keyInfo, secretStorageKey.privateKey);
|
|
559
600
|
}
|
|
560
601
|
|
|
561
602
|
/**
|
|
@@ -620,6 +661,13 @@ class RustCrypto extends _typedEventEmitter.TypedEventEmitter {
|
|
|
620
661
|
};
|
|
621
662
|
}
|
|
622
663
|
|
|
664
|
+
/**
|
|
665
|
+
* Implementation of {@link CryptoApi.getEncryptionInfoForEvent}.
|
|
666
|
+
*/
|
|
667
|
+
async getEncryptionInfoForEvent(event) {
|
|
668
|
+
return this.eventDecryptor.getEncryptionInfoForEvent(event);
|
|
669
|
+
}
|
|
670
|
+
|
|
623
671
|
/**
|
|
624
672
|
* Returns to-device verification requests that are already in progress for the given user id.
|
|
625
673
|
*
|
|
@@ -772,7 +820,7 @@ class RustCrypto extends _typedEventEmitter.TypedEventEmitter {
|
|
|
772
820
|
* @param key - the backup decryption key
|
|
773
821
|
*/
|
|
774
822
|
async storeSessionBackupPrivateKey(key) {
|
|
775
|
-
const base64Key =
|
|
823
|
+
const base64Key = (0, _base.encodeBase64)(key);
|
|
776
824
|
|
|
777
825
|
// TODO get version from backupManager
|
|
778
826
|
await this.olmMachine.saveBackupDecryptionKey(RustSdkCryptoJs.BackupDecryptionKey.fromBase64(base64Key), "");
|
|
@@ -848,6 +896,24 @@ class RustCrypto extends _typedEventEmitter.TypedEventEmitter {
|
|
|
848
896
|
obj.signatures = Object.fromEntries(sigs.entries());
|
|
849
897
|
}
|
|
850
898
|
|
|
899
|
+
/**
|
|
900
|
+
* Implementation of {@link CryptoBackend#getBackupDecryptor}.
|
|
901
|
+
*/
|
|
902
|
+
async getBackupDecryptor(backupInfo, privKey) {
|
|
903
|
+
if (backupInfo.algorithm != "m.megolm_backup.v1.curve25519-aes-sha2") {
|
|
904
|
+
throw new Error(`getBackupDecryptor Unsupported algorithm ${backupInfo.algorithm}`);
|
|
905
|
+
}
|
|
906
|
+
const authData = backupInfo.auth_data;
|
|
907
|
+
if (!(privKey instanceof Uint8Array)) {
|
|
908
|
+
throw new Error(`getBackupDecryptor expects Uint8Array`);
|
|
909
|
+
}
|
|
910
|
+
const backupDecryptionKey = RustSdkCryptoJs.BackupDecryptionKey.fromBase64((0, _base.encodeBase64)(privKey));
|
|
911
|
+
if (authData.public_key != backupDecryptionKey.megolmV1PublicKey.publicKeyBase64) {
|
|
912
|
+
throw new Error(`getBackupDecryptor key mismatch error`);
|
|
913
|
+
}
|
|
914
|
+
return new _backup.RustBackupDecryptor(backupDecryptionKey);
|
|
915
|
+
}
|
|
916
|
+
|
|
851
917
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
852
918
|
//
|
|
853
919
|
// SyncCryptoCallbacks implementation
|
|
@@ -1031,6 +1097,19 @@ class RustCrypto extends _typedEventEmitter.TypedEventEmitter {
|
|
|
1031
1097
|
}
|
|
1032
1098
|
}
|
|
1033
1099
|
|
|
1100
|
+
/**
|
|
1101
|
+
* Callback for `OlmMachine.registerUserIdentityUpdatedCallback`
|
|
1102
|
+
*
|
|
1103
|
+
* Called by the rust-sdk whenever there is an update to any user's cross-signing status. We re-check their trust
|
|
1104
|
+
* status and emit a `UserTrustStatusChanged` event.
|
|
1105
|
+
*
|
|
1106
|
+
* @param userId - the user with the updated identity
|
|
1107
|
+
*/
|
|
1108
|
+
async onUserIdentityUpdated(userId) {
|
|
1109
|
+
const newVerification = await this.getUserVerificationStatus(userId.toString());
|
|
1110
|
+
this.emit(_crypto2.CryptoEvent.UserTrustStatusChanged, userId.toString(), newVerification);
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1034
1113
|
/**
|
|
1035
1114
|
* Handle a live event received via /sync.
|
|
1036
1115
|
* See {@link ClientEventHandlerMap#event}
|
|
@@ -1077,6 +1156,7 @@ class RustCrypto extends _typedEventEmitter.TypedEventEmitter {
|
|
|
1077
1156
|
if (!roomId) {
|
|
1078
1157
|
throw new Error("missing roomId in the event");
|
|
1079
1158
|
}
|
|
1159
|
+
_logger.logger.debug(`Incoming verification event ${event.getId()} type ${event.getType()} from ${event.getSender()}`);
|
|
1080
1160
|
await this.olmMachine.receiveVerificationEvent(JSON.stringify({
|
|
1081
1161
|
event_id: event.getId(),
|
|
1082
1162
|
type: event.getType(),
|
|
@@ -1085,6 +1165,9 @@ class RustCrypto extends _typedEventEmitter.TypedEventEmitter {
|
|
|
1085
1165
|
content: event.getContent(),
|
|
1086
1166
|
origin_server_ts: event.getTs()
|
|
1087
1167
|
}), new RustSdkCryptoJs.RoomId(roomId));
|
|
1168
|
+
|
|
1169
|
+
// that may have caused us to queue up outgoing requests, so make sure we send them.
|
|
1170
|
+
this.outgoingRequestLoop();
|
|
1088
1171
|
}
|
|
1089
1172
|
|
|
1090
1173
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
@@ -1093,24 +1176,51 @@ class RustCrypto extends _typedEventEmitter.TypedEventEmitter {
|
|
|
1093
1176
|
//
|
|
1094
1177
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
1095
1178
|
|
|
1096
|
-
|
|
1179
|
+
/** start the outgoing request loop if it is not already running */
|
|
1180
|
+
outgoingRequestLoop() {
|
|
1097
1181
|
if (this.outgoingRequestLoopRunning) {
|
|
1182
|
+
// The loop is already running, but we have reason to believe that there may be new items in the queue.
|
|
1183
|
+
//
|
|
1184
|
+
// There is potential for a race whereby the item is added *after* `OlmMachine.outgoingRequests` checks
|
|
1185
|
+
// the queue, but *before* it returns. In such a case, the item could sit there unnoticed for some time.
|
|
1186
|
+
//
|
|
1187
|
+
// In order to circumvent the race, we set a flag which tells the loop to go round once again even if the
|
|
1188
|
+
// queue appears to be empty.
|
|
1189
|
+
this.outgoingRequestLoopOneMoreLoop = true;
|
|
1098
1190
|
return;
|
|
1099
1191
|
}
|
|
1192
|
+
// fire off the loop in the background
|
|
1193
|
+
this.outgoingRequestLoopInner().catch(e => {
|
|
1194
|
+
_logger.logger.error("Error processing outgoing-message requests from rust crypto-sdk", e);
|
|
1195
|
+
});
|
|
1196
|
+
}
|
|
1197
|
+
async outgoingRequestLoopInner() {
|
|
1198
|
+
/* istanbul ignore if */
|
|
1199
|
+
if (this.outgoingRequestLoopRunning) {
|
|
1200
|
+
throw new Error("Cannot run two outgoing request loops");
|
|
1201
|
+
}
|
|
1100
1202
|
this.outgoingRequestLoopRunning = true;
|
|
1101
1203
|
try {
|
|
1102
1204
|
while (!this.stopped) {
|
|
1205
|
+
// we clear the "one more loop" flag just before calling `OlmMachine.outgoingRequests()`, so we can tell
|
|
1206
|
+
// if `this.outgoingRequestLoop()` was called while `OlmMachine.outgoingRequests()` was running.
|
|
1207
|
+
this.outgoingRequestLoopOneMoreLoop = false;
|
|
1208
|
+
_logger.logger.debug("Calling OlmMachine.outgoingRequests()");
|
|
1103
1209
|
const outgoingRequests = await this.olmMachine.outgoingRequests();
|
|
1104
|
-
if (
|
|
1105
|
-
//
|
|
1210
|
+
if (this.stopped) {
|
|
1211
|
+
// we've been told to stop while `outgoingRequests` was running: exit the loop without processing
|
|
1212
|
+
// any of the returned requests (anything important will happen next time the client starts.)
|
|
1213
|
+
return;
|
|
1214
|
+
}
|
|
1215
|
+
if (outgoingRequests.length === 0 && !this.outgoingRequestLoopOneMoreLoop) {
|
|
1216
|
+
// `OlmMachine.outgoingRequests` returned no messages, and there was no call to
|
|
1217
|
+
// `this.outgoingRequestLoop()` while it was running. We can stop the loop for a while.
|
|
1106
1218
|
return;
|
|
1107
1219
|
}
|
|
1108
1220
|
for (const msg of outgoingRequests) {
|
|
1109
1221
|
await this.outgoingRequestProcessor.makeOutgoingRequest(msg);
|
|
1110
1222
|
}
|
|
1111
1223
|
}
|
|
1112
|
-
} catch (e) {
|
|
1113
|
-
_logger.logger.error("Error processing outgoing-message requests from rust crypto-sdk", e);
|
|
1114
1224
|
} finally {
|
|
1115
1225
|
this.outgoingRequestLoopRunning = false;
|
|
1116
1226
|
}
|
|
@@ -1118,14 +1228,15 @@ class RustCrypto extends _typedEventEmitter.TypedEventEmitter {
|
|
|
1118
1228
|
}
|
|
1119
1229
|
exports.RustCrypto = RustCrypto;
|
|
1120
1230
|
class EventDecryptor {
|
|
1121
|
-
constructor(olmMachine) {
|
|
1122
|
-
this.olmMachine = olmMachine;
|
|
1231
|
+
constructor(olmMachine, crypto) {
|
|
1123
1232
|
/**
|
|
1124
1233
|
* Events which we couldn't decrypt due to unknown sessions / indexes.
|
|
1125
1234
|
*
|
|
1126
1235
|
* Map from senderKey to sessionId to Set of MatrixEvents
|
|
1127
1236
|
*/
|
|
1128
1237
|
(0, _defineProperty2.default)(this, "eventsPendingKey", new _utils.MapWithDefault(() => new _utils.MapWithDefault(() => new Set())));
|
|
1238
|
+
this.olmMachine = olmMachine;
|
|
1239
|
+
this.crypto = crypto;
|
|
1129
1240
|
}
|
|
1130
1241
|
async attemptEventDecryption(event) {
|
|
1131
1242
|
_logger.logger.info("Attempting decryption of event", event);
|
|
@@ -1134,24 +1245,63 @@ class EventDecryptor {
|
|
|
1134
1245
|
// decryption fails), we will schedule a retry.
|
|
1135
1246
|
// (fixes https://github.com/vector-im/element-web/issues/5001)
|
|
1136
1247
|
this.addEventToPendingList(event);
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1248
|
+
try {
|
|
1249
|
+
const res = await this.olmMachine.decryptRoomEvent(stringifyEvent(event), new RustSdkCryptoJs.RoomId(event.getRoomId()));
|
|
1250
|
+
|
|
1251
|
+
// Success. We can remove the event from the pending list, if
|
|
1252
|
+
// that hasn't already happened.
|
|
1253
|
+
this.removeEventFromPendingList(event);
|
|
1254
|
+
return {
|
|
1255
|
+
clearEvent: JSON.parse(res.event),
|
|
1256
|
+
claimedEd25519Key: res.senderClaimedEd25519Key,
|
|
1257
|
+
senderCurve25519Key: res.senderCurve25519Key,
|
|
1258
|
+
forwardingCurve25519KeyChain: res.forwardingCurve25519KeyChain
|
|
1259
|
+
};
|
|
1260
|
+
} catch (err) {
|
|
1261
|
+
// We need to map back to regular decryption errors (used for analytics for example)
|
|
1262
|
+
// The DecryptionErrors are used by react-sdk so is implicitly part of API, but poorly typed
|
|
1263
|
+
if (err instanceof RustSdkCryptoJs.MegolmDecryptionError) {
|
|
1264
|
+
const content = event.getWireContent();
|
|
1265
|
+
let jsError;
|
|
1266
|
+
switch (err.code) {
|
|
1267
|
+
case RustSdkCryptoJs.DecryptionErrorCode.MissingRoomKey:
|
|
1268
|
+
{
|
|
1269
|
+
jsError = new _algorithms.DecryptionError("MEGOLM_UNKNOWN_INBOUND_SESSION_ID", "The sender's device has not sent us the keys for this message.", {
|
|
1270
|
+
session: content.sender_key + "|" + content.session_id
|
|
1271
|
+
});
|
|
1272
|
+
this.crypto.queryKeyBackupRateLimited(event.getRoomId(), event.getWireContent().session_id);
|
|
1273
|
+
break;
|
|
1274
|
+
}
|
|
1275
|
+
case RustSdkCryptoJs.DecryptionErrorCode.UnknownMessageIndex:
|
|
1276
|
+
{
|
|
1277
|
+
jsError = new _algorithms.DecryptionError("OLM_UNKNOWN_MESSAGE_INDEX", "The sender's device has not sent us the keys for this message at this index.", {
|
|
1278
|
+
session: content.sender_key + "|" + content.session_id
|
|
1279
|
+
});
|
|
1280
|
+
this.crypto.queryKeyBackupRateLimited(event.getRoomId(), event.getWireContent().session_id);
|
|
1281
|
+
break;
|
|
1282
|
+
}
|
|
1283
|
+
// We don't map MismatchedIdentityKeys for now, as there is no equivalent in legacy.
|
|
1284
|
+
// Just put it on the `UNABLE_TO_DECRYPT` bucket.
|
|
1285
|
+
default:
|
|
1286
|
+
{
|
|
1287
|
+
jsError = new _algorithms.DecryptionError("UNABLE_TO_DECRYPT", err.description, {
|
|
1288
|
+
session: content.sender_key + "|" + content.session_id
|
|
1289
|
+
});
|
|
1290
|
+
break;
|
|
1291
|
+
}
|
|
1292
|
+
}
|
|
1293
|
+
throw jsError;
|
|
1294
|
+
}
|
|
1295
|
+
throw new _algorithms.DecryptionError("UNABLE_TO_DECRYPT", "Unknown error");
|
|
1296
|
+
}
|
|
1297
|
+
}
|
|
1298
|
+
async getEncryptionInfoForEvent(event) {
|
|
1299
|
+
if (!event.getClearContent()) {
|
|
1300
|
+
// not successfully decrypted
|
|
1301
|
+
return null;
|
|
1302
|
+
}
|
|
1303
|
+
const encryptionInfo = await this.olmMachine.getRoomEventEncryptionInfo(stringifyEvent(event), new RustSdkCryptoJs.RoomId(event.getRoomId()));
|
|
1304
|
+
return rustEncryptionInfoToJsEncryptionInfo(encryptionInfo);
|
|
1155
1305
|
}
|
|
1156
1306
|
|
|
1157
1307
|
/**
|
|
@@ -1204,4 +1354,53 @@ class EventDecryptor {
|
|
|
1204
1354
|
}
|
|
1205
1355
|
}
|
|
1206
1356
|
}
|
|
1357
|
+
function stringifyEvent(event) {
|
|
1358
|
+
return JSON.stringify({
|
|
1359
|
+
event_id: event.getId(),
|
|
1360
|
+
type: event.getWireType(),
|
|
1361
|
+
sender: event.getSender(),
|
|
1362
|
+
state_key: event.getStateKey(),
|
|
1363
|
+
content: event.getWireContent(),
|
|
1364
|
+
origin_server_ts: event.getTs()
|
|
1365
|
+
});
|
|
1366
|
+
}
|
|
1367
|
+
function rustEncryptionInfoToJsEncryptionInfo(encryptionInfo) {
|
|
1368
|
+
if (encryptionInfo === undefined) {
|
|
1369
|
+
// not decrypted here
|
|
1370
|
+
return null;
|
|
1371
|
+
}
|
|
1372
|
+
|
|
1373
|
+
// TODO: use strict shield semantics.
|
|
1374
|
+
const shieldState = encryptionInfo.shieldState(false);
|
|
1375
|
+
let shieldColour;
|
|
1376
|
+
switch (shieldState.color) {
|
|
1377
|
+
case RustSdkCryptoJs.ShieldColor.Grey:
|
|
1378
|
+
shieldColour = _cryptoApi.EventShieldColour.GREY;
|
|
1379
|
+
break;
|
|
1380
|
+
case RustSdkCryptoJs.ShieldColor.None:
|
|
1381
|
+
shieldColour = _cryptoApi.EventShieldColour.NONE;
|
|
1382
|
+
break;
|
|
1383
|
+
default:
|
|
1384
|
+
shieldColour = _cryptoApi.EventShieldColour.RED;
|
|
1385
|
+
}
|
|
1386
|
+
let shieldReason;
|
|
1387
|
+
if (shieldState.message === null) {
|
|
1388
|
+
shieldReason = null;
|
|
1389
|
+
} else if (shieldState.message === "Encrypted by an unverified user.") {
|
|
1390
|
+
shieldReason = _cryptoApi.EventShieldReason.UNVERIFIED_IDENTITY;
|
|
1391
|
+
} else if (shieldState.message === "Encrypted by a device not verified by its owner.") {
|
|
1392
|
+
shieldReason = _cryptoApi.EventShieldReason.UNSIGNED_DEVICE;
|
|
1393
|
+
} else if (shieldState.message === "The authenticity of this encrypted message can't be guaranteed on this device.") {
|
|
1394
|
+
shieldReason = _cryptoApi.EventShieldReason.AUTHENTICITY_NOT_GUARANTEED;
|
|
1395
|
+
} else if (shieldState.message === "Encrypted by an unknown or deleted device.") {
|
|
1396
|
+
shieldReason = _cryptoApi.EventShieldReason.UNKNOWN_DEVICE;
|
|
1397
|
+
} else {
|
|
1398
|
+
_logger.logger.warn(`Unknown shield state message '${shieldState.message}'`);
|
|
1399
|
+
shieldReason = _cryptoApi.EventShieldReason.UNKNOWN;
|
|
1400
|
+
}
|
|
1401
|
+
return {
|
|
1402
|
+
shieldColour,
|
|
1403
|
+
shieldReason
|
|
1404
|
+
};
|
|
1405
|
+
}
|
|
1207
1406
|
//# sourceMappingURL=rust-crypto.js.map
|