matrix-js-sdk 41.8.0 → 41.9.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 +11 -0
- package/README.md +1 -1
- package/lib/@types/AESEncryptedSecretStoragePayload.js +3 -1
- package/lib/@types/IIdentityServerProvider.js +3 -1
- package/lib/@types/PushRules.js +7 -7
- package/lib/@types/PushRules.js.map +1 -1
- package/lib/@types/auth.js +4 -4
- package/lib/@types/auth.js.map +1 -1
- package/lib/@types/beacon.js +2 -2
- package/lib/@types/beacon.js.map +1 -1
- package/lib/@types/common.js +3 -1
- package/lib/@types/crypto.js +3 -1
- package/lib/@types/event.js +20 -20
- package/lib/@types/event.js.map +1 -1
- package/lib/@types/events.js +3 -1
- package/lib/@types/extensible_events.js +6 -6
- package/lib/@types/extensible_events.js.map +1 -1
- package/lib/@types/global.d.js.map +1 -1
- package/lib/@types/json.js +3 -1
- package/lib/@types/local_notifications.js +3 -1
- package/lib/@types/location.js +4 -4
- package/lib/@types/location.js.map +1 -1
- package/lib/@types/matrix-sdk-crypto-wasm.d.js +3 -1
- package/lib/@types/media.js +3 -1
- package/lib/@types/membership.js +1 -1
- package/lib/@types/membership.js.map +1 -1
- package/lib/@types/partials.js +6 -6
- package/lib/@types/partials.js.map +1 -1
- package/lib/@types/polls.js +5 -5
- package/lib/@types/polls.js.map +1 -1
- package/lib/@types/read_receipts.js +2 -2
- package/lib/@types/read_receipts.js.map +1 -1
- package/lib/@types/registration.js +3 -1
- package/lib/@types/requests.js +1 -1
- package/lib/@types/requests.js.map +1 -1
- package/lib/@types/retention.js +1 -1
- package/lib/@types/retention.js.map +1 -1
- package/lib/@types/search.js +1 -1
- package/lib/@types/search.js.map +1 -1
- package/lib/@types/signed.js +3 -1
- package/lib/@types/spaces.js +3 -1
- package/lib/@types/state_events.js +3 -1
- package/lib/@types/synapse.js +3 -1
- package/lib/@types/sync.js +1 -1
- package/lib/@types/sync.js.map +1 -1
- package/lib/@types/threepids.js +1 -1
- package/lib/@types/threepids.js.map +1 -1
- package/lib/@types/topic.js +1 -1
- package/lib/@types/topic.js.map +1 -1
- package/lib/@types/uia.js +3 -1
- package/lib/NamespacedValue.js +8 -8
- package/lib/NamespacedValue.js.map +1 -1
- package/lib/ReEmitter.js +9 -16
- package/lib/ReEmitter.js.map +1 -1
- package/lib/ToDeviceMessageQueue.js +49 -57
- package/lib/ToDeviceMessageQueue.js.map +1 -1
- package/lib/autodiscovery.js +232 -247
- package/lib/autodiscovery.js.map +1 -1
- package/lib/base64.js +1 -1
- package/lib/base64.js.map +1 -1
- package/lib/browser-index.d.ts +2 -2
- package/lib/browser-index.d.ts.map +1 -1
- package/lib/browser-index.js +5 -5
- package/lib/browser-index.js.map +1 -1
- package/lib/capabilityPoller.js +19 -22
- package/lib/capabilityPoller.js.map +1 -1
- package/lib/client.d.ts +2 -8
- package/lib/client.d.ts.map +1 -1
- package/lib/client.js +2043 -2487
- package/lib/client.js.map +1 -1
- package/lib/common-crypto/CryptoBackend.js +2 -2
- package/lib/common-crypto/CryptoBackend.js.map +1 -1
- package/lib/common-crypto/key-passphrase.js.map +1 -1
- package/lib/content-helpers.js +43 -48
- package/lib/content-helpers.js.map +1 -1
- package/lib/content-repo.js +14 -24
- package/lib/content-repo.js.map +1 -1
- package/lib/crypto/store/base.js +6 -6
- package/lib/crypto/store/base.js.map +1 -1
- package/lib/crypto/store/indexeddb-crypto-store-backend.js +190 -238
- package/lib/crypto/store/indexeddb-crypto-store-backend.js.map +1 -1
- package/lib/crypto/store/indexeddb-crypto-store.js +25 -30
- package/lib/crypto/store/indexeddb-crypto-store.js.map +1 -1
- package/lib/crypto/store/localStorage-crypto-store.js +113 -145
- package/lib/crypto/store/localStorage-crypto-store.js.map +1 -1
- package/lib/crypto/store/memory-crypto-store.js +74 -105
- package/lib/crypto/store/memory-crypto-store.js.map +1 -1
- package/lib/crypto-api/CryptoEvent.js +1 -1
- package/lib/crypto-api/CryptoEvent.js.map +1 -1
- package/lib/crypto-api/CryptoEventHandlerMap.js +3 -1
- package/lib/crypto-api/index.d.ts +15 -6
- package/lib/crypto-api/index.d.ts.map +1 -1
- package/lib/crypto-api/index.js +22 -22
- package/lib/crypto-api/index.js.map +1 -1
- package/lib/crypto-api/key-passphrase.js +15 -23
- package/lib/crypto-api/key-passphrase.js.map +1 -1
- package/lib/crypto-api/keybackup.js +3 -1
- package/lib/crypto-api/recovery-key.js +11 -12
- package/lib/crypto-api/recovery-key.js.map +1 -1
- package/lib/crypto-api/verification.js +3 -3
- package/lib/crypto-api/verification.js.map +1 -1
- package/lib/digest.js +7 -14
- package/lib/digest.js.map +1 -1
- package/lib/embedded.d.ts.map +1 -1
- package/lib/embedded.js +380 -505
- package/lib/embedded.js.map +1 -1
- package/lib/errors.js +2 -2
- package/lib/errors.js.map +1 -1
- package/lib/event-mapper.js +10 -12
- package/lib/event-mapper.js.map +1 -1
- package/lib/extensible_events_v1/ExtensibleEvent.js.map +1 -1
- package/lib/extensible_events_v1/InvalidEventError.js.map +1 -1
- package/lib/extensible_events_v1/MessageEvent.js +11 -13
- package/lib/extensible_events_v1/MessageEvent.js.map +1 -1
- package/lib/extensible_events_v1/PollEndEvent.js +3 -4
- package/lib/extensible_events_v1/PollEndEvent.js.map +1 -1
- package/lib/extensible_events_v1/PollResponseEvent.js +5 -6
- package/lib/extensible_events_v1/PollResponseEvent.js.map +1 -1
- package/lib/extensible_events_v1/PollStartEvent.js +8 -10
- package/lib/extensible_events_v1/PollStartEvent.js.map +1 -1
- package/lib/extensible_events_v1/utilities.js.map +1 -1
- package/lib/feature.js +18 -31
- package/lib/feature.js.map +1 -1
- package/lib/filter-component.d.ts.map +1 -1
- package/lib/filter-component.js +20 -26
- package/lib/filter-component.js.map +1 -1
- package/lib/filter.js +14 -17
- package/lib/filter.js.map +1 -1
- package/lib/http-api/errors.js +28 -43
- package/lib/http-api/errors.js.map +1 -1
- package/lib/http-api/fetch.js +141 -159
- package/lib/http-api/fetch.js.map +1 -1
- package/lib/http-api/index.js +17 -20
- package/lib/http-api/index.js.map +1 -1
- package/lib/http-api/interface.js +1 -1
- package/lib/http-api/interface.js.map +1 -1
- package/lib/http-api/method.js +1 -1
- package/lib/http-api/method.js.map +1 -1
- package/lib/http-api/prefix.js +3 -3
- package/lib/http-api/prefix.js.map +1 -1
- package/lib/http-api/refresh.js +74 -94
- package/lib/http-api/refresh.js.map +1 -1
- package/lib/http-api/utils.d.ts +1 -1
- package/lib/http-api/utils.d.ts.map +1 -1
- package/lib/http-api/utils.js +34 -42
- package/lib/http-api/utils.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/indexeddb-helpers.js +3 -3
- package/lib/indexeddb-helpers.js.map +1 -1
- package/lib/indexeddb-worker.js.map +1 -1
- package/lib/interactive-auth.d.ts +5 -5
- package/lib/interactive-auth.d.ts.map +1 -1
- package/lib/interactive-auth.js +172 -204
- package/lib/interactive-auth.js.map +1 -1
- package/lib/logger.js +21 -57
- package/lib/logger.js.map +1 -1
- package/lib/matrix.js +7 -11
- package/lib/matrix.js.map +1 -1
- package/lib/matrixrtc/CallMembership.js +80 -74
- package/lib/matrixrtc/CallMembership.js.map +1 -1
- package/lib/matrixrtc/EncryptionManager.js +1 -1
- package/lib/matrixrtc/EncryptionManager.js.map +1 -1
- package/lib/matrixrtc/IKeyTransport.js +1 -1
- package/lib/matrixrtc/IKeyTransport.js.map +1 -1
- package/lib/matrixrtc/IMembershipManager.js +1 -1
- package/lib/matrixrtc/IMembershipManager.js.map +1 -1
- package/lib/matrixrtc/LivekitTransport.d.ts +1 -1
- package/lib/matrixrtc/LivekitTransport.js +4 -4
- package/lib/matrixrtc/LivekitTransport.js.map +1 -1
- package/lib/matrixrtc/MatrixRTCSession.js +137 -187
- package/lib/matrixrtc/MatrixRTCSession.js.map +1 -1
- package/lib/matrixrtc/MatrixRTCSessionManager.js +36 -41
- package/lib/matrixrtc/MatrixRTCSessionManager.js.map +1 -1
- package/lib/matrixrtc/MembershipManager.js +332 -378
- package/lib/matrixrtc/MembershipManager.js.map +1 -1
- package/lib/matrixrtc/MembershipManagerActionScheduler.js +54 -63
- package/lib/matrixrtc/MembershipManagerActionScheduler.js.map +1 -1
- package/lib/matrixrtc/RTCEncryptionManager.js +119 -143
- package/lib/matrixrtc/RTCEncryptionManager.js.map +1 -1
- package/lib/matrixrtc/ToDeviceKeyTransport.js +53 -58
- package/lib/matrixrtc/ToDeviceKeyTransport.js.map +1 -1
- package/lib/matrixrtc/index.js.map +1 -1
- package/lib/matrixrtc/membershipData/common.js +1 -1
- package/lib/matrixrtc/membershipData/common.js.map +1 -1
- package/lib/matrixrtc/membershipData/index.js.map +1 -1
- package/lib/matrixrtc/membershipData/rtc.js +15 -23
- package/lib/matrixrtc/membershipData/rtc.js.map +1 -1
- package/lib/matrixrtc/membershipData/session.js +4 -5
- package/lib/matrixrtc/membershipData/session.js.map +1 -1
- package/lib/matrixrtc/types.js +4 -6
- package/lib/matrixrtc/types.js.map +1 -1
- package/lib/matrixrtc/utils.js +4 -11
- package/lib/matrixrtc/utils.js.map +1 -1
- package/lib/models/MSC3089Branch.js +91 -116
- package/lib/models/MSC3089Branch.js.map +1 -1
- package/lib/models/MSC3089TreeSpace.js +209 -245
- package/lib/models/MSC3089TreeSpace.js.map +1 -1
- package/lib/models/ToDeviceMessage.js +3 -1
- package/lib/models/beacon.js +14 -13
- package/lib/models/beacon.js.map +1 -1
- package/lib/models/compare-event-ordering.js +13 -13
- package/lib/models/compare-event-ordering.js.map +1 -1
- package/lib/models/device.js +3 -3
- package/lib/models/device.js.map +1 -1
- package/lib/models/event-context.js +5 -8
- package/lib/models/event-context.js.map +1 -1
- package/lib/models/event-status.js +1 -1
- package/lib/models/event-status.js.map +1 -1
- package/lib/models/event-timeline-set.js +88 -94
- package/lib/models/event-timeline-set.js.map +1 -1
- package/lib/models/event-timeline.js +28 -30
- package/lib/models/event-timeline.js.map +1 -1
- package/lib/models/event.js +182 -226
- package/lib/models/event.js.map +1 -1
- package/lib/models/invites-ignorer-types.js +4 -4
- package/lib/models/invites-ignorer-types.js.map +1 -1
- package/lib/models/invites-ignorer.js +159 -179
- package/lib/models/invites-ignorer.js.map +1 -1
- package/lib/models/poll.js +71 -81
- package/lib/models/poll.js.map +1 -1
- package/lib/models/profile-keys.js +2 -2
- package/lib/models/profile-keys.js.map +1 -1
- package/lib/models/read-receipt.js +40 -56
- package/lib/models/read-receipt.js.map +1 -1
- package/lib/models/related-relations.js.map +1 -1
- package/lib/models/relations-container.js +22 -23
- package/lib/models/relations-container.js.map +1 -1
- package/lib/models/relations.js +133 -159
- package/lib/models/relations.js.map +1 -1
- package/lib/models/room-member.js +24 -29
- package/lib/models/room-member.js.map +1 -1
- package/lib/models/room-receipts.js +29 -43
- package/lib/models/room-receipts.js.map +1 -1
- package/lib/models/room-retention.js +74 -83
- package/lib/models/room-retention.js.map +1 -1
- package/lib/models/room-state.js +143 -172
- package/lib/models/room-state.js.map +1 -1
- package/lib/models/room-sticky-events.d.ts +1 -0
- package/lib/models/room-sticky-events.d.ts.map +1 -1
- package/lib/models/room-sticky-events.js +45 -65
- package/lib/models/room-sticky-events.js.map +1 -1
- package/lib/models/room-summary.js.map +1 -1
- package/lib/models/room.d.ts.map +1 -1
- package/lib/models/room.js +765 -909
- package/lib/models/room.js.map +1 -1
- package/lib/models/search-result.js +5 -5
- package/lib/models/search-result.js.map +1 -1
- package/lib/models/thread.js +225 -285
- package/lib/models/thread.js.map +1 -1
- package/lib/models/typed-event-emitter.js +7 -18
- package/lib/models/typed-event-emitter.js.map +1 -1
- package/lib/models/user.js +8 -8
- package/lib/models/user.js.map +1 -1
- package/lib/oidc/authorize.js +208 -241
- package/lib/oidc/authorize.js.map +1 -1
- package/lib/oidc/discovery.js +23 -36
- package/lib/oidc/discovery.js.map +1 -1
- package/lib/oidc/error.js +1 -1
- package/lib/oidc/error.js.map +1 -1
- package/lib/oidc/index.js +1 -0
- package/lib/oidc/index.js.map +1 -1
- package/lib/oidc/register.js +60 -66
- package/lib/oidc/register.js.map +1 -1
- package/lib/oidc/tokenRefresher.js +77 -91
- package/lib/oidc/tokenRefresher.js.map +1 -1
- package/lib/oidc/validate.js +18 -18
- package/lib/oidc/validate.js.map +1 -1
- package/lib/pushprocessor.js +71 -82
- package/lib/pushprocessor.js.map +1 -1
- package/lib/randomstring.js +9 -9
- package/lib/randomstring.js.map +1 -1
- package/lib/realtime-callbacks.js +25 -28
- package/lib/realtime-callbacks.js.map +1 -1
- package/lib/receipt-accumulator.d.ts +2 -0
- package/lib/receipt-accumulator.d.ts.map +1 -1
- package/lib/receipt-accumulator.js +14 -22
- package/lib/receipt-accumulator.js.map +1 -1
- package/lib/rendezvous/MSC4108SignInWithQR.js +271 -302
- package/lib/rendezvous/MSC4108SignInWithQR.js.map +1 -1
- package/lib/rendezvous/RendezvousChannel.js +3 -1
- package/lib/rendezvous/RendezvousCode.js +3 -1
- package/lib/rendezvous/RendezvousError.js.map +1 -1
- package/lib/rendezvous/RendezvousFailureReason.js +2 -2
- package/lib/rendezvous/RendezvousFailureReason.js.map +1 -1
- package/lib/rendezvous/RendezvousIntent.js +1 -1
- package/lib/rendezvous/RendezvousIntent.js.map +1 -1
- package/lib/rendezvous/RendezvousTransport.js +3 -1
- package/lib/rendezvous/channels/MSC4108SecureChannel.js +123 -147
- package/lib/rendezvous/channels/MSC4108SecureChannel.js.map +1 -1
- package/lib/rendezvous/index.js +44 -69
- package/lib/rendezvous/index.js.map +1 -1
- package/lib/rendezvous/transports/MSC4108RendezvousSession.d.ts +1 -1
- package/lib/rendezvous/transports/MSC4108RendezvousSession.js +134 -152
- package/lib/rendezvous/transports/MSC4108RendezvousSession.js.map +1 -1
- package/lib/retentionPolicy.js +6 -9
- package/lib/retentionPolicy.js.map +1 -1
- package/lib/room-hierarchy.js +52 -60
- package/lib/room-hierarchy.js.map +1 -1
- package/lib/rust-crypto/CrossSigningIdentity.js +94 -104
- package/lib/rust-crypto/CrossSigningIdentity.js.map +1 -1
- package/lib/rust-crypto/DehydratedDeviceManager.js +157 -190
- package/lib/rust-crypto/DehydratedDeviceManager.js.map +1 -1
- package/lib/rust-crypto/KeyClaimManager.js +18 -22
- package/lib/rust-crypto/KeyClaimManager.js.map +1 -1
- package/lib/rust-crypto/OutgoingRequestProcessor.js +109 -139
- package/lib/rust-crypto/OutgoingRequestProcessor.js.map +1 -1
- package/lib/rust-crypto/OutgoingRequestsManager.js +66 -80
- package/lib/rust-crypto/OutgoingRequestsManager.js.map +1 -1
- package/lib/rust-crypto/PerSessionKeyBackupDownloader.d.ts +1 -1
- package/lib/rust-crypto/PerSessionKeyBackupDownloader.js +196 -224
- package/lib/rust-crypto/PerSessionKeyBackupDownloader.js.map +1 -1
- package/lib/rust-crypto/RoomEncryptor.js +127 -143
- package/lib/rust-crypto/RoomEncryptor.js.map +1 -1
- package/lib/rust-crypto/backup.js +453 -549
- package/lib/rust-crypto/backup.js.map +1 -1
- package/lib/rust-crypto/constants.js +1 -1
- package/lib/rust-crypto/constants.js.map +1 -1
- package/lib/rust-crypto/device-converter.js +15 -28
- package/lib/rust-crypto/device-converter.js.map +1 -1
- package/lib/rust-crypto/index.js +103 -116
- package/lib/rust-crypto/index.js.map +1 -1
- package/lib/rust-crypto/libolm_migration.js +303 -365
- package/lib/rust-crypto/libolm_migration.js.map +1 -1
- package/lib/rust-crypto/rust-crypto.d.ts +5 -1
- package/lib/rust-crypto/rust-crypto.d.ts.map +1 -1
- package/lib/rust-crypto/rust-crypto.js +1067 -1332
- package/lib/rust-crypto/rust-crypto.js.map +1 -1
- package/lib/rust-crypto/secret-storage.js +12 -25
- package/lib/rust-crypto/secret-storage.js.map +1 -1
- package/lib/rust-crypto/verification.js +137 -189
- package/lib/rust-crypto/verification.js.map +1 -1
- package/lib/scheduler.js +44 -19
- package/lib/scheduler.js.map +1 -1
- package/lib/secret-storage.js +179 -213
- package/lib/secret-storage.js.map +1 -1
- package/lib/serverCapabilities.js +6 -9
- package/lib/serverCapabilities.js.map +1 -1
- package/lib/service-types.js +1 -1
- package/lib/service-types.js.map +1 -1
- package/lib/sliding-sync-sdk.d.ts.map +1 -1
- package/lib/sliding-sync-sdk.js +368 -424
- package/lib/sliding-sync-sdk.js.map +1 -1
- package/lib/sliding-sync.js +135 -171
- package/lib/sliding-sync.js.map +1 -1
- package/lib/store/index.js +3 -1
- package/lib/store/indexeddb-backend.js +3 -1
- package/lib/store/indexeddb-local-backend.js +194 -253
- package/lib/store/indexeddb-local-backend.js.map +1 -1
- package/lib/store/indexeddb-remote-backend.js +33 -63
- package/lib/store/indexeddb-remote-backend.js.map +1 -1
- package/lib/store/indexeddb-store-worker.js +22 -23
- package/lib/store/indexeddb-store-worker.js.map +1 -1
- package/lib/store/indexeddb.js +44 -71
- package/lib/store/indexeddb.js.map +1 -1
- package/lib/store/local-storage-events-emitter.js +2 -2
- package/lib/store/local-storage-events-emitter.js.map +1 -1
- package/lib/store/memory.js +34 -57
- package/lib/store/memory.js.map +1 -1
- package/lib/store/stub.js +22 -35
- package/lib/store/stub.js.map +1 -1
- package/lib/sync-accumulator.js +54 -66
- package/lib/sync-accumulator.js.map +1 -1
- package/lib/sync.d.ts.map +1 -1
- package/lib/sync.js +905 -998
- package/lib/sync.js.map +1 -1
- package/lib/testing.js +63 -105
- package/lib/testing.js.map +1 -1
- package/lib/thread-utils.js +1 -4
- package/lib/thread-utils.js.map +1 -1
- package/lib/timeline-window.js +89 -102
- package/lib/timeline-window.js.map +1 -1
- package/lib/types.js +1 -1
- package/lib/types.js.map +1 -1
- package/lib/utils/decryptAESSecretStorageItem.js +14 -25
- package/lib/utils/decryptAESSecretStorageItem.js.map +1 -1
- package/lib/utils/encryptAESSecretStorageItem.js +27 -38
- package/lib/utils/encryptAESSecretStorageItem.js.map +1 -1
- package/lib/utils/internal/deriveKeys.js +25 -32
- package/lib/utils/internal/deriveKeys.js.map +1 -1
- package/lib/utils/roomVersion.js +1 -1
- package/lib/utils/roomVersion.js.map +1 -1
- package/lib/utils.js +83 -135
- package/lib/utils.js.map +1 -1
- package/lib/version-support.js +3 -3
- package/lib/version-support.js.map +1 -1
- package/lib/webrtc/audioContext.js +5 -6
- package/lib/webrtc/audioContext.js.map +1 -1
- package/lib/webrtc/call.js +1081 -1250
- package/lib/webrtc/call.js.map +1 -1
- package/lib/webrtc/callEventHandler.js +202 -214
- package/lib/webrtc/callEventHandler.js.map +1 -1
- package/lib/webrtc/callEventTypes.js +2 -2
- package/lib/webrtc/callEventTypes.js.map +1 -1
- package/lib/webrtc/callFeed.js +18 -20
- package/lib/webrtc/callFeed.js.map +1 -1
- package/lib/webrtc/groupCall.js +513 -602
- package/lib/webrtc/groupCall.js.map +1 -1
- package/lib/webrtc/groupCallEventHandler.js +59 -62
- package/lib/webrtc/groupCallEventHandler.js.map +1 -1
- package/lib/webrtc/mediaHandler.js +198 -232
- package/lib/webrtc/mediaHandler.js.map +1 -1
- package/lib/webrtc/stats/callFeedStatsReporter.js +16 -20
- package/lib/webrtc/stats/callFeedStatsReporter.js.map +1 -1
- package/lib/webrtc/stats/callStatsReportGatherer.js +67 -75
- package/lib/webrtc/stats/callStatsReportGatherer.js.map +1 -1
- package/lib/webrtc/stats/callStatsReportSummary.js +3 -1
- package/lib/webrtc/stats/connectionStats.js.map +1 -1
- package/lib/webrtc/stats/connectionStatsBuilder.js +2 -2
- package/lib/webrtc/stats/connectionStatsBuilder.js.map +1 -1
- package/lib/webrtc/stats/connectionStatsReportBuilder.js +20 -24
- package/lib/webrtc/stats/connectionStatsReportBuilder.js.map +1 -1
- package/lib/webrtc/stats/groupCallStats.js +6 -8
- package/lib/webrtc/stats/groupCallStats.js.map +1 -1
- package/lib/webrtc/stats/media/mediaSsrcHandler.js +7 -8
- package/lib/webrtc/stats/media/mediaSsrcHandler.js.map +1 -1
- package/lib/webrtc/stats/media/mediaTrackHandler.js +7 -9
- package/lib/webrtc/stats/media/mediaTrackHandler.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 +7 -7
- package/lib/webrtc/stats/media/mediaTrackStatsHandler.js.map +1 -1
- package/lib/webrtc/stats/statsReport.js +1 -1
- package/lib/webrtc/stats/statsReport.js.map +1 -1
- package/lib/webrtc/stats/statsReportEmitter.js.map +1 -1
- package/lib/webrtc/stats/summaryStatsReportGatherer.js +14 -14
- package/lib/webrtc/stats/summaryStatsReportGatherer.js.map +1 -1
- package/lib/webrtc/stats/trackStatsBuilder.js +32 -34
- package/lib/webrtc/stats/trackStatsBuilder.js.map +1 -1
- package/lib/webrtc/stats/transportStats.js +3 -1
- package/lib/webrtc/stats/transportStatsBuilder.js +9 -9
- package/lib/webrtc/stats/transportStatsBuilder.js.map +1 -1
- package/lib/webrtc/stats/valueFormatter.js +1 -1
- package/lib/webrtc/stats/valueFormatter.js.map +1 -1
- package/package.json +18 -33
- package/src/@types/global.d.ts +2 -2
- package/src/ToDeviceMessageQueue.ts +2 -2
- package/src/browser-index.ts +4 -4
- package/src/client.ts +15 -20
- package/src/crypto-api/index.ts +17 -6
- package/src/embedded.ts +4 -6
- package/src/filter-component.ts +1 -0
- package/src/http-api/utils.ts +1 -1
- package/src/interactive-auth.ts +11 -5
- package/src/matrixrtc/LivekitTransport.ts +1 -1
- package/src/matrixrtc/MatrixRTCSession.ts +1 -1
- package/src/models/MSC3089Branch.ts +1 -1
- package/src/models/room-sticky-events.ts +1 -0
- package/src/models/room.ts +9 -11
- package/src/receipt-accumulator.ts +2 -0
- package/src/rendezvous/index.ts +1 -1
- package/src/rendezvous/transports/MSC4108RendezvousSession.ts +2 -2
- package/src/rust-crypto/PerSessionKeyBackupDownloader.ts +1 -1
- package/src/rust-crypto/index.ts +6 -6
- package/src/rust-crypto/rust-crypto.ts +31 -7
- package/src/rust-crypto/verification.ts +1 -1
- package/src/sliding-sync-sdk.ts +5 -7
- package/src/store/indexeddb-local-backend.ts +3 -3
- package/src/sync.ts +6 -8
package/lib/secret-storage.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
1
|
/*
|
|
4
2
|
Copyright 2021-2023 The Matrix.org Foundation C.I.C.
|
|
5
3
|
|
|
@@ -27,7 +25,7 @@ import { secureRandomString } from "./randomstring.js";
|
|
|
27
25
|
import { logger } from "./logger.js";
|
|
28
26
|
import encryptAESSecretStorageItem from "./utils/encryptAESSecretStorageItem.js";
|
|
29
27
|
import decryptAESSecretStorageItem from "./utils/decryptAESSecretStorageItem.js";
|
|
30
|
-
export
|
|
28
|
+
export const SECRET_STORAGE_ALGORITHM_V1_AES = "m.secret_storage.v1.aes-hmac-sha2";
|
|
31
29
|
|
|
32
30
|
/**
|
|
33
31
|
* Common base interface for Secret Storage Keys.
|
|
@@ -124,14 +122,10 @@ export class ServerSideSecretStorageImpl {
|
|
|
124
122
|
*
|
|
125
123
|
* @returns The default key ID or null if no default key ID is set
|
|
126
124
|
*/
|
|
127
|
-
getDefaultKeyId() {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
var defaultKey = yield _this.accountDataAdapter.getAccountDataFromServer("m.secret_storage.default_key");
|
|
132
|
-
if (!defaultKey) return null;
|
|
133
|
-
return (_defaultKey$key = defaultKey.key) !== null && _defaultKey$key !== void 0 ? _defaultKey$key : null;
|
|
134
|
-
})();
|
|
125
|
+
async getDefaultKeyId() {
|
|
126
|
+
const defaultKey = await this.accountDataAdapter.getAccountDataFromServer("m.secret_storage.default_key");
|
|
127
|
+
if (!defaultKey) return null;
|
|
128
|
+
return defaultKey.key ?? null;
|
|
135
129
|
}
|
|
136
130
|
|
|
137
131
|
/**
|
|
@@ -139,7 +133,7 @@ export class ServerSideSecretStorageImpl {
|
|
|
139
133
|
*/
|
|
140
134
|
setDefaultKeyId(keyId) {
|
|
141
135
|
return new Promise((resolve, reject) => {
|
|
142
|
-
|
|
136
|
+
const listener = ev => {
|
|
143
137
|
if (ev.getType() !== "m.secret_storage.default_key") {
|
|
144
138
|
// Different account data item
|
|
145
139
|
return;
|
|
@@ -147,8 +141,8 @@ export class ServerSideSecretStorageImpl {
|
|
|
147
141
|
|
|
148
142
|
// If keyId === null, the content should be an empty object.
|
|
149
143
|
// Otherwise, the `key` in the content object should match keyId.
|
|
150
|
-
|
|
151
|
-
|
|
144
|
+
const content = ev.getContent();
|
|
145
|
+
const isSameKey = keyId === null ? Object.keys(content).length === 0 : content.key === keyId;
|
|
152
146
|
if (isSameKey) {
|
|
153
147
|
this.accountDataAdapter.removeListener(ClientEvent.AccountData, listener);
|
|
154
148
|
resolve();
|
|
@@ -160,7 +154,7 @@ export class ServerSideSecretStorageImpl {
|
|
|
160
154
|
// It doesn't specify how to delete the default key; we do it by setting the account data to an empty object.
|
|
161
155
|
//
|
|
162
156
|
// [1]: https://spec.matrix.org/v1.13/client-server-api/#key-storage
|
|
163
|
-
|
|
157
|
+
const newValue = keyId === null ? {} : {
|
|
164
158
|
key: keyId
|
|
165
159
|
};
|
|
166
160
|
this.accountDataAdapter.setAccountData("m.secret_storage.default_key", newValue).catch(e => {
|
|
@@ -183,39 +177,37 @@ export class ServerSideSecretStorageImpl {
|
|
|
183
177
|
* keyId: the ID of the key
|
|
184
178
|
* keyInfo: details about the key (iv, mac, passphrase)
|
|
185
179
|
*/
|
|
186
|
-
addKey(algorithm, opts, keyId) {
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
};
|
|
218
|
-
})();
|
|
180
|
+
async addKey(algorithm, opts, keyId) {
|
|
181
|
+
if (algorithm !== SECRET_STORAGE_ALGORITHM_V1_AES) {
|
|
182
|
+
throw new Error(`Unknown key algorithm ${algorithm}`);
|
|
183
|
+
}
|
|
184
|
+
const keyInfo = {
|
|
185
|
+
algorithm
|
|
186
|
+
};
|
|
187
|
+
if (opts.name) {
|
|
188
|
+
keyInfo.name = opts.name;
|
|
189
|
+
}
|
|
190
|
+
if (opts.passphrase) {
|
|
191
|
+
keyInfo.passphrase = opts.passphrase;
|
|
192
|
+
}
|
|
193
|
+
const {
|
|
194
|
+
iv,
|
|
195
|
+
mac
|
|
196
|
+
} = await calculateKeyCheck(opts.key);
|
|
197
|
+
keyInfo.iv = iv;
|
|
198
|
+
keyInfo.mac = mac;
|
|
199
|
+
|
|
200
|
+
// Create a unique key id. XXX: this is racey.
|
|
201
|
+
if (!keyId) {
|
|
202
|
+
do {
|
|
203
|
+
keyId = secureRandomString(32);
|
|
204
|
+
} while (await this.accountDataAdapter.getAccountDataFromServer(`m.secret_storage.key.${keyId}`));
|
|
205
|
+
}
|
|
206
|
+
await this.accountDataAdapter.setAccountData(`m.secret_storage.key.${keyId}`, keyInfo);
|
|
207
|
+
return {
|
|
208
|
+
keyId,
|
|
209
|
+
keyInfo
|
|
210
|
+
};
|
|
219
211
|
}
|
|
220
212
|
|
|
221
213
|
/**
|
|
@@ -227,18 +219,15 @@ export class ServerSideSecretStorageImpl {
|
|
|
227
219
|
* the form [keyId, keyInfo]. Otherwise, null is returned.
|
|
228
220
|
* XXX: why is this an array when addKey returns an object?
|
|
229
221
|
*/
|
|
230
|
-
getKey(keyId) {
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
var keyInfo = yield _this3.accountDataAdapter.getAccountDataFromServer("m.secret_storage.key.".concat(keyId));
|
|
240
|
-
return keyInfo ? [keyId, keyInfo] : null;
|
|
241
|
-
})();
|
|
222
|
+
async getKey(keyId) {
|
|
223
|
+
if (!keyId) {
|
|
224
|
+
keyId = await this.getDefaultKeyId();
|
|
225
|
+
}
|
|
226
|
+
if (!keyId) {
|
|
227
|
+
return null;
|
|
228
|
+
}
|
|
229
|
+
const keyInfo = await this.accountDataAdapter.getAccountDataFromServer(`m.secret_storage.key.${keyId}`);
|
|
230
|
+
return keyInfo ? [keyId, keyInfo] : null;
|
|
242
231
|
}
|
|
243
232
|
|
|
244
233
|
/**
|
|
@@ -248,12 +237,9 @@ export class ServerSideSecretStorageImpl {
|
|
|
248
237
|
* for. Defaults to the default key ID if not provided.
|
|
249
238
|
* @returns Whether we have the key.
|
|
250
239
|
*/
|
|
251
|
-
hasKey(keyId) {
|
|
252
|
-
|
|
253
|
-
return
|
|
254
|
-
var key = yield _this4.getKey(keyId);
|
|
255
|
-
return Boolean(key);
|
|
256
|
-
})();
|
|
240
|
+
async hasKey(keyId) {
|
|
241
|
+
const key = await this.getKey(keyId);
|
|
242
|
+
return Boolean(key);
|
|
257
243
|
}
|
|
258
244
|
|
|
259
245
|
/**
|
|
@@ -264,72 +250,66 @@ export class ServerSideSecretStorageImpl {
|
|
|
264
250
|
*
|
|
265
251
|
* @returns whether or not the key matches
|
|
266
252
|
*/
|
|
267
|
-
checkKey(key, info) {
|
|
268
|
-
|
|
269
|
-
if (info.
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
} else {
|
|
275
|
-
// if we have no information, we have to assume the key is right
|
|
276
|
-
return true;
|
|
277
|
-
}
|
|
253
|
+
async checkKey(key, info) {
|
|
254
|
+
if (info.algorithm === SECRET_STORAGE_ALGORITHM_V1_AES) {
|
|
255
|
+
if (info.mac) {
|
|
256
|
+
const {
|
|
257
|
+
mac
|
|
258
|
+
} = await calculateKeyCheck(key, info.iv);
|
|
259
|
+
return trimTrailingEquals(info.mac) === trimTrailingEquals(mac);
|
|
278
260
|
} else {
|
|
279
|
-
|
|
261
|
+
// if we have no information, we have to assume the key is right
|
|
262
|
+
return true;
|
|
280
263
|
}
|
|
281
|
-
}
|
|
264
|
+
} else {
|
|
265
|
+
throw new Error("Unknown algorithm");
|
|
266
|
+
}
|
|
282
267
|
}
|
|
283
268
|
|
|
284
269
|
/**
|
|
285
270
|
* Implementation of {@link ServerSideSecretStorage#store}.
|
|
286
271
|
*/
|
|
287
|
-
store(name, secret, keys) {
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
if (!
|
|
297
|
-
|
|
298
|
-
if (!defaultKeyId) {
|
|
299
|
-
throw new Error("No keys specified and no default key present");
|
|
300
|
-
}
|
|
301
|
-
keys = [defaultKeyId];
|
|
272
|
+
async store(name, secret, keys) {
|
|
273
|
+
if (secret === null) {
|
|
274
|
+
// remove secret
|
|
275
|
+
await this.accountDataAdapter.setAccountData(name, {});
|
|
276
|
+
return;
|
|
277
|
+
}
|
|
278
|
+
const encrypted = {};
|
|
279
|
+
if (!keys) {
|
|
280
|
+
const defaultKeyId = await this.getDefaultKeyId();
|
|
281
|
+
if (!defaultKeyId) {
|
|
282
|
+
throw new Error("No keys specified and no default key present");
|
|
302
283
|
}
|
|
303
|
-
|
|
304
|
-
|
|
284
|
+
keys = [defaultKeyId];
|
|
285
|
+
}
|
|
286
|
+
if (keys.length === 0) {
|
|
287
|
+
throw new Error("Zero keys given to encrypt with!");
|
|
288
|
+
}
|
|
289
|
+
for (const keyId of keys) {
|
|
290
|
+
// get key information from key storage
|
|
291
|
+
const keyInfo = await this.accountDataAdapter.getAccountDataFromServer(`m.secret_storage.key.${keyId}`);
|
|
292
|
+
if (!keyInfo) {
|
|
293
|
+
throw new Error("Unknown key: " + keyId);
|
|
305
294
|
}
|
|
306
|
-
for (var _keyId of keys) {
|
|
307
|
-
// get key information from key storage
|
|
308
|
-
var _keyInfo = yield _this5.accountDataAdapter.getAccountDataFromServer("m.secret_storage.key.".concat(_keyId));
|
|
309
|
-
if (!_keyInfo) {
|
|
310
|
-
throw new Error("Unknown key: " + _keyId);
|
|
311
|
-
}
|
|
312
295
|
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
logger.warn("unknown algorithm for secret storage key " + _keyId + ": " + _keyInfo.algorithm);
|
|
324
|
-
// do nothing if we don't understand the encryption algorithm
|
|
325
|
-
}
|
|
296
|
+
// encrypt secret, based on the algorithm
|
|
297
|
+
if (keyInfo.algorithm === SECRET_STORAGE_ALGORITHM_V1_AES) {
|
|
298
|
+
const keys = {
|
|
299
|
+
[keyId]: keyInfo
|
|
300
|
+
};
|
|
301
|
+
const [, encryption] = await this.getSecretStorageKey(keys, name);
|
|
302
|
+
encrypted[keyId] = await encryption.encrypt(secret);
|
|
303
|
+
} else {
|
|
304
|
+
logger.warn("unknown algorithm for secret storage key " + keyId + ": " + keyInfo.algorithm);
|
|
305
|
+
// do nothing if we don't understand the encryption algorithm
|
|
326
306
|
}
|
|
307
|
+
}
|
|
327
308
|
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
})();
|
|
309
|
+
// save encrypted secret
|
|
310
|
+
await this.accountDataAdapter.setAccountData(name, {
|
|
311
|
+
encrypted
|
|
312
|
+
});
|
|
333
313
|
}
|
|
334
314
|
|
|
335
315
|
/**
|
|
@@ -343,42 +323,36 @@ export class ServerSideSecretStorageImpl {
|
|
|
343
323
|
* @returns the decrypted contents of the secret, or "undefined" if `name` is not found in
|
|
344
324
|
* the user's account data.
|
|
345
325
|
*/
|
|
346
|
-
get(name) {
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
if (_encInfo.iv && _encInfo.ciphertext && _encInfo.mac) {
|
|
366
|
-
keys[_keyId2] = _keyInfo2;
|
|
367
|
-
}
|
|
326
|
+
async get(name) {
|
|
327
|
+
const secretInfo = await this.accountDataAdapter.getAccountDataFromServer(name);
|
|
328
|
+
if (!secretInfo) {
|
|
329
|
+
return;
|
|
330
|
+
}
|
|
331
|
+
if (!secretInfo.encrypted) {
|
|
332
|
+
throw new Error("Content is not encrypted!");
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
// get possible keys to decrypt
|
|
336
|
+
const keys = {};
|
|
337
|
+
for (const keyId of Object.keys(secretInfo.encrypted)) {
|
|
338
|
+
// get key information from key storage
|
|
339
|
+
const keyInfo = await this.accountDataAdapter.getAccountDataFromServer(`m.secret_storage.key.${keyId}`);
|
|
340
|
+
const encInfo = secretInfo.encrypted[keyId];
|
|
341
|
+
// only use keys we understand the encryption algorithm of
|
|
342
|
+
if (keyInfo?.algorithm === SECRET_STORAGE_ALGORITHM_V1_AES) {
|
|
343
|
+
if (encInfo.iv && encInfo.ciphertext && encInfo.mac) {
|
|
344
|
+
keys[keyId] = keyInfo;
|
|
368
345
|
}
|
|
369
346
|
}
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
var encInfo = secretInfo.encrypted[keyId];
|
|
380
|
-
return decryption.decrypt(encInfo);
|
|
381
|
-
})();
|
|
347
|
+
}
|
|
348
|
+
if (Object.keys(keys).length === 0) {
|
|
349
|
+
throw new Error(`Could not decrypt ${name} because none of ` + `the keys it is encrypted with are for a supported algorithm`);
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
// fetch private key from app
|
|
353
|
+
const [keyId, decryption] = await this.getSecretStorageKey(keys, name);
|
|
354
|
+
const encInfo = secretInfo.encrypted[keyId];
|
|
355
|
+
return decryption.decrypt(encInfo);
|
|
382
356
|
}
|
|
383
357
|
|
|
384
358
|
/**
|
|
@@ -390,66 +364,58 @@ export class ServerSideSecretStorageImpl {
|
|
|
390
364
|
* with, or null if it is not present or not encrypted with a trusted
|
|
391
365
|
* key
|
|
392
366
|
*/
|
|
393
|
-
isStored(name) {
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
//
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
if (encInfo.iv && encInfo.ciphertext && encInfo.mac) {
|
|
411
|
-
ret[_keyId3] = _keyInfo3;
|
|
412
|
-
}
|
|
367
|
+
async isStored(name) {
|
|
368
|
+
// check if secret exists
|
|
369
|
+
const secretInfo = await this.accountDataAdapter.getAccountDataFromServer(name);
|
|
370
|
+
if (!secretInfo?.encrypted) return null;
|
|
371
|
+
const ret = {};
|
|
372
|
+
|
|
373
|
+
// filter secret encryption keys with supported algorithm
|
|
374
|
+
for (const keyId of Object.keys(secretInfo.encrypted)) {
|
|
375
|
+
// get key information from key storage
|
|
376
|
+
const keyInfo = await this.accountDataAdapter.getAccountDataFromServer(`m.secret_storage.key.${keyId}`);
|
|
377
|
+
if (!keyInfo) continue;
|
|
378
|
+
const encInfo = secretInfo.encrypted[keyId];
|
|
379
|
+
|
|
380
|
+
// only use keys we understand the encryption algorithm of
|
|
381
|
+
if (keyInfo.algorithm === SECRET_STORAGE_ALGORITHM_V1_AES) {
|
|
382
|
+
if (encInfo.iv && encInfo.ciphertext && encInfo.mac) {
|
|
383
|
+
ret[keyId] = keyInfo;
|
|
413
384
|
}
|
|
414
385
|
}
|
|
415
|
-
|
|
416
|
-
|
|
386
|
+
}
|
|
387
|
+
return Object.keys(ret).length ? ret : null;
|
|
417
388
|
}
|
|
418
|
-
getSecretStorageKey(keys, name) {
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
return [keyId, decryption];
|
|
449
|
-
} else {
|
|
450
|
-
throw new Error("Unknown key type: " + keys[keyId].algorithm);
|
|
451
|
-
}
|
|
452
|
-
})();
|
|
389
|
+
async getSecretStorageKey(keys, name) {
|
|
390
|
+
if (!this.callbacks.getSecretStorageKey) {
|
|
391
|
+
throw new Error("No getSecretStorageKey callback supplied");
|
|
392
|
+
}
|
|
393
|
+
const returned = await this.callbacks.getSecretStorageKey({
|
|
394
|
+
keys
|
|
395
|
+
}, name);
|
|
396
|
+
if (!returned) {
|
|
397
|
+
throw new Error("getSecretStorageKey callback returned falsey");
|
|
398
|
+
}
|
|
399
|
+
if (returned.length < 2) {
|
|
400
|
+
throw new Error("getSecretStorageKey callback returned invalid data");
|
|
401
|
+
}
|
|
402
|
+
const [keyId, privateKey] = returned;
|
|
403
|
+
if (!keys[keyId]) {
|
|
404
|
+
throw new Error("App returned unknown key from getSecretStorageKey!");
|
|
405
|
+
}
|
|
406
|
+
if (keys[keyId].algorithm === SECRET_STORAGE_ALGORITHM_V1_AES) {
|
|
407
|
+
const decryption = {
|
|
408
|
+
encrypt: function (secret) {
|
|
409
|
+
return encryptAESSecretStorageItem(secret, privateKey, name);
|
|
410
|
+
},
|
|
411
|
+
decrypt: function (encInfo) {
|
|
412
|
+
return decryptAESSecretStorageItem(encInfo, privateKey, name);
|
|
413
|
+
}
|
|
414
|
+
};
|
|
415
|
+
return [keyId, decryption];
|
|
416
|
+
} else {
|
|
417
|
+
throw new Error("Unknown key type: " + keys[keyId].algorithm);
|
|
418
|
+
}
|
|
453
419
|
}
|
|
454
420
|
}
|
|
455
421
|
|
|
@@ -464,7 +430,7 @@ export function trimTrailingEquals(input) {
|
|
|
464
430
|
// Not sure I believe it, but it's easy enough to work around.
|
|
465
431
|
|
|
466
432
|
// find the number of characters before the trailing =
|
|
467
|
-
|
|
433
|
+
let i = input.length;
|
|
468
434
|
while (i >= 1 && input.charCodeAt(i - 1) == 0x3d) i--;
|
|
469
435
|
|
|
470
436
|
// trim to the calculated length
|
|
@@ -476,7 +442,7 @@ export function trimTrailingEquals(input) {
|
|
|
476
442
|
}
|
|
477
443
|
|
|
478
444
|
// string of zeroes, for calculating the key check
|
|
479
|
-
|
|
445
|
+
const ZERO_STR = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
|
|
480
446
|
|
|
481
447
|
/**
|
|
482
448
|
* Calculate the MAC for checking the key.
|