@open-e2ee/signal-protocol-sdk 0.1.0-alpha.6 → 0.1.0-alpha.8
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/ADAPTERS.md +1 -1
- package/ARCHITECTURE.md +1 -1
- package/CHANGELOG.md +876 -3
- package/COMMERCIAL.md +56 -0
- package/README.md +13 -8
- package/SECURITY.md +15 -1
- package/client/README.md +1 -1
- package/dist/client/client.d.ts +32 -28
- package/dist/client/client.d.ts.map +1 -1
- package/dist/client/client.js +136 -80
- package/dist/client/client.js.map +1 -1
- package/dist/client/compose.d.ts +6 -1
- package/dist/client/compose.d.ts.map +1 -1
- package/dist/client/compose.js +2 -0
- package/dist/client/compose.js.map +1 -1
- package/dist/client/config.d.ts +53 -19
- package/dist/client/config.d.ts.map +1 -1
- package/dist/client/config.js.map +1 -1
- package/dist/client/endorsement-manager.d.ts +23 -2
- package/dist/client/endorsement-manager.d.ts.map +1 -1
- package/dist/client/endorsement-manager.js +35 -10
- package/dist/client/endorsement-manager.js.map +1 -1
- package/dist/client/groups.d.ts +29 -29
- package/dist/client/groups.d.ts.map +1 -1
- package/dist/client/groups.js +54 -37
- package/dist/client/groups.js.map +1 -1
- package/dist/client/headless.d.ts +1 -1
- package/dist/client/headless.js +1 -1
- package/dist/client/sealed-sender-ops.d.ts +27 -1
- package/dist/client/sealed-sender-ops.d.ts.map +1 -1
- package/dist/client/sealed-sender-ops.js +36 -6
- package/dist/client/sealed-sender-ops.js.map +1 -1
- package/dist/client/signal-service-cipher.d.ts +21 -2
- package/dist/client/signal-service-cipher.d.ts.map +1 -1
- package/dist/client/signal-service-cipher.js +119 -53
- package/dist/client/signal-service-cipher.js.map +1 -1
- package/dist/client/types.d.ts +20 -7
- package/dist/client/types.d.ts.map +1 -1
- package/dist/client/types.js.map +1 -1
- package/dist/groups/index.d.ts +4 -4
- package/dist/groups/index.d.ts.map +1 -1
- package/dist/groups/index.js +3 -3
- package/dist/groups/index.js.map +1 -1
- package/dist/index.d.ts +12 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -3
- package/dist/index.js.map +1 -1
- package/dist/internal/crypto/index.d.ts +1 -1
- package/dist/internal/crypto/index.d.ts.map +1 -1
- package/dist/internal/crypto/index.js +1 -1
- package/dist/internal/crypto/index.js.map +1 -1
- package/dist/internal/crypto/random.d.ts +9 -0
- package/dist/internal/crypto/random.d.ts.map +1 -1
- package/dist/internal/crypto/random.js +16 -0
- package/dist/internal/crypto/random.js.map +1 -1
- package/dist/internal/groups/access-control.d.ts +170 -0
- package/dist/internal/groups/access-control.d.ts.map +1 -0
- package/dist/internal/groups/access-control.js +284 -0
- package/dist/internal/groups/access-control.js.map +1 -0
- package/dist/internal/groups/change-actions.d.ts +57 -0
- package/dist/internal/groups/change-actions.d.ts.map +1 -0
- package/dist/internal/groups/change-actions.js +827 -0
- package/dist/internal/groups/change-actions.js.map +1 -0
- package/dist/internal/groups/change-authorization.d.ts +16 -0
- package/dist/internal/groups/change-authorization.d.ts.map +1 -0
- package/dist/internal/groups/change-authorization.js +120 -0
- package/dist/internal/groups/change-authorization.js.map +1 -0
- package/dist/internal/{groups-v2 → groups}/encrypted-state.d.ts +12 -2
- package/dist/internal/groups/encrypted-state.d.ts.map +1 -0
- package/dist/internal/{groups-v2 → groups}/encrypted-state.js +122 -22
- package/dist/internal/groups/encrypted-state.js.map +1 -0
- package/dist/internal/groups/group-id.d.ts +9 -9
- package/dist/internal/groups/group-id.d.ts.map +1 -1
- package/dist/internal/groups/group-id.js +11 -12
- package/dist/internal/groups/group-id.js.map +1 -1
- package/dist/internal/groups/index.d.ts +16 -6
- package/dist/internal/groups/index.d.ts.map +1 -1
- package/dist/internal/groups/index.js +9 -1
- package/dist/internal/groups/index.js.map +1 -1
- package/dist/internal/groups/invite-link.d.ts.map +1 -0
- package/dist/internal/groups/invite-link.js.map +1 -0
- package/dist/internal/{groups-v2 → groups}/manager.d.ts +188 -40
- package/dist/internal/groups/manager.d.ts.map +1 -0
- package/dist/internal/groups/manager.js +1923 -0
- package/dist/internal/groups/manager.js.map +1 -0
- package/dist/internal/groups/sdk-store.d.ts +32 -0
- package/dist/internal/groups/sdk-store.d.ts.map +1 -0
- package/dist/internal/groups/sdk-store.js +111 -0
- package/dist/internal/groups/sdk-store.js.map +1 -0
- package/dist/internal/groups/server-engine.d.ts +83 -0
- package/dist/internal/groups/server-engine.d.ts.map +1 -0
- package/dist/internal/groups/server-engine.js +1186 -0
- package/dist/internal/groups/server-engine.js.map +1 -0
- package/dist/internal/groups/trust-root.d.ts +32 -0
- package/dist/internal/groups/trust-root.d.ts.map +1 -0
- package/dist/internal/groups/trust-root.js +91 -0
- package/dist/internal/groups/trust-root.js.map +1 -0
- package/dist/internal/{groups-v2 → groups}/types.d.ts +188 -46
- package/dist/internal/groups/types.d.ts.map +1 -0
- package/dist/internal/{groups-v2 → groups}/types.js +3 -2
- package/dist/internal/groups/types.js.map +1 -0
- package/dist/internal/groups/wire.d.ts +68 -0
- package/dist/internal/groups/wire.d.ts.map +1 -0
- package/dist/internal/groups/wire.js +708 -0
- package/dist/internal/groups/wire.js.map +1 -0
- package/dist/internal/protocol/sealed-sender/decryption-v2.d.ts.map +1 -1
- package/dist/internal/protocol/sealed-sender/decryption-v2.js +32 -18
- package/dist/internal/protocol/sealed-sender/decryption-v2.js.map +1 -1
- package/dist/internal/protocol/sealed-sender/decryption.d.ts.map +1 -1
- package/dist/internal/protocol/sealed-sender/decryption.js +33 -19
- package/dist/internal/protocol/sealed-sender/decryption.js.map +1 -1
- package/dist/internal/protocol/sealed-sender/encryption-v2.d.ts.map +1 -1
- package/dist/internal/protocol/sealed-sender/encryption-v2.js +8 -14
- package/dist/internal/protocol/sealed-sender/encryption-v2.js.map +1 -1
- package/dist/internal/protocol/sealed-sender/encryption.d.ts +9 -4
- package/dist/internal/protocol/sealed-sender/encryption.d.ts.map +1 -1
- package/dist/internal/protocol/sealed-sender/encryption.js +7 -15
- package/dist/internal/protocol/sealed-sender/encryption.js.map +1 -1
- package/dist/internal/protocol/sealed-sender/proto/index.d.ts +6 -7
- package/dist/internal/protocol/sealed-sender/proto/index.d.ts.map +1 -1
- package/dist/internal/protocol/sealed-sender/proto/index.js +5 -7
- package/dist/internal/protocol/sealed-sender/proto/index.js.map +1 -1
- package/dist/internal/protocol/sealed-sender/trust-root.d.ts +45 -0
- package/dist/internal/protocol/sealed-sender/trust-root.d.ts.map +1 -0
- package/dist/internal/protocol/sealed-sender/trust-root.js +77 -0
- package/dist/internal/protocol/sealed-sender/trust-root.js.map +1 -0
- package/dist/internal/protocol/sealed-sender/types.d.ts +64 -9
- package/dist/internal/protocol/sealed-sender/types.d.ts.map +1 -1
- package/dist/internal/protocol/sealed-sender/types.js +43 -0
- package/dist/internal/protocol/sealed-sender/types.js.map +1 -1
- package/dist/internal/protocol/sender-keys/index.d.ts +1 -1
- package/dist/internal/protocol/sender-keys/manager.d.ts +38 -1
- package/dist/internal/protocol/sender-keys/manager.d.ts.map +1 -1
- package/dist/internal/protocol/sender-keys/manager.js +109 -8
- package/dist/internal/protocol/sender-keys/manager.js.map +1 -1
- package/dist/internal/protocol/zk/groups/auth-credential.d.ts +9 -7
- package/dist/internal/protocol/zk/groups/auth-credential.d.ts.map +1 -1
- package/dist/internal/protocol/zk/groups/auth-credential.js +68 -29
- package/dist/internal/protocol/zk/groups/auth-credential.js.map +1 -1
- package/dist/internal/protocol/zk/groups/server-params.d.ts +1 -1
- package/dist/internal/protocol/zk/groups/server-params.d.ts.map +1 -1
- package/dist/internal/protocol/zk/groups/server-params.js.map +1 -1
- package/dist/internal/protocol/zk/groups/uid-struct.d.ts +2 -0
- package/dist/internal/protocol/zk/groups/uid-struct.d.ts.map +1 -1
- package/dist/internal/protocol/zk/groups/uid-struct.js +4 -0
- package/dist/internal/protocol/zk/groups/uid-struct.js.map +1 -1
- package/dist/layers.d.ts +1 -1
- package/dist/layers.js +3 -3
- package/dist/layers.js.map +1 -1
- package/dist/local/store/expo/adapter.d.ts +14 -15
- package/dist/local/store/expo/adapter.d.ts.map +1 -1
- package/dist/local/store/expo/adapter.js +109 -102
- package/dist/local/store/expo/adapter.js.map +1 -1
- package/dist/local/store/expo/db.d.ts +4 -1
- package/dist/local/store/expo/db.d.ts.map +1 -1
- package/dist/local/store/expo/db.js +5 -0
- package/dist/local/store/expo/db.js.map +1 -1
- package/dist/local/store/expo/index.d.ts +0 -2
- package/dist/local/store/expo/index.d.ts.map +1 -1
- package/dist/local/store/expo/index.js +1 -1
- package/dist/local/store/expo/index.js.map +1 -1
- package/dist/local/store/expo/models/index.d.ts +1 -1
- package/dist/local/store/expo/models/index.d.ts.map +1 -1
- package/dist/local/store/expo/models/index.js +2 -2
- package/dist/local/store/expo/models/index.js.map +1 -1
- package/dist/local/store/expo/models/sender-key.d.ts +101 -77
- package/dist/local/store/expo/models/sender-key.d.ts.map +1 -1
- package/dist/local/store/expo/models/sender-key.js +154 -124
- package/dist/local/store/expo/models/sender-key.js.map +1 -1
- package/dist/local/store/expo/schema.d.ts +134 -32
- package/dist/local/store/expo/schema.d.ts.map +1 -1
- package/dist/local/store/expo/schema.js +36 -7
- package/dist/local/store/expo/schema.js.map +1 -1
- package/dist/local/store/mock/adapter.d.ts +1 -0
- package/dist/local/store/mock/adapter.d.ts.map +1 -1
- package/dist/local/store/mock/adapter.js +18 -0
- package/dist/local/store/mock/adapter.js.map +1 -1
- package/dist/local/store/react-native/adapter.d.ts +39 -0
- package/dist/local/store/react-native/adapter.d.ts.map +1 -1
- package/dist/local/store/react-native/adapter.js +163 -8
- package/dist/local/store/react-native/adapter.js.map +1 -1
- package/dist/local/store/web/adapter.d.ts +1 -0
- package/dist/local/store/web/adapter.d.ts.map +1 -1
- package/dist/local/store/web/adapter.js +33 -1
- package/dist/local/store/web/adapter.js.map +1 -1
- package/dist/remote/relay/convex/backend.d.ts +402 -0
- package/dist/remote/relay/convex/backend.d.ts.map +1 -0
- package/dist/remote/relay/convex/backend.js +684 -0
- package/dist/remote/relay/convex/backend.js.map +1 -0
- package/dist/remote/relay/convex/component/_generated/api.d.ts +58 -0
- package/dist/remote/relay/convex/component/_generated/api.d.ts.map +1 -0
- package/dist/remote/relay/convex/component/_generated/api.js +31 -0
- package/dist/remote/relay/convex/component/_generated/api.js.map +1 -0
- package/dist/remote/relay/convex/component/_generated/component.d.ts +480 -0
- package/dist/remote/relay/convex/component/_generated/component.d.ts.map +1 -0
- package/dist/remote/relay/convex/component/_generated/component.js +11 -0
- package/dist/remote/relay/convex/component/_generated/component.js.map +1 -0
- package/dist/remote/relay/convex/component/_generated/dataModel.d.ts +46 -0
- package/dist/remote/relay/convex/component/_generated/dataModel.d.ts.map +1 -0
- package/dist/remote/relay/convex/component/_generated/dataModel.js +11 -0
- package/dist/remote/relay/convex/component/_generated/dataModel.js.map +1 -0
- package/dist/remote/relay/convex/component/_generated/server.d.ts +129 -0
- package/dist/remote/relay/convex/component/_generated/server.d.ts.map +1 -0
- package/dist/remote/relay/convex/component/_generated/server.js +79 -0
- package/dist/remote/relay/convex/component/_generated/server.js.map +1 -0
- package/dist/remote/relay/convex/component/accounts.d.ts +43 -0
- package/dist/remote/relay/convex/component/accounts.d.ts.map +1 -0
- package/dist/remote/relay/convex/component/accounts.js +181 -0
- package/dist/remote/relay/convex/component/accounts.js.map +1 -0
- package/dist/remote/relay/convex/component/certificates.d.ts +10 -0
- package/dist/remote/relay/convex/component/certificates.d.ts.map +1 -0
- package/dist/remote/relay/convex/component/certificates.js +122 -0
- package/dist/remote/relay/convex/component/certificates.js.map +1 -0
- package/dist/remote/relay/convex/component/cleanup.d.ts +26 -0
- package/dist/remote/relay/convex/component/cleanup.d.ts.map +1 -0
- package/dist/remote/relay/convex/component/cleanup.js +127 -0
- package/dist/remote/relay/convex/component/cleanup.js.map +1 -0
- package/dist/remote/relay/convex/component/convex.config.d.ts +5 -0
- package/dist/remote/relay/convex/component/convex.config.d.ts.map +1 -0
- package/dist/remote/relay/convex/component/convex.config.js +33 -0
- package/dist/remote/relay/convex/component/convex.config.js.map +1 -0
- package/dist/remote/relay/convex/component/crons.d.ts +3 -0
- package/dist/remote/relay/convex/component/crons.d.ts.map +1 -0
- package/dist/remote/relay/convex/component/crons.js +9 -0
- package/dist/remote/relay/convex/component/crons.js.map +1 -0
- package/dist/remote/relay/convex/component/devices.d.ts +101 -0
- package/dist/remote/relay/convex/component/devices.d.ts.map +1 -0
- package/dist/remote/relay/convex/component/devices.js +299 -0
- package/dist/remote/relay/convex/component/devices.js.map +1 -0
- package/dist/remote/relay/convex/component/errors.d.ts +22 -0
- package/dist/remote/relay/convex/component/errors.d.ts.map +1 -0
- package/dist/remote/relay/convex/component/errors.js +17 -0
- package/dist/remote/relay/convex/component/errors.js.map +1 -0
- package/dist/remote/relay/convex/component/groups.d.ts +60 -0
- package/dist/remote/relay/convex/component/groups.d.ts.map +1 -0
- package/dist/remote/relay/convex/component/groups.js +331 -0
- package/dist/remote/relay/convex/component/groups.js.map +1 -0
- package/dist/remote/relay/convex/component/keys.d.ts +130 -0
- package/dist/remote/relay/convex/component/keys.d.ts.map +1 -0
- package/dist/remote/relay/convex/component/keys.js +578 -0
- package/dist/remote/relay/convex/component/keys.js.map +1 -0
- package/dist/remote/relay/convex/component/messages.d.ts +119 -0
- package/dist/remote/relay/convex/component/messages.d.ts.map +1 -0
- package/dist/remote/relay/convex/component/messages.js +649 -0
- package/dist/remote/relay/convex/component/messages.js.map +1 -0
- package/dist/remote/relay/convex/component/provisioning.d.ts +92 -0
- package/dist/remote/relay/convex/component/provisioning.d.ts.map +1 -0
- package/dist/remote/relay/convex/component/provisioning.js +359 -0
- package/dist/remote/relay/convex/component/provisioning.js.map +1 -0
- package/dist/remote/relay/convex/component/runtime.d.ts +18 -0
- package/dist/remote/relay/convex/component/runtime.d.ts.map +1 -0
- package/dist/remote/relay/convex/component/runtime.js +142 -0
- package/dist/remote/relay/convex/component/runtime.js.map +1 -0
- package/dist/remote/relay/convex/component/schema.d.ts +344 -0
- package/dist/remote/relay/convex/component/schema.d.ts.map +1 -0
- package/dist/remote/relay/convex/component/schema.js +266 -0
- package/dist/remote/relay/convex/component/schema.js.map +1 -0
- package/dist/remote/relay/convex/component/zkAuth.d.ts +12 -0
- package/dist/remote/relay/convex/component/zkAuth.d.ts.map +1 -0
- package/dist/remote/relay/convex/component/zkAuth.js +71 -0
- package/dist/remote/relay/convex/component/zkAuth.js.map +1 -0
- package/dist/remote/relay/convex/constants.d.ts +3 -0
- package/dist/remote/relay/convex/constants.d.ts.map +1 -0
- package/dist/remote/relay/convex/constants.js +3 -0
- package/dist/remote/relay/convex/constants.js.map +1 -0
- package/dist/remote/relay/convex/group-server.d.ts +25 -21
- package/dist/remote/relay/convex/group-server.d.ts.map +1 -1
- package/dist/remote/relay/convex/group-server.js +51 -21
- package/dist/remote/relay/convex/group-server.js.map +1 -1
- package/dist/remote/relay/convex/index.d.ts +4 -1
- package/dist/remote/relay/convex/index.d.ts.map +1 -1
- package/dist/remote/relay/convex/index.js +3 -1
- package/dist/remote/relay/convex/index.js.map +1 -1
- package/dist/remote/relay/convex/relay.d.ts +54 -67
- package/dist/remote/relay/convex/relay.d.ts.map +1 -1
- package/dist/remote/relay/convex/relay.js +123 -42
- package/dist/remote/relay/convex/relay.js.map +1 -1
- package/dist/remote/relay/convex/types.d.ts +16 -103
- package/dist/remote/relay/convex/types.d.ts.map +1 -1
- package/dist/remote/relay/convex/types.js +8 -13
- package/dist/remote/relay/convex/types.js.map +1 -1
- package/dist/remote/relay/index.d.ts +1 -1
- package/dist/remote/relay/index.d.ts.map +1 -1
- package/dist/remote/relay/mock/adapter.d.ts +33 -20
- package/dist/remote/relay/mock/adapter.d.ts.map +1 -1
- package/dist/remote/relay/mock/adapter.js +98 -81
- package/dist/remote/relay/mock/adapter.js.map +1 -1
- package/dist/remote/relay/mock/group-server.d.ts +9 -0
- package/dist/remote/relay/mock/group-server.d.ts.map +1 -0
- package/dist/remote/relay/mock/group-server.js +9 -0
- package/dist/remote/relay/mock/group-server.js.map +1 -0
- package/dist/remote/relay/types.d.ts +73 -79
- package/dist/remote/relay/types.d.ts.map +1 -1
- package/dist/remote/relay/types.js +0 -1
- package/dist/remote/relay/types.js.map +1 -1
- package/dist/types/api.d.ts +23 -2
- package/dist/types/api.d.ts.map +1 -1
- package/dist/types/protocol-config.d.ts +51 -0
- package/dist/types/protocol-config.d.ts.map +1 -1
- package/dist/types/protocol-config.js +46 -0
- package/dist/types/protocol-config.js.map +1 -1
- package/docs/ASSURANCE.md +10 -6
- package/docs/CLIENT_COMPOSITION.md +23 -69
- package/docs/DEVIATIONS.md +77 -41
- package/docs/E2EE.md +71 -6
- package/docs/GETTING_STARTED.md +1 -1
- package/docs/PACKAGE_SURFACE.md +6 -0
- package/docs/RECIPES.md +1 -1
- package/docs/SECURITY.md +8 -0
- package/groups/README.md +16 -5
- package/local/store/expo/README.md +10 -1
- package/local/store/node/README.md +10 -1
- package/package.json +20 -4
- package/remote/relay/convex/README.md +6 -0
- package/remote/relay/convex/component/README.md +428 -0
- package/scripts/oe-groups.mjs +162 -0
- package/dist/internal/groups-v2/access-control.d.ts +0 -108
- package/dist/internal/groups-v2/access-control.d.ts.map +0 -1
- package/dist/internal/groups-v2/access-control.js +0 -191
- package/dist/internal/groups-v2/access-control.js.map +0 -1
- package/dist/internal/groups-v2/change-actions.d.ts +0 -40
- package/dist/internal/groups-v2/change-actions.d.ts.map +0 -1
- package/dist/internal/groups-v2/change-actions.js +0 -363
- package/dist/internal/groups-v2/change-actions.js.map +0 -1
- package/dist/internal/groups-v2/encrypted-state.d.ts.map +0 -1
- package/dist/internal/groups-v2/encrypted-state.js.map +0 -1
- package/dist/internal/groups-v2/index.d.ts +0 -19
- package/dist/internal/groups-v2/index.d.ts.map +0 -1
- package/dist/internal/groups-v2/index.js +0 -11
- package/dist/internal/groups-v2/index.js.map +0 -1
- package/dist/internal/groups-v2/invite-link.d.ts.map +0 -1
- package/dist/internal/groups-v2/invite-link.js.map +0 -1
- package/dist/internal/groups-v2/manager.d.ts.map +0 -1
- package/dist/internal/groups-v2/manager.js +0 -1095
- package/dist/internal/groups-v2/manager.js.map +0 -1
- package/dist/internal/groups-v2/types.d.ts.map +0 -1
- package/dist/internal/groups-v2/types.js.map +0 -1
- package/docs/api/README.md +0 -471
- package/docs/api/classes/EncryptionError.md +0 -112
- package/docs/api/classes/EndorsementManager.md +0 -307
- package/docs/api/classes/SealedSenderAuthError.md +0 -127
- package/docs/api/classes/ServerDerivedKeyPair.md +0 -68
- package/docs/api/classes/ServerDerivedPublicKey.md +0 -33
- package/docs/api/classes/ServerRootKeyPair.md +0 -94
- package/docs/api/classes/ServerRootPublicKey.md +0 -72
- package/docs/api/classes/SignalProtocolBlockingManager.md +0 -106
- package/docs/api/classes/SignalProtocolClient.md +0 -2654
- package/docs/api/classes/VerificationFailure.md +0 -25
- package/docs/api/enumerations/ContentHint.md +0 -63
- package/docs/api/enumerations/EncryptionErrorCode.md +0 -488
- package/docs/api/enumerations/IdentityKeyChange.md +0 -65
- package/docs/api/enumerations/MessageType.md +0 -29
- package/docs/api/enumerations/TrustDirection.md +0 -33
- package/docs/api/enumerations/TypingAction.md +0 -31
- package/docs/api/functions/createDefaultSignalProtocolContentAdapter.md +0 -13
- package/docs/api/functions/createDefaultSignalProtocolLogger.md +0 -36
- package/docs/api/functions/createGroupId.md +0 -32
- package/docs/api/functions/createSignalProtocolClient.md +0 -36
- package/docs/api/functions/createSignalProtocolClientConfig.md +0 -24
- package/docs/api/functions/extractGroupId.md +0 -32
- package/docs/api/functions/formatVersion.md +0 -25
- package/docs/api/functions/isCompatible.md +0 -31
- package/docs/api/functions/isGroupId.md +0 -37
- package/docs/api/functions/isSealedSenderAuthError.md +0 -25
- package/docs/api/functions/parseVersion.md +0 -29
- package/docs/api/functions/resolveSPQRLimits.md +0 -21
- package/docs/api/functions/resolveSignalProtocolLogger.md +0 -42
- package/docs/api/interfaces/AccountIdentityProvisioning.md +0 -43
- package/docs/api/interfaces/AccountIdentityRotation.md +0 -69
- package/docs/api/interfaces/AttachmentTransferOptions.md +0 -49
- package/docs/api/interfaces/BlockedRecipientEntry.md +0 -25
- package/docs/api/interfaces/BlockedRecipientsSyncInput.md +0 -27
- package/docs/api/interfaces/ConfigurationSyncInput.md +0 -19
- package/docs/api/interfaces/CredentialPublicKey.md +0 -25
- package/docs/api/interfaces/DataMessageInput.md +0 -21
- package/docs/api/interfaces/DecryptedEnvelope.md +0 -95
- package/docs/api/interfaces/DecryptedGroup.md +0 -86
- package/docs/api/interfaces/DeviceInfo.md +0 -79
- package/docs/api/interfaces/DeviceRecord.md +0 -87
- package/docs/api/interfaces/DeviceRegistration.md +0 -27
- package/docs/api/interfaces/DoubleRatchetConfig.md +0 -36
- package/docs/api/interfaces/EcOneTimePreKey.md +0 -27
- package/docs/api/interfaces/EcSignedPreKey.md +0 -39
- package/docs/api/interfaces/EcSignedPreKeyUpload.md +0 -50
- package/docs/api/interfaces/EncryptionErrorContext.md +0 -51
- package/docs/api/interfaces/Envelope.md +0 -154
- package/docs/api/interfaces/ForceKeyResetResult.md +0 -37
- package/docs/api/interfaces/GroupAuthorization.md +0 -23
- package/docs/api/interfaces/GroupChangeEntry.md +0 -42
- package/docs/api/interfaces/GroupMemberDevice.md +0 -26
- package/docs/api/interfaces/IEcOneTimePreKeyStore.md +0 -86
- package/docs/api/interfaces/IEcSignedPreKeyStore.md +0 -133
- package/docs/api/interfaces/IGroupServer.md +0 -120
- package/docs/api/interfaces/IGroupStateStore.md +0 -128
- package/docs/api/interfaces/IIdentityKeyStore.md +0 -312
- package/docs/api/interfaces/IKemPreKeyStore.md +0 -144
- package/docs/api/interfaces/IKyberLastResortPreKeyStore.md +0 -112
- package/docs/api/interfaces/ILogger.md +0 -117
- package/docs/api/interfaces/IProtocolStore.md +0 -1033
- package/docs/api/interfaces/ISenderKeyStore.md +0 -417
- package/docs/api/interfaces/ISesameStore.md +0 -249
- package/docs/api/interfaces/ISessionStore.md +0 -178
- package/docs/api/interfaces/ISignalProtocolClient.md +0 -1185
- package/docs/api/interfaces/ISignalProtocolLocalSecretVault.md +0 -71
- package/docs/api/interfaces/ISignalProtocolLocalStore.md +0 -2053
- package/docs/api/interfaces/ISignalProtocolManager.md +0 -272
- package/docs/api/interfaces/ISignalProtocolRelayServer.md +0 -1329
- package/docs/api/interfaces/IdentityKeyPair.md +0 -49
- package/docs/api/interfaces/IncomingEnvelope.md +0 -91
- package/docs/api/interfaces/InspectedSignalProtocolContent.md +0 -43
- package/docs/api/interfaces/KDFChain.md +0 -31
- package/docs/api/interfaces/KemLastResortPreKeyUpload.md +0 -50
- package/docs/api/interfaces/KeyPair.md +0 -23
- package/docs/api/interfaces/KyberPreKey.md +0 -42
- package/docs/api/interfaces/MLKEMBraidAgentState.md +0 -191
- package/docs/api/interfaces/MLKEMBraidMessage.md +0 -49
- package/docs/api/interfaces/MediaAttachmentDeleteSyncInput.md +0 -31
- package/docs/api/interfaces/MessageHeader.md +0 -49
- package/docs/api/interfaces/MessageRecord.md +0 -86
- package/docs/api/interfaces/ParsedReceiptContent.md +0 -19
- package/docs/api/interfaces/ParsedTypingContent.md +0 -19
- package/docs/api/interfaces/PreKeyMaintenanceStore.md +0 -88
- package/docs/api/interfaces/PreKeyMessage.md +0 -159
- package/docs/api/interfaces/PreKeyStatusResult.md +0 -21
- package/docs/api/interfaces/PreKeyUpload.md +0 -42
- package/docs/api/interfaces/ProcessEnvelopeOptions.md +0 -72
- package/docs/api/interfaces/ProtocolAddress.md +0 -38
- package/docs/api/interfaces/ProtocolStrategyConfig.md +0 -91
- package/docs/api/interfaces/RatchetMessage.md +0 -96
- package/docs/api/interfaces/ReadSyncEntryInput.md +0 -19
- package/docs/api/interfaces/ReceiverChain.md +0 -43
- package/docs/api/interfaces/RecipientUsernameSyncInput.md +0 -31
- package/docs/api/interfaces/RelayPreKeyBundle.md +0 -254
- package/docs/api/interfaces/RemoteObjectDownload.md +0 -33
- package/docs/api/interfaces/RemoteObjectUpload.md +0 -49
- package/docs/api/interfaces/ResolvedSPQRInfoStrings.md +0 -27
- package/docs/api/interfaces/ResolvedSPQRLimits.md +0 -37
- package/docs/api/interfaces/RetryRequest.md +0 -80
- package/docs/api/interfaces/SCKAState.md +0 -65
- package/docs/api/interfaces/SPQRLimits.md +0 -40
- package/docs/api/interfaces/SPQRState.md +0 -191
- package/docs/api/interfaces/SafetyNumber.md +0 -60
- package/docs/api/interfaces/SafetyNumberConfirmation.md +0 -46
- package/docs/api/interfaces/SealedSenderConfig.md +0 -70
- package/docs/api/interfaces/SendOptions.md +0 -191
- package/docs/api/interfaces/SendResult.md +0 -93
- package/docs/api/interfaces/SenderKeyDistributionMessage.md +0 -43
- package/docs/api/interfaces/SenderKeyState.md +0 -76
- package/docs/api/interfaces/SenderKeysConfig.md +0 -65
- package/docs/api/interfaces/SentSyncTranscriptInput.md +0 -31
- package/docs/api/interfaces/ServiceId.md +0 -19
- package/docs/api/interfaces/SesameMessage.md +0 -84
- package/docs/api/interfaces/SesameStats.md +0 -57
- package/docs/api/interfaces/SessionHealthResult.md +0 -120
- package/docs/api/interfaces/SessionRecord.md +0 -80
- package/docs/api/interfaces/SessionRecordMetadata.md +0 -109
- package/docs/api/interfaces/SessionState.md +0 -368
- package/docs/api/interfaces/SessionTrustCommit.md +0 -58
- package/docs/api/interfaces/SignalProtocolBlockingHooks.md +0 -44
- package/docs/api/interfaces/SignalProtocolBlockingManagerOptions.md +0 -31
- package/docs/api/interfaces/SignalProtocolBlockingMirror.md +0 -30
- package/docs/api/interfaces/SignalProtocolBlockingStore.md +0 -83
- package/docs/api/interfaces/SignalProtocolClientAdapterConfig.md +0 -44
- package/docs/api/interfaces/SignalProtocolClientCompositionOptions.md +0 -693
- package/docs/api/interfaces/SignalProtocolClientConfig.md +0 -839
- package/docs/api/interfaces/SignalProtocolClientDeleteLocalAttachmentInput.md +0 -25
- package/docs/api/interfaces/SignalProtocolClientHooks.md +0 -506
- package/docs/api/interfaces/SignalProtocolClientIdentityConfig.md +0 -35
- package/docs/api/interfaces/SignalProtocolClientLoadLocalAttachmentInput.md +0 -187
- package/docs/api/interfaces/SignalProtocolClientLoadedLocalAttachment.md +0 -19
- package/docs/api/interfaces/SignalProtocolClientMedia.md +0 -83
- package/docs/api/interfaces/SignalProtocolClientMediaCompletedResult.md +0 -25
- package/docs/api/interfaces/SignalProtocolClientMediaConfig.md +0 -157
- package/docs/api/interfaces/SignalProtocolClientMediaDownloadCompletedResult.md +0 -37
- package/docs/api/interfaces/SignalProtocolClientMediaDownloadNotNeededResult.md +0 -25
- package/docs/api/interfaces/SignalProtocolClientMediaFailedResult.md +0 -19
- package/docs/api/interfaces/SignalProtocolClientMediaOperationOptions.md +0 -53
- package/docs/api/interfaces/SignalProtocolClientMediaPendingResult.md +0 -19
- package/docs/api/interfaces/SignalProtocolClientMediaProcessResult.md +0 -43
- package/docs/api/interfaces/SignalProtocolClientMediaSkippedResult.md +0 -25
- package/docs/api/interfaces/SignalProtocolClientMediaUploadCompletedResult.md +0 -31
- package/docs/api/interfaces/SignalProtocolClientProcessPendingMediaOptions.md +0 -87
- package/docs/api/interfaces/SignalProtocolClientSaveDownloadedAttachmentInput.md +0 -25
- package/docs/api/interfaces/SignalProtocolClientSaveUploadedAttachmentInput.md +0 -25
- package/docs/api/interfaces/SignalProtocolClientSyncDeleteInput.md +0 -19
- package/docs/api/interfaces/SignalProtocolConfig.md +0 -50
- package/docs/api/interfaces/SignalProtocolContentAdapter.md +0 -325
- package/docs/api/interfaces/SignalProtocolRemoteObjectStore.md +0 -88
- package/docs/api/interfaces/SkippedSenderMessageKey.md +0 -26
- package/docs/api/interfaces/TaskNotificationAckSyncInput.md +0 -31
- package/docs/api/interfaces/TripleRatchetState.md +0 -64
- package/docs/api/interfaces/UserRecord.md +0 -71
- package/docs/api/interfaces/UsernameStateSyncInput.md +0 -19
- package/docs/api/interfaces/VerificationStateSyncInput.md +0 -31
- package/docs/api/interfaces/VersionNegotiationState.md +0 -84
- package/docs/api/interfaces/ViewOnceOpenSyncInput.md +0 -19
- package/docs/api/namespaces/ProtocolAddress/README.md +0 -33
- package/docs/api/namespaces/ProtocolAddress/functions/create.md +0 -41
- package/docs/api/namespaces/ProtocolAddress/functions/equals.md +0 -39
- package/docs/api/namespaces/ProtocolAddress/functions/fromStorageKey.md +0 -36
- package/docs/api/namespaces/ProtocolAddress/functions/isUser.md +0 -39
- package/docs/api/namespaces/ProtocolAddress/functions/isValid.md +0 -34
- package/docs/api/namespaces/ProtocolAddress/functions/parse.md +0 -41
- package/docs/api/namespaces/ProtocolAddress/functions/toStorageKey.md +0 -38
- package/docs/api/namespaces/ProtocolAddress/functions/toString.md +0 -34
- package/docs/api/namespaces/SessionRecord/README.md +0 -30
- package/docs/api/namespaces/SessionRecord/functions/archiveCurrent.md +0 -40
- package/docs/api/namespaces/SessionRecord/functions/archiveCurrentState.md +0 -34
- package/docs/api/namespaces/SessionRecord/functions/create.md +0 -25
- package/docs/api/namespaces/SessionRecord/functions/deserialize.md +0 -29
- package/docs/api/namespaces/SessionRecord/functions/findSession.md +0 -34
- package/docs/api/namespaces/SessionRecord/functions/getAllSessions.md +0 -25
- package/docs/api/namespaces/SessionRecord/functions/getArchivedCount.md +0 -25
- package/docs/api/namespaces/SessionRecord/functions/hasCurrentSession.md +0 -25
- package/docs/api/namespaces/SessionRecord/functions/hasUsableSenderChain.md +0 -36
- package/docs/api/namespaces/SessionRecord/functions/promoteSession.md +0 -34
- package/docs/api/namespaces/SessionRecord/functions/serialize.md +0 -28
- package/docs/api/namespaces/SessionRecord/variables/MAX_ARCHIVED_SESSIONS.md +0 -14
- package/docs/api/namespaces/SessionState/README.md +0 -15
- package/docs/api/namespaces/SessionState/functions/getSessionId.md +0 -32
- package/docs/api/namespaces/blocking/README.md +0 -43
- package/docs/api/namespaces/encoding/README.md +0 -33
- package/docs/api/namespaces/encoding/functions/base64ToUrlSafe.md +0 -28
- package/docs/api/namespaces/encoding/functions/bytesToBase64.md +0 -21
- package/docs/api/namespaces/encoding/functions/bytesToString.md +0 -21
- package/docs/api/namespaces/encoding/functions/bytesToUrlSafeBase64.md +0 -33
- package/docs/api/namespaces/encoding/functions/concatBytes.md +0 -21
- package/docs/api/namespaces/encoding/functions/stringToBytes.md +0 -21
- package/docs/api/namespaces/encoding/functions/urlSafeToBase64.md +0 -27
- package/docs/api/namespaces/keys/README.md +0 -130
- package/docs/api/namespaces/keys/functions/acceptContactIdentityRotation.md +0 -33
- package/docs/api/namespaces/keys/functions/assertIdentityCommitment.md +0 -25
- package/docs/api/namespaces/keys/functions/canonicalizeDeviceIdentityKey.md +0 -30
- package/docs/api/namespaces/keys/functions/compareDeviceIdentityKeys.md +0 -28
- package/docs/api/namespaces/keys/functions/compositeIdentitiesEqual.md +0 -23
- package/docs/api/namespaces/keys/functions/createCompositeIdentityV1.md +0 -19
- package/docs/api/namespaces/keys/functions/createPreKeySignatureContext.md +0 -31
- package/docs/api/namespaces/keys/functions/createUnverifiedContactIdentityRecord.md +0 -23
- package/docs/api/namespaces/keys/functions/decodeCompositeIdentityV1.md +0 -19
- package/docs/api/namespaces/keys/functions/deriveIdentityCommitment.md +0 -19
- package/docs/api/namespaces/keys/functions/encodeCompositeIdentityV1.md +0 -19
- package/docs/api/namespaces/keys/functions/evaluateContactIdentityCandidate.md +0 -27
- package/docs/api/namespaces/keys/functions/generateEcOneTimePreKeys.md +0 -37
- package/docs/api/namespaces/keys/functions/generateEcSignedPreKey.md +0 -39
- package/docs/api/namespaces/keys/functions/generateEcSignedPreKeyId.md +0 -21
- package/docs/api/namespaces/keys/functions/generateIdentityKeyPair.md +0 -24
- package/docs/api/namespaces/keys/functions/generateKemOneTimePreKeys.md +0 -47
- package/docs/api/namespaces/keys/functions/generateKyberLastResortPreKey.md +0 -37
- package/docs/api/namespaces/keys/functions/generateRegistrationId.md +0 -13
- package/docs/api/namespaces/keys/functions/isValidDeviceIdentityKey.md +0 -22
- package/docs/api/namespaces/keys/functions/signMlKem1024PreKey.md +0 -29
- package/docs/api/namespaces/keys/functions/signPreKey.md +0 -31
- package/docs/api/namespaces/keys/functions/validateContactIdentityRecord.md +0 -19
- package/docs/api/namespaces/keys/functions/verifyContactIdentityRecord.md +0 -31
- package/docs/api/namespaces/keys/functions/verifyMlKem1024PreKey.md +0 -33
- package/docs/api/namespaces/keys/functions/verifyPreKeySignature.md +0 -35
- package/docs/api/namespaces/keys/interfaces/CompositeIdentityV1.md +0 -33
- package/docs/api/namespaces/keys/interfaces/ContactIdentityRecord.md +0 -53
- package/docs/api/namespaces/keys/interfaces/KemOneTimePreKey.md +0 -43
- package/docs/api/namespaces/keys/type-aliases/IdentityCandidateStatus.md +0 -9
- package/docs/api/namespaces/keys/type-aliases/IdentityTrustState.md +0 -9
- package/docs/api/namespaces/keys/type-aliases/IdentityType.md +0 -9
- package/docs/api/namespaces/keys/variables/COMPOSITE_IDENTITY_V1_ED25519_TAG.md +0 -9
- package/docs/api/namespaces/keys/variables/COMPOSITE_IDENTITY_V1_LENGTH.md +0 -9
- package/docs/api/namespaces/keys/variables/COMPOSITE_IDENTITY_V1_VERSION.md +0 -9
- package/docs/api/namespaces/keys/variables/COMPOSITE_IDENTITY_V1_X25519_TAG.md +0 -9
- package/docs/api/namespaces/keys/variables/IDENTITY_COMMITMENT_V1_DOMAIN.md +0 -9
- package/docs/api/namespaces/keys/variables/PREKEY_ALGORITHM_ML_KEM_1024.md +0 -9
- package/docs/api/namespaces/keys/variables/PREKEY_ALGORITHM_X25519.md +0 -9
- package/docs/api/namespaces/keys/variables/PREKEY_SIGNATURE_V1_DOMAIN.md +0 -9
- package/docs/api/namespaces/keys/variables/UNPINNED_DEVICE_IDENTITY_KEY.md +0 -18
- package/docs/api/namespaces/media/README.md +0 -105
- package/docs/api/namespaces/media/classes/MediaAttachmentError.md +0 -57
- package/docs/api/namespaces/media/functions/createByteRangeMediaAttachmentTransfer.md +0 -19
- package/docs/api/namespaces/media/functions/createMediaAttachmentDeliveryId.md +0 -29
- package/docs/api/namespaces/media/functions/createMediaAttachmentId.md +0 -19
- package/docs/api/namespaces/media/functions/createMediaAttachmentMessage.md +0 -25
- package/docs/api/namespaces/media/functions/createMediaAttachmentPointer.md +0 -19
- package/docs/api/namespaces/media/functions/createTusMediaAttachmentTransfer.md +0 -19
- package/docs/api/namespaces/media/functions/deleteMediaAttachment.md +0 -23
- package/docs/api/namespaces/media/functions/executeMediaAttachmentJob.md +0 -23
- package/docs/api/namespaces/media/functions/isMediaAttachmentFlagSet.md +0 -19
- package/docs/api/namespaces/media/functions/parseMediaAttachmentMessage.md +0 -19
- package/docs/api/namespaces/media/functions/planMediaAttachmentCleanup.md +0 -23
- package/docs/api/namespaces/media/functions/planMediaAttachmentCleanupJobs.md +0 -19
- package/docs/api/namespaces/media/functions/planMediaAttachmentDeleteSync.md +0 -19
- package/docs/api/namespaces/media/functions/planMediaAttachmentDownloadJob.md +0 -19
- package/docs/api/namespaces/media/functions/planMediaAttachmentOpen.md +0 -19
- package/docs/api/namespaces/media/functions/planMediaAttachmentProcessing.md +0 -19
- package/docs/api/namespaces/media/functions/planMediaAttachmentUploadJob.md +0 -19
- package/docs/api/namespaces/media/functions/prepareMediaAttachmentUpload.md +0 -30
- package/docs/api/namespaces/media/functions/resolveMediaAttachment.md +0 -30
- package/docs/api/namespaces/media/functions/serializeMediaAttachmentMessage.md +0 -25
- package/docs/api/namespaces/media/functions/validateMediaAttachmentPolicy.md +0 -23
- package/docs/api/namespaces/media/interfaces/ByteRangeMediaAttachmentPartialStore.md +0 -68
- package/docs/api/namespaces/media/interfaces/ByteRangeMediaAttachmentTransferOptions.md +0 -91
- package/docs/api/namespaces/media/interfaces/DeleteMediaAttachmentOptions.md +0 -25
- package/docs/api/namespaces/media/interfaces/DeleteMediaAttachmentResult.md +0 -19
- package/docs/api/namespaces/media/interfaces/ExecuteMediaAttachmentJobOptions.md +0 -157
- package/docs/api/namespaces/media/interfaces/MediaAttachmentBackgroundJob.md +0 -85
- package/docs/api/namespaces/media/interfaces/MediaAttachmentCleanupPlan.md +0 -37
- package/docs/api/namespaces/media/interfaces/MediaAttachmentJobExecutionResult.md +0 -55
- package/docs/api/namespaces/media/interfaces/MediaAttachmentMessage.md +0 -31
- package/docs/api/namespaces/media/interfaces/MediaAttachmentOpenDecision.md +0 -31
- package/docs/api/namespaces/media/interfaces/MediaAttachmentPointer.md +0 -133
- package/docs/api/namespaces/media/interfaces/MediaAttachmentPolicy.md +0 -67
- package/docs/api/namespaces/media/interfaces/MediaAttachmentProcessingPlan.md +0 -73
- package/docs/api/namespaces/media/interfaces/MediaAttachmentProgress.md +0 -69
- package/docs/api/namespaces/media/interfaces/MediaAttachmentResumeState.md +0 -37
- package/docs/api/namespaces/media/interfaces/MediaAttachmentRetryOptions.md +0 -31
- package/docs/api/namespaces/media/interfaces/MediaAttachmentTransfer.md +0 -51
- package/docs/api/namespaces/media/interfaces/MediaAttachmentTransferCheckpoint.md +0 -69
- package/docs/api/namespaces/media/interfaces/MediaAttachmentTransferOptions.md +0 -67
- package/docs/api/namespaces/media/interfaces/MediaAttachmentUploadJobData.md +0 -19
- package/docs/api/namespaces/media/interfaces/MediaAttachmentUploadResponse.md +0 -25
- package/docs/api/namespaces/media/interfaces/PlanMediaAttachmentCleanupJobsInput.md +0 -61
- package/docs/api/namespaces/media/interfaces/PlanMediaAttachmentDeleteSyncInput.md +0 -25
- package/docs/api/namespaces/media/interfaces/PlanMediaAttachmentDownloadJobInput.md +0 -161
- package/docs/api/namespaces/media/interfaces/PlanMediaAttachmentOpenInput.md +0 -25
- package/docs/api/namespaces/media/interfaces/PlanMediaAttachmentProcessingInput.md +0 -83
- package/docs/api/namespaces/media/interfaces/PlanMediaAttachmentUploadJobInput.md +0 -147
- package/docs/api/namespaces/media/interfaces/PrepareMediaAttachmentUploadOptions.md +0 -144
- package/docs/api/namespaces/media/interfaces/ResolveMediaAttachmentOptions.md +0 -55
- package/docs/api/namespaces/media/interfaces/ResolvedMediaAttachment.md +0 -109
- package/docs/api/namespaces/media/interfaces/TusMediaAttachmentTransferOptions.md +0 -85
- package/docs/api/namespaces/media/type-aliases/CreateMediaAttachmentPointerInput.md +0 -15
- package/docs/api/namespaces/media/type-aliases/MediaAttachmentCheckpointCallback.md +0 -19
- package/docs/api/namespaces/media/type-aliases/MediaAttachmentCleanupReason.md +0 -9
- package/docs/api/namespaces/media/type-aliases/MediaAttachmentErrorCode.md +0 -9
- package/docs/api/namespaces/media/type-aliases/MediaAttachmentFlag.md +0 -9
- package/docs/api/namespaces/media/type-aliases/MediaAttachmentJobExecutionStatus.md +0 -9
- package/docs/api/namespaces/media/type-aliases/MediaAttachmentJobOperation.md +0 -9
- package/docs/api/namespaces/media/type-aliases/MediaAttachmentJobPriority.md +0 -9
- package/docs/api/namespaces/media/type-aliases/MediaAttachmentJobSkipReason.md +0 -9
- package/docs/api/namespaces/media/type-aliases/MediaAttachmentJobSource.md +0 -9
- package/docs/api/namespaces/media/type-aliases/MediaAttachmentKnownIds.md +0 -9
- package/docs/api/namespaces/media/type-aliases/MediaAttachmentMessageType.md +0 -9
- package/docs/api/namespaces/media/type-aliases/MediaAttachmentProgressCallback.md +0 -19
- package/docs/api/namespaces/media/variables/MEDIA_ATTACHMENT_POLICY_DEFAULTS.md +0 -47
- package/docs/api/namespaces/media/variables/MEDIA_ATTACHMENT_POLICY_PRESETS.md +0 -95
- package/docs/api/namespaces/media/variables/MediaAttachmentCleanupReason.md +0 -27
- package/docs/api/namespaces/media/variables/MediaAttachmentErrorCode.md +0 -75
- package/docs/api/namespaces/media/variables/MediaAttachmentFlag.md +0 -23
- package/docs/api/namespaces/media/variables/MediaAttachmentJobExecutionStatus.md +0 -19
- package/docs/api/namespaces/media/variables/MediaAttachmentJobOperation.md +0 -31
- package/docs/api/namespaces/media/variables/MediaAttachmentJobPriority.md +0 -23
- package/docs/api/namespaces/media/variables/MediaAttachmentJobSource.md +0 -51
- package/docs/api/namespaces/media/variables/MediaAttachmentMessageType.md +0 -15
- package/docs/api/namespaces/media/variables/downloadMediaAttachment.md +0 -30
- package/docs/api/namespaces/safety/README.md +0 -61
- package/docs/api/namespaces/safety/classes/DisplayableFingerprint.md +0 -108
- package/docs/api/namespaces/safety/classes/Fingerprint.md +0 -104
- package/docs/api/namespaces/safety/classes/ScannableFingerprint.md +0 -209
- package/docs/api/namespaces/safety/functions/base64ToBytes.md +0 -21
- package/docs/api/namespaces/safety/functions/clearFingerprintCache.md +0 -15
- package/docs/api/namespaces/safety/functions/compareSafetyNumbers.md +0 -25
- package/docs/api/namespaces/safety/functions/createFingerprintData.md +0 -60
- package/docs/api/namespaces/safety/functions/extractQrData.md +0 -34
- package/docs/api/namespaces/safety/functions/generateCompositeSafetyNumber.md +0 -39
- package/docs/api/namespaces/safety/functions/generateEmojiFingerprint.md +0 -24
- package/docs/api/namespaces/safety/functions/generateSingleKeyReferenceSafetyNumber.md +0 -51
- package/docs/api/namespaces/safety/functions/generateVerifySchemeUrl.md +0 -32
- package/docs/api/namespaces/safety/functions/generateVerifyUrl.md +0 -49
- package/docs/api/namespaces/safety/functions/isValidSafetyNumber.md +0 -21
- package/docs/api/namespaces/safety/functions/isVerifyUrl.md +0 -45
- package/docs/api/namespaces/safety/functions/parseVerifyUrl.md +0 -31
- package/docs/api/namespaces/safety/interfaces/FingerprintData.md +0 -52
- package/docs/api/namespaces/safety/interfaces/SafetyNumber.md +0 -49
- package/docs/api/namespaces/safety/interfaces/VerifyLinkConfig.md +0 -28
- package/docs/api/namespaces/safety/interfaces/VerifyUrlParams.md +0 -49
- package/docs/api/namespaces/safety/type-aliases/CompareResult.md +0 -21
- package/docs/api/namespaces/safety/variables/DEFAULT_VERIFY_LINK_CONFIG.md +0 -12
- package/docs/api/namespaces/safety/variables/FINGERPRINT_ITERATIONS.md +0 -12
- package/docs/api/namespaces/safety/variables/FINGERPRINT_VERSION.md +0 -12
- package/docs/api/namespaces/safety/variables/VERIFY_BASE_URL.md +0 -11
- package/docs/api/namespaces/safety/variables/VERIFY_SCHEME_URL.md +0 -11
- package/docs/api/type-aliases/Base64.md +0 -20
- package/docs/api/type-aliases/BraidPolicy.md +0 -11
- package/docs/api/type-aliases/Bytes.md +0 -20
- package/docs/api/type-aliases/Ciphertext.md +0 -21
- package/docs/api/type-aliases/DeviceType.md +0 -11
- package/docs/api/type-aliases/DownloadedAttachment.md +0 -11
- package/docs/api/type-aliases/GroupId.md +0 -27
- package/docs/api/type-aliases/Hex.md +0 -20
- package/docs/api/type-aliases/HookName.md +0 -11
- package/docs/api/type-aliases/PostQuantumPolicy.md +0 -11
- package/docs/api/type-aliases/PreparedAttachmentUpload.md +0 -14
- package/docs/api/type-aliases/PrivateKey.md +0 -22
- package/docs/api/type-aliases/ProgressCallback.md +0 -45
- package/docs/api/type-aliases/PublicKey.md +0 -22
- package/docs/api/type-aliases/RemoteObjectCompleteUploadRequest.md +0 -19
- package/docs/api/type-aliases/RemoteObjectDeleteRequest.md +0 -19
- package/docs/api/type-aliases/RemoteObjectDownloadRequest.md +0 -19
- package/docs/api/type-aliases/RemoteObjectUploadRequest.md +0 -42
- package/docs/api/type-aliases/SCKAMode.md +0 -11
- package/docs/api/type-aliases/SealedSenderAuth.md +0 -15
- package/docs/api/type-aliases/SignalProtocolClientMediaCleanupInput.md +0 -9
- package/docs/api/type-aliases/SignalProtocolClientMediaCleanupResult.md +0 -9
- package/docs/api/type-aliases/SignalProtocolClientMediaDownloadInput.md +0 -9
- package/docs/api/type-aliases/SignalProtocolClientMediaDownloadResult.md +0 -9
- package/docs/api/type-aliases/SignalProtocolClientMediaOperationResult.md +0 -9
- package/docs/api/type-aliases/SignalProtocolClientMediaUploadInput.md +0 -9
- package/docs/api/type-aliases/SignalProtocolClientMediaUploadResult.md +0 -9
- package/docs/api/type-aliases/Signature.md +0 -21
- package/docs/api/type-aliases/Unsubscribe.md +0 -15
- package/docs/api/variables/BraidPolicy.md +0 -21
- package/docs/api/variables/DEFAULT_DEVICE_ID.md +0 -12
- package/docs/api/variables/DOUBLE_RATCHET_SPEC.md +0 -11
- package/docs/api/variables/GROUP_V2_PREFIX.md +0 -11
- package/docs/api/variables/KEY_REFRESH_INTERVAL_MS_DEFAULT.md +0 -11
- package/docs/api/variables/MAX_MESSAGE_KEYS.md +0 -14
- package/docs/api/variables/MAX_PREKEY_AGE_MS_DEFAULT.md +0 -11
- package/docs/api/variables/MAX_RECEIVER_CHAINS.md +0 -14
- package/docs/api/variables/MAX_REGISTRATION_ID.md +0 -16
- package/docs/api/variables/MAX_SKIP.md +0 -11
- package/docs/api/variables/MESSAGE_FORMAT.md +0 -11
- package/docs/api/variables/MIN_REGISTRATION_ID.md +0 -16
- package/docs/api/variables/ML_KEM_BRAID_SPEC.md +0 -11
- package/docs/api/variables/ONE_TIME_PREKEY_BATCH_SIZE.md +0 -21
- package/docs/api/variables/PQXDH_SPEC.md +0 -11
- package/docs/api/variables/PostQuantumPolicy.md +0 -21
- package/docs/api/variables/SENDER_KEY_FORMAT.md +0 -11
- package/docs/api/variables/SENDER_KEY_SPEC.md +0 -11
- package/docs/api/variables/SESAME_SPEC.md +0 -11
- package/docs/api/variables/SESSION_FORMAT.md +0 -11
- package/docs/api/variables/SPQR_LIMITS_DEFAULTS.md +0 -11
- package/docs/api/variables/X3DH_SPEC.md +0 -9
- package/docs/api/variables/defaultSignalProtocolLogger.md +0 -32
- /package/dist/internal/{groups-v2 → groups}/invite-link.d.ts +0 -0
- /package/dist/internal/{groups-v2 → groups}/invite-link.js +0 -0
|
@@ -7,17 +7,15 @@
|
|
|
7
7
|
* Field numbers follow the sealed-sender wire format.
|
|
8
8
|
*/
|
|
9
9
|
import protobuf from 'protobufjs';
|
|
10
|
+
import { SealedSenderContentType } from '../types.js';
|
|
10
11
|
import { bytesToBase64, base64ToBytes } from '../../../crypto/index.js';
|
|
11
12
|
/**
|
|
12
13
|
* Message type enum (matches proto).
|
|
14
|
+
*
|
|
15
|
+
* Aliases the implementation's content type so the wire enum and the type the
|
|
16
|
+
* seal/unseal path carries cannot drift apart.
|
|
13
17
|
*/
|
|
14
|
-
export
|
|
15
|
-
(function (MessageType) {
|
|
16
|
-
MessageType[MessageType["PREKEY_MESSAGE"] = 1] = "PREKEY_MESSAGE";
|
|
17
|
-
MessageType[MessageType["MESSAGE"] = 2] = "MESSAGE";
|
|
18
|
-
MessageType[MessageType["SENDERKEY_MESSAGE"] = 7] = "SENDERKEY_MESSAGE";
|
|
19
|
-
MessageType[MessageType["PLAINTEXT_CONTENT"] = 8] = "PLAINTEXT_CONTENT";
|
|
20
|
-
})(MessageType || (MessageType = {}));
|
|
18
|
+
export { SealedSenderContentType as MessageType };
|
|
21
19
|
// ============================================================================
|
|
22
20
|
// Protobuf Root and Type Definitions
|
|
23
21
|
// ============================================================================
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../internal/protocol/sealed-sender/proto/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AA2C/D
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../internal/protocol/sealed-sender/proto/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AA2C/D;;;;;GAKG;AACH,OAAO,EAAE,uBAAuB,IAAI,WAAW,EAAE,CAAC;AAsBlD,+EAA+E;AAC/E,qCAAqC;AACrC,+EAA+E;AAE/E,2EAA2E;AAC3E,MAAM,IAAI,GAAG,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC;AAEjC,mEAAmE;AACnE,MAAM,4BAA4B,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC;KAClE,GAAG,CAAC,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,EAAE,QAAQ,CAAC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H,MAAM,UAAU,+BAA+B,CAAC,GAAmC;IACjF,MAAM,OAAO,GAAG,6BAA6B,CAAC,MAAM,CAAC;QACnD,eAAe,EAAE,GAAG,CAAC,eAAe;QACpC,eAAe,EAAE,GAAG,CAAC,eAAe;QACpC,gBAAgB,EAAE,GAAG,CAAC,gBAAgB;KACvC,CAAC,CAAC;IACH,OAAO,6BAA6B,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,CAAC;AAChE,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,+BAA+B,CAAC,KAAiB;IAC/D,MAAM,OAAO,GAAG,6BAA6B,CAAC,MAAM,CAAC,KAAK,CAIzD,CAAC;IAEF,OAAO;QACL,eAAe,EAAE,IAAI,UAAU,CAAC,OAAO,CAAC,eAAe,CAAC;QACxD,eAAe,EAAE,IAAI,UAAU,CAAC,OAAO,CAAC,eAAe,CAAC;QACxD,gBAAgB,EAAE,IAAI,UAAU,CAAC,OAAO,CAAC,gBAAgB,CAAC;KAC3D,CAAC;AACJ,CAAC;AAED,+EAA+E;AAC/E,oBAAoB;AACpB,+EAA+E;AAE/E;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,KAAiB;IAC7C,OAAO,aAAa,CAAC,KAAK,CAAW,CAAC;AACxC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,MAAc;IAC1C,OAAO,aAAa,CAAC,MAAM,CAAC,CAAC;AAC/B,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sealed-sender certificate trust root for one relay deployment.
|
|
3
|
+
*
|
|
4
|
+
* The relay signs sender certificates with an Ed25519 key pair derived from
|
|
5
|
+
* the same 32-byte deployment secret that seeds the group server parameters,
|
|
6
|
+
* domain-separated from the group signing key — and from each other — by
|
|
7
|
+
* distinct KDF labels. Clients verify inbound sealed-sender certificates
|
|
8
|
+
* against the **root** public key, which they pin at build time. It is never
|
|
9
|
+
* discovered from a relay at runtime.
|
|
10
|
+
*
|
|
11
|
+
* This module is the single definition of that derivation. The relay backend
|
|
12
|
+
* derives signing keys from it and the `oe-groups trust-root` command derives
|
|
13
|
+
* the pinned public key from it, so an operator's printed root and the key the
|
|
14
|
+
* deployment actually signs with cannot drift apart.
|
|
15
|
+
*/
|
|
16
|
+
/** KDF label for the offline root key that signs the server certificate. */
|
|
17
|
+
export declare const SEALED_SENDER_ROOT_LABEL = "open-e2ee:sealed-sender:root:v1";
|
|
18
|
+
/** KDF label for the online server key that signs sender certificates. */
|
|
19
|
+
export declare const SEALED_SENDER_SERVER_LABEL = "open-e2ee:sealed-sender:server:v1";
|
|
20
|
+
/**
|
|
21
|
+
* Encode a scalar as 32 big-endian bytes.
|
|
22
|
+
*
|
|
23
|
+
* The width is fixed rather than minimal: a length-varying encoding would
|
|
24
|
+
* make the KDF input ambiguous and leak the scalar's magnitude through the
|
|
25
|
+
* derived key's provenance.
|
|
26
|
+
*/
|
|
27
|
+
export declare function scalarBytes(value: bigint): Uint8Array;
|
|
28
|
+
/**
|
|
29
|
+
* Derive one labelled Ed25519 private key from the deployment's group signing
|
|
30
|
+
* scalar: `SHA-256(label ‖ scalar)`.
|
|
31
|
+
*
|
|
32
|
+
* @param signingKey - `ServerSecretParams.signingKeyPair.signingKey`.
|
|
33
|
+
* @param label - One of the two exported label constants.
|
|
34
|
+
* @returns The raw 32-byte Ed25519 seed.
|
|
35
|
+
*/
|
|
36
|
+
export declare function deriveSealedSenderPrivateKey(signingKey: bigint, label: string): Promise<Uint8Array>;
|
|
37
|
+
/**
|
|
38
|
+
* Derive the Ed25519 **root** public key clients pin in
|
|
39
|
+
* `sealedSender.trustRoots`.
|
|
40
|
+
*
|
|
41
|
+
* @param signingKey - `ServerSecretParams.signingKeyPair.signingKey`.
|
|
42
|
+
* @returns The raw 32-byte Ed25519 public key.
|
|
43
|
+
*/
|
|
44
|
+
export declare function deriveSealedSenderRootPublicKey(signingKey: bigint): Promise<Uint8Array>;
|
|
45
|
+
//# sourceMappingURL=trust-root.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trust-root.d.ts","sourceRoot":"","sources":["../../../../internal/protocol/sealed-sender/trust-root.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH,4EAA4E;AAC5E,eAAO,MAAM,wBAAwB,oCAAoC,CAAC;AAE1E,0EAA0E;AAC1E,eAAO,MAAM,0BAA0B,sCAAsC,CAAC;AAI9E;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,CAQrD;AAED;;;;;;;GAOG;AACH,wBAAsB,4BAA4B,CAChD,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,UAAU,CAAC,CAYrB;AAED;;;;;;GAMG;AACH,wBAAsB,+BAA+B,CACnD,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,UAAU,CAAC,CAUrB"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sealed-sender certificate trust root for one relay deployment.
|
|
3
|
+
*
|
|
4
|
+
* The relay signs sender certificates with an Ed25519 key pair derived from
|
|
5
|
+
* the same 32-byte deployment secret that seeds the group server parameters,
|
|
6
|
+
* domain-separated from the group signing key — and from each other — by
|
|
7
|
+
* distinct KDF labels. Clients verify inbound sealed-sender certificates
|
|
8
|
+
* against the **root** public key, which they pin at build time. It is never
|
|
9
|
+
* discovered from a relay at runtime.
|
|
10
|
+
*
|
|
11
|
+
* This module is the single definition of that derivation. The relay backend
|
|
12
|
+
* derives signing keys from it and the `oe-groups trust-root` command derives
|
|
13
|
+
* the pinned public key from it, so an operator's printed root and the key the
|
|
14
|
+
* deployment actually signs with cannot drift apart.
|
|
15
|
+
*/
|
|
16
|
+
import { ed25519 } from '@noble/curves/ed25519.js';
|
|
17
|
+
import { sha256 } from '../../crypto/hash/sha256.js';
|
|
18
|
+
/** KDF label for the offline root key that signs the server certificate. */
|
|
19
|
+
export const SEALED_SENDER_ROOT_LABEL = 'open-e2ee:sealed-sender:root:v1';
|
|
20
|
+
/** KDF label for the online server key that signs sender certificates. */
|
|
21
|
+
export const SEALED_SENDER_SERVER_LABEL = 'open-e2ee:sealed-sender:server:v1';
|
|
22
|
+
const textEncoder = new TextEncoder();
|
|
23
|
+
/**
|
|
24
|
+
* Encode a scalar as 32 big-endian bytes.
|
|
25
|
+
*
|
|
26
|
+
* The width is fixed rather than minimal: a length-varying encoding would
|
|
27
|
+
* make the KDF input ambiguous and leak the scalar's magnitude through the
|
|
28
|
+
* derived key's provenance.
|
|
29
|
+
*/
|
|
30
|
+
export function scalarBytes(value) {
|
|
31
|
+
const result = new Uint8Array(32);
|
|
32
|
+
let remaining = value;
|
|
33
|
+
for (let index = result.length - 1; index >= 0; index--) {
|
|
34
|
+
result[index] = Number(remaining & 0xffn);
|
|
35
|
+
remaining >>= 8n;
|
|
36
|
+
}
|
|
37
|
+
return result;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Derive one labelled Ed25519 private key from the deployment's group signing
|
|
41
|
+
* scalar: `SHA-256(label ‖ scalar)`.
|
|
42
|
+
*
|
|
43
|
+
* @param signingKey - `ServerSecretParams.signingKeyPair.signingKey`.
|
|
44
|
+
* @param label - One of the two exported label constants.
|
|
45
|
+
* @returns The raw 32-byte Ed25519 seed.
|
|
46
|
+
*/
|
|
47
|
+
export async function deriveSealedSenderPrivateKey(signingKey, label) {
|
|
48
|
+
const scalar = scalarBytes(signingKey);
|
|
49
|
+
const labelBytes = textEncoder.encode(label);
|
|
50
|
+
const material = new Uint8Array(labelBytes.length + scalar.length);
|
|
51
|
+
material.set(labelBytes);
|
|
52
|
+
material.set(scalar, labelBytes.length);
|
|
53
|
+
try {
|
|
54
|
+
return await sha256(material);
|
|
55
|
+
}
|
|
56
|
+
finally {
|
|
57
|
+
scalar.fill(0);
|
|
58
|
+
material.fill(0);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Derive the Ed25519 **root** public key clients pin in
|
|
63
|
+
* `sealedSender.trustRoots`.
|
|
64
|
+
*
|
|
65
|
+
* @param signingKey - `ServerSecretParams.signingKeyPair.signingKey`.
|
|
66
|
+
* @returns The raw 32-byte Ed25519 public key.
|
|
67
|
+
*/
|
|
68
|
+
export async function deriveSealedSenderRootPublicKey(signingKey) {
|
|
69
|
+
const rootPrivateKey = await deriveSealedSenderPrivateKey(signingKey, SEALED_SENDER_ROOT_LABEL);
|
|
70
|
+
try {
|
|
71
|
+
return ed25519.getPublicKey(rootPrivateKey);
|
|
72
|
+
}
|
|
73
|
+
finally {
|
|
74
|
+
rootPrivateKey.fill(0);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=trust-root.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trust-root.js","sourceRoot":"","sources":["../../../../internal/protocol/sealed-sender/trust-root.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAElD,4EAA4E;AAC5E,MAAM,CAAC,MAAM,wBAAwB,GAAG,iCAAiC,CAAC;AAE1E,0EAA0E;AAC1E,MAAM,CAAC,MAAM,0BAA0B,GAAG,mCAAmC,CAAC;AAE9E,MAAM,WAAW,GAAG,IAAI,WAAW,EAAE,CAAC;AAEtC;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CAAC,KAAa;IACvC,MAAM,MAAM,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;IAClC,IAAI,SAAS,GAAG,KAAK,CAAC;IACtB,KAAK,IAAI,KAAK,GAAG,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC;QACxD,MAAM,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,SAAS,GAAG,KAAK,CAAC,CAAC;QAC1C,SAAS,KAAK,EAAE,CAAC;IACnB,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,4BAA4B,CAChD,UAAkB,EAClB,KAAa;IAEb,MAAM,MAAM,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC;IACvC,MAAM,UAAU,GAAG,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC7C,MAAM,QAAQ,GAAG,IAAI,UAAU,CAAC,UAAU,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;IACnE,QAAQ,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IACzB,QAAQ,CAAC,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;IACxC,IAAI,CAAC;QACH,OAAO,MAAM,MAAM,CAAC,QAAQ,CAAC,CAAC;IAChC,CAAC;YAAS,CAAC;QACT,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACf,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACnB,CAAC;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,+BAA+B,CACnD,UAAkB;IAElB,MAAM,cAAc,GAAG,MAAM,4BAA4B,CACvD,UAAU,EACV,wBAAwB,CACzB,CAAC;IACF,IAAI,CAAC;QACH,OAAO,OAAO,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC;IAC9C,CAAC;YAAS,CAAC;QACT,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACzB,CAAC;AACH,CAAC"}
|
|
@@ -150,10 +150,49 @@ export interface UnidentifiedSenderMessage {
|
|
|
150
150
|
/**
|
|
151
151
|
* Stage 2 encrypted content: certificate + message + MAC.
|
|
152
152
|
* Format: AES-CTR(s_cipherKey, envelope) || HMAC(s_macKey, ciphertext)
|
|
153
|
-
* Where envelope =
|
|
153
|
+
* Where envelope = contentType(1) || varint(certLen) || cert ||
|
|
154
|
+
* varint(msgLen) || msg || hint
|
|
154
155
|
*/
|
|
155
156
|
encryptedMessage: Base64;
|
|
156
157
|
}
|
|
158
|
+
/**
|
|
159
|
+
* How the recipient should decrypt the payload inside a sealed envelope.
|
|
160
|
+
*
|
|
161
|
+
* The outer envelope is `unidentified_sender` for every sealed message, so
|
|
162
|
+
* this is the only thing that tells the recipient which decryption path to
|
|
163
|
+
* take. Values match the `Type` enum of the reference implementation's
|
|
164
|
+
* `UnidentifiedSenderMessage.Message`.
|
|
165
|
+
*/
|
|
166
|
+
export declare enum SealedSenderContentType {
|
|
167
|
+
/** Ratchet message that also establishes the session. */
|
|
168
|
+
PREKEY_MESSAGE = 1,
|
|
169
|
+
/** Ordinary Double Ratchet message. */
|
|
170
|
+
MESSAGE = 2,
|
|
171
|
+
/** Framed SenderKeyMessage: group traffic. */
|
|
172
|
+
SENDERKEY_MESSAGE = 7,
|
|
173
|
+
/**
|
|
174
|
+
* Unencrypted content. Listed to keep the enum a faithful record of the
|
|
175
|
+
* wire values, but **not supported** — see `isSealedSenderContentType`.
|
|
176
|
+
*/
|
|
177
|
+
PLAINTEXT_CONTENT = 8
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Whether a byte off the wire names a content type this version can route.
|
|
181
|
+
*
|
|
182
|
+
* The envelope is authenticated before it is parsed, so a value outside this
|
|
183
|
+
* set means a peer running a different version rather than an attacker.
|
|
184
|
+
* Rejecting at the parse keeps the parse canonical: one byte, one meaning, and
|
|
185
|
+
* no value that survives to be interpreted by a routing default further
|
|
186
|
+
* downstream.
|
|
187
|
+
*
|
|
188
|
+
* `PLAINTEXT_CONTENT` is deliberately excluded. The reference uses it to carry
|
|
189
|
+
* a decryption-error receipt when no session exists; this implementation
|
|
190
|
+
* delivers those over a dedicated relay channel instead (`retryRequests`), so
|
|
191
|
+
* nothing here produces the type and no decrypt path consumes it. Accepting it
|
|
192
|
+
* would mean routing an unauthenticated payload — the whole point of the type
|
|
193
|
+
* is that it is not encrypted — through a path with no handler for it.
|
|
194
|
+
*/
|
|
195
|
+
export declare function isSealedSenderContentType(value: number): value is SealedSenderContentType;
|
|
157
196
|
/**
|
|
158
197
|
* Decrypted content from sealed sender message.
|
|
159
198
|
*/
|
|
@@ -167,13 +206,19 @@ export interface UnidentifiedSenderMessageContent {
|
|
|
167
206
|
*/
|
|
168
207
|
signalProtocolMessage: Base64;
|
|
169
208
|
/**
|
|
170
|
-
*
|
|
209
|
+
* How to decrypt `signalProtocolMessage`.
|
|
210
|
+
*
|
|
211
|
+
* `SENDERKEY_MESSAGE` says the payload is a framed SenderKeyMessage. It
|
|
212
|
+
* does not say which group: the recipient reads the opaque distribution
|
|
213
|
+
* identifier out of the frame and resolves the group against its own sender
|
|
214
|
+
* key store, the same way it does for an unsealed group message. No group
|
|
215
|
+
* identifier travels in a sealed envelope at all.
|
|
171
216
|
*/
|
|
172
|
-
|
|
217
|
+
contentType: SealedSenderContentType;
|
|
173
218
|
/**
|
|
174
|
-
*
|
|
219
|
+
* Content hint for processing.
|
|
175
220
|
*/
|
|
176
|
-
|
|
221
|
+
contentHint?: ContentHint;
|
|
177
222
|
}
|
|
178
223
|
/**
|
|
179
224
|
* Options for sealing a message.
|
|
@@ -200,9 +245,14 @@ export interface SealOptions {
|
|
|
200
245
|
*/
|
|
201
246
|
contentHint?: ContentHint;
|
|
202
247
|
/**
|
|
203
|
-
*
|
|
248
|
+
* How the recipient should decrypt `signalProtocolMessage`.
|
|
249
|
+
*
|
|
250
|
+
* Defaults to `MESSAGE`. Group traffic must pass `SENDERKEY_MESSAGE`: the
|
|
251
|
+
* outer envelope is `unidentified_sender` for everything, so this is the
|
|
252
|
+
* only thing that tells the recipient the payload is a framed
|
|
253
|
+
* SenderKeyMessage.
|
|
204
254
|
*/
|
|
205
|
-
|
|
255
|
+
contentType?: SealedSenderContentType;
|
|
206
256
|
}
|
|
207
257
|
/**
|
|
208
258
|
* Options for unsealing a message.
|
|
@@ -337,9 +387,14 @@ export interface SealMultiRecipientOptions {
|
|
|
337
387
|
*/
|
|
338
388
|
contentHint?: ContentHint;
|
|
339
389
|
/**
|
|
340
|
-
*
|
|
390
|
+
* How the recipient should decrypt `signalProtocolMessage`.
|
|
391
|
+
*
|
|
392
|
+
* Defaults to `MESSAGE`. Group traffic must pass `SENDERKEY_MESSAGE`: the
|
|
393
|
+
* outer envelope is `unidentified_sender` for everything, so this is the
|
|
394
|
+
* only thing that tells the recipient the payload is a framed
|
|
395
|
+
* SenderKeyMessage.
|
|
341
396
|
*/
|
|
342
|
-
|
|
397
|
+
contentType?: SealedSenderContentType;
|
|
343
398
|
}
|
|
344
399
|
/**
|
|
345
400
|
* Options for V2 unsealing (extends V1 options).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../internal/protocol/sealed-sender/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAMtD;;;;;;;;;GASG;AACH,OAAO,EAAE,CAAC;AACV,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,gBAAgB,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAMD;;;;;;;;;GASG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;;OAGG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAE1B;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;OAIG;IACH,MAAM,EAAE,iBAAiB,CAAC;IAE1B;;;OAGG;IACH,gBAAgB,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAMD;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAMD;;;;;;;;;;GAUG;AACH,MAAM,WAAW,yBAAyB;IACxC;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,eAAe,EAAE,MAAM,CAAC;IAExB;;;;OAIG;IACH,eAAe,EAAE,MAAM,CAAC;IAExB
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../internal/protocol/sealed-sender/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAMtD;;;;;;;;;GASG;AACH,OAAO,EAAE,CAAC;AACV,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,gBAAgB,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAMD;;;;;;;;;GASG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;;OAGG;IACH,iBAAiB,EAAE,MAAM,CA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AM,wBAAwB,KAAO,CAAC;AAC7C,eAAO,MAAM,6BAA6B,KAAO,CAAC;AAClD,eAAO,MAAM,mCAAmC,KAAO,CAAC;AAExD,iDAAiD;AACjD,eAAO,MAAM,qBAAqB,KAA2B,CAAC;AAE9D;;GAEG;AACH,eAAO,MAAM,kBAAkB,yBAAyB,CAAC;AAEzD;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAEnC;;GAEG;AACH,eAAO,MAAM,yBAAyB,QAAsB,CAAC;AAE7D;;GAEG;AACH,eAAO,MAAM,0BAA0B,KAAK,CAAC;AAE7C;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,KAAK,CAAC;AAE5B;;;;;;;;GAQG;AACH,eAAO,MAAM,uBAAuB,EAAE,SAAS,MAAM,EAAO,CAAC"}
|
|
@@ -7,6 +7,49 @@
|
|
|
7
7
|
*
|
|
8
8
|
* @see https://signal.org/blog/sealed-sender/
|
|
9
9
|
*/
|
|
10
|
+
/**
|
|
11
|
+
* How the recipient should decrypt the payload inside a sealed envelope.
|
|
12
|
+
*
|
|
13
|
+
* The outer envelope is `unidentified_sender` for every sealed message, so
|
|
14
|
+
* this is the only thing that tells the recipient which decryption path to
|
|
15
|
+
* take. Values match the `Type` enum of the reference implementation's
|
|
16
|
+
* `UnidentifiedSenderMessage.Message`.
|
|
17
|
+
*/
|
|
18
|
+
export var SealedSenderContentType;
|
|
19
|
+
(function (SealedSenderContentType) {
|
|
20
|
+
/** Ratchet message that also establishes the session. */
|
|
21
|
+
SealedSenderContentType[SealedSenderContentType["PREKEY_MESSAGE"] = 1] = "PREKEY_MESSAGE";
|
|
22
|
+
/** Ordinary Double Ratchet message. */
|
|
23
|
+
SealedSenderContentType[SealedSenderContentType["MESSAGE"] = 2] = "MESSAGE";
|
|
24
|
+
/** Framed SenderKeyMessage: group traffic. */
|
|
25
|
+
SealedSenderContentType[SealedSenderContentType["SENDERKEY_MESSAGE"] = 7] = "SENDERKEY_MESSAGE";
|
|
26
|
+
/**
|
|
27
|
+
* Unencrypted content. Listed to keep the enum a faithful record of the
|
|
28
|
+
* wire values, but **not supported** — see `isSealedSenderContentType`.
|
|
29
|
+
*/
|
|
30
|
+
SealedSenderContentType[SealedSenderContentType["PLAINTEXT_CONTENT"] = 8] = "PLAINTEXT_CONTENT";
|
|
31
|
+
})(SealedSenderContentType || (SealedSenderContentType = {}));
|
|
32
|
+
/**
|
|
33
|
+
* Whether a byte off the wire names a content type this version can route.
|
|
34
|
+
*
|
|
35
|
+
* The envelope is authenticated before it is parsed, so a value outside this
|
|
36
|
+
* set means a peer running a different version rather than an attacker.
|
|
37
|
+
* Rejecting at the parse keeps the parse canonical: one byte, one meaning, and
|
|
38
|
+
* no value that survives to be interpreted by a routing default further
|
|
39
|
+
* downstream.
|
|
40
|
+
*
|
|
41
|
+
* `PLAINTEXT_CONTENT` is deliberately excluded. The reference uses it to carry
|
|
42
|
+
* a decryption-error receipt when no session exists; this implementation
|
|
43
|
+
* delivers those over a dedicated relay channel instead (`retryRequests`), so
|
|
44
|
+
* nothing here produces the type and no decrypt path consumes it. Accepting it
|
|
45
|
+
* would mean routing an unauthenticated payload — the whole point of the type
|
|
46
|
+
* is that it is not encrypted — through a path with no handler for it.
|
|
47
|
+
*/
|
|
48
|
+
export function isSealedSenderContentType(value) {
|
|
49
|
+
return (value === SealedSenderContentType.PREKEY_MESSAGE ||
|
|
50
|
+
value === SealedSenderContentType.MESSAGE ||
|
|
51
|
+
value === SealedSenderContentType.SENDERKEY_MESSAGE);
|
|
52
|
+
}
|
|
10
53
|
// ============================================================================
|
|
11
54
|
// V2 Constants
|
|
12
55
|
// ============================================================================
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../internal/protocol/sealed-sender/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../internal/protocol/sealed-sender/types.ts"],"names":[],"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AC,CAAC,oBAAoB;AAE7E,iDAAiD;AACjD,MAAM,CAAC,MAAM,qBAAqB,GAAG,wBAAwB,CAAC;AAE9D;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,sBAAsB,CAAC;AAEzD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAEnC;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAE7D;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,EAAE,CAAC;AAE7C;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,EAAE,CAAC;AAE5B;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAsB,EAAE,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Sender Keys
|
|
2
|
+
* Sender Keys protocol implementation for group messaging
|
|
3
3
|
*
|
|
4
4
|
* Implements the package's Sender Keys construction for efficient group messaging.
|
|
5
5
|
* Each group member has a sender key that encrypts messages for all members.
|
|
@@ -21,6 +21,20 @@ import { type ILogger } from '../../../logger.js';
|
|
|
21
21
|
import { type SenderKeysConfig } from '../../../types/protocol-config.js';
|
|
22
22
|
export {};
|
|
23
23
|
export interface SenderKeyState {
|
|
24
|
+
/**
|
|
25
|
+
* Opaque random UUID identifying this sender key.
|
|
26
|
+
*
|
|
27
|
+
* Written to the wire as the SenderKeyMessage `distribution_uuid`, which
|
|
28
|
+
* sits in the *unencrypted* frame — a relay reads it off every group
|
|
29
|
+
* message. It therefore carries no derivable content: no group, no sender,
|
|
30
|
+
* no device, no timestamp. Matching the reference, which likewise uses a
|
|
31
|
+
* random UUID distinct from the group identifier.
|
|
32
|
+
*
|
|
33
|
+
* Randomness also makes rotation unambiguous. Receivers detect a rotation by
|
|
34
|
+
* comparing this value against their stored state, so an identifier built
|
|
35
|
+
* from a millisecond clock would collide for two rotations inside the same
|
|
36
|
+
* millisecond and hide the second one.
|
|
37
|
+
*/
|
|
24
38
|
senderKeyId: string;
|
|
25
39
|
/**
|
|
26
40
|
* Sender key wire format version for protocol evolution.
|
|
@@ -169,6 +183,29 @@ export declare class SenderKeyManager {
|
|
|
169
183
|
* @param message - Encrypted message
|
|
170
184
|
* @returns Decrypted plaintext
|
|
171
185
|
*/
|
|
186
|
+
/**
|
|
187
|
+
* Resolve the group a framed SenderKeyMessage belongs to.
|
|
188
|
+
*
|
|
189
|
+
* A group envelope names no group. It carries the sender's identity and an
|
|
190
|
+
* opaque distribution identifier inside the frame, and the receiver maps
|
|
191
|
+
* that identifier back to a group through its own sender key store — the
|
|
192
|
+
* store is the only thing that knows the association, which is why the
|
|
193
|
+
* relay cannot learn it.
|
|
194
|
+
*
|
|
195
|
+
* Parsing here reads unauthenticated bytes: the signature is not checked
|
|
196
|
+
* until `decryptGroupMessage`. That is safe because the only thing taken
|
|
197
|
+
* from them is an identifier used as a lookup key. A forged identifier
|
|
198
|
+
* either matches no record, or matches one — and matching one is not an
|
|
199
|
+
* escalation, since the caller's own state already binds that identifier to
|
|
200
|
+
* a public signature key, which the subsequent verification will reject the
|
|
201
|
+
* forgery against.
|
|
202
|
+
*
|
|
203
|
+
* @param framedMessage - Framed SenderKeyMessage bytes from the envelope
|
|
204
|
+
* @param senderId - Sender user identifier, from the envelope
|
|
205
|
+
* @param senderDeviceId - Sender device identifier, from the envelope
|
|
206
|
+
* @returns The group identifier, or null if no sender key matches
|
|
207
|
+
*/
|
|
208
|
+
resolveGroupForFramedMessage(framedMessage: Uint8Array, senderId: string, senderDeviceId: number): Promise<string | null>;
|
|
172
209
|
decryptGroupMessage(groupId: string, senderId: string, senderDeviceId: number, framedMessage: Uint8Array): Promise<string>;
|
|
173
210
|
/**
|
|
174
211
|
* Decrypt message using stored skipped key (out-of-order delivery).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../../../internal/protocol/sender-keys/manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAGpE,OAAO,EAA+B,KAAK,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE5E,OAAO,EACL,KAAK,gBAAgB,
|
|
1
|
+
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../../../internal/protocol/sender-keys/manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAGpE,OAAO,EAA+B,KAAK,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE5E,OAAO,EACL,KAAK,gBAAgB,EAKtB,MAAM,gCAAgC,CAAC;AAaxC,OAAO,EAAE,CAAC;AACV,MAAM,WAAW,cAAc;IAC7B;;;;;;;;;;;;;OAaG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;;;OAKG;IACH,gBAAgB,EAAE,MAAM,CAAC;IAEzB;;;;;OAKG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;IAEnB;;;;;OAKG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,4BAA4B;IAC3C,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,MAAM,CAAC;IACp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;;;;;;;;;OAwBG;IACH,OAAO,CAAC,mBAAmB;CAsB5B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Sender Keys
|
|
2
|
+
* Sender Keys protocol implementation for group messaging
|
|
3
3
|
*
|
|
4
4
|
* Implements the package's Sender Keys construction for efficient group messaging.
|
|
5
5
|
* Each group member has a sender key that encrypts messages for all members.
|
|
@@ -20,7 +20,7 @@ import * as crypto from '../../crypto/index.js';
|
|
|
20
20
|
import { SENDER_KEY_FORMAT, SENDER_KEY_MESSAGE_VERSION } from '../../../versions.js';
|
|
21
21
|
import { defaultSignalProtocolLogger } from '../../../logger.js';
|
|
22
22
|
import { asBase64 } from '../../../types/utils.js';
|
|
23
|
-
import { SENDER_KEYS_DEFAULTS, MAX_SENDER_KEY_STATES, } from '../../../types/protocol-config.js';
|
|
23
|
+
import { SENDER_KEYS_DEFAULTS, SENDER_KEY_AGE_CEILING, SENDER_KEY_AGE_FLOOR, MAX_SENDER_KEY_STATES, } from '../../../types/protocol-config.js';
|
|
24
24
|
import { EncryptionError, EncryptionErrorCode } from '../../../types/errors.js';
|
|
25
25
|
import { encodeSenderKeyMessage, decodeSenderKeyMessage, frameSenderKeyMessage, parseSenderKeyMessage, SENDERKEY_MESSAGE_CURRENT_VERSION, } from '../../encoding/proto/sender-key-message.js';
|
|
26
26
|
// ============================================================================
|
|
@@ -42,6 +42,55 @@ const CHAIN_KEY_CONSTANT = new Uint8Array([0x02]);
|
|
|
42
42
|
// ============================================================================
|
|
43
43
|
// Sender Key Manager
|
|
44
44
|
// ============================================================================
|
|
45
|
+
/**
|
|
46
|
+
* Resolve the configured sender key age against the default and the bounds.
|
|
47
|
+
*
|
|
48
|
+
* A host-supplied age can be wrong in three ways, and they warrant different
|
|
49
|
+
* treatment.
|
|
50
|
+
*
|
|
51
|
+
* An age above {@link SENDER_KEY_AGE_CEILING}, or below
|
|
52
|
+
* {@link SENDER_KEY_AGE_FLOOR}, is a coherent policy that reaches past what
|
|
53
|
+
* the implementation can honour — too long to bound a key's life, or too short
|
|
54
|
+
* for the rotate-and-redistribute path to beat — so the bound it passed is
|
|
55
|
+
* used and the direction of its intent is kept.
|
|
56
|
+
*
|
|
57
|
+
* A value that is not a positive finite number is not a policy at all, and
|
|
58
|
+
* unlike an out-of-range one it does not say which way the host wanted to
|
|
59
|
+
* move. A zero in particular is far more often an absent or uninitialised
|
|
60
|
+
* field than a request to rotate constantly, and reading it as the latter
|
|
61
|
+
* would impose the tightest rotation the SDK allows on a host that asked for
|
|
62
|
+
* nothing. So it falls back to the default; a host that genuinely wants
|
|
63
|
+
* maximal rotation can say so with any positive value and get the floor.
|
|
64
|
+
*
|
|
65
|
+
* All three are logged: a silent clamp would leave a host believing a rotation
|
|
66
|
+
* interval it is not getting.
|
|
67
|
+
*/
|
|
68
|
+
function resolveMaxSenderKeyAge(configured, logger) {
|
|
69
|
+
if (configured === undefined)
|
|
70
|
+
return SENDER_KEYS_DEFAULTS.maxSenderKeyAge;
|
|
71
|
+
if (!Number.isFinite(configured) || configured <= 0) {
|
|
72
|
+
logger.warn('Ignoring invalid maxSenderKeyAge; using the default', {
|
|
73
|
+
category: 'E2EE',
|
|
74
|
+
data: { configured, using: SENDER_KEYS_DEFAULTS.maxSenderKeyAge },
|
|
75
|
+
});
|
|
76
|
+
return SENDER_KEYS_DEFAULTS.maxSenderKeyAge;
|
|
77
|
+
}
|
|
78
|
+
if (configured > SENDER_KEY_AGE_CEILING) {
|
|
79
|
+
logger.warn('Clamping maxSenderKeyAge to the ceiling', {
|
|
80
|
+
category: 'E2EE',
|
|
81
|
+
data: { configured, ceiling: SENDER_KEY_AGE_CEILING },
|
|
82
|
+
});
|
|
83
|
+
return SENDER_KEY_AGE_CEILING;
|
|
84
|
+
}
|
|
85
|
+
if (configured < SENDER_KEY_AGE_FLOOR) {
|
|
86
|
+
logger.warn('Raising maxSenderKeyAge to the floor', {
|
|
87
|
+
category: 'E2EE',
|
|
88
|
+
data: { configured, floor: SENDER_KEY_AGE_FLOOR },
|
|
89
|
+
});
|
|
90
|
+
return SENDER_KEY_AGE_FLOOR;
|
|
91
|
+
}
|
|
92
|
+
return configured;
|
|
93
|
+
}
|
|
45
94
|
export class SenderKeyManager {
|
|
46
95
|
storage;
|
|
47
96
|
/** Resolved configuration values */
|
|
@@ -72,7 +121,7 @@ export class SenderKeyManager {
|
|
|
72
121
|
this.hkdfInfoString = config?.hkdfInfoString ?? SENDER_KEYS_DEFAULTS.hkdfInfoString;
|
|
73
122
|
this.maxChainAdvance = config?.maxChainAdvance ?? SENDER_KEYS_DEFAULTS.maxChainAdvance;
|
|
74
123
|
this.maxSkippedKeys = config?.maxSkippedKeys ?? SENDER_KEYS_DEFAULTS.maxSkippedKeys;
|
|
75
|
-
this.maxSenderKeyAge = config?.maxSenderKeyAge
|
|
124
|
+
this.maxSenderKeyAge = resolveMaxSenderKeyAge(config?.maxSenderKeyAge, this.logger);
|
|
76
125
|
}
|
|
77
126
|
/**
|
|
78
127
|
* Get the storage key for the previousStates map.
|
|
@@ -156,8 +205,7 @@ export class SenderKeyManager {
|
|
|
156
205
|
* @returns Sender key ID and distribution message to share with group
|
|
157
206
|
*/
|
|
158
207
|
async createSenderKey(groupId, userId, deviceId) {
|
|
159
|
-
|
|
160
|
-
const senderKeyId = `${groupId}:${userId}:${deviceId}:${Date.now()}`;
|
|
208
|
+
const senderKeyId = await crypto.generateUuidV4();
|
|
161
209
|
const chainId = this.generateChainId(senderKeyId);
|
|
162
210
|
// Generate key material
|
|
163
211
|
const chainKey = await crypto.generateRandomBytes(32);
|
|
@@ -310,7 +358,22 @@ export class SenderKeyManager {
|
|
|
310
358
|
}
|
|
311
359
|
// Received keys have no private signature key, so time-based expiration
|
|
312
360
|
// applies only to locally created encryption keys.
|
|
313
|
-
if (state.signatureKey
|
|
361
|
+
if (state.signatureKey) {
|
|
362
|
+
// A locally created key always records when it was created, at creation
|
|
363
|
+
// and again at every rotation. One that does not is damaged or predates
|
|
364
|
+
// the field, and its age cannot be established — which is the single
|
|
365
|
+
// thing this bound exists to establish, so skipping the check on it
|
|
366
|
+
// would exempt the only keys whose life is genuinely unbounded. Treat it
|
|
367
|
+
// as expired instead: the caller answers that by rotating, which costs a
|
|
368
|
+
// redistribution and restores a key whose age is known.
|
|
369
|
+
if (!Number.isFinite(state.createdAt) || state.createdAt <= 0) {
|
|
370
|
+
throw new EncryptionError('Sender key has no usable creation time, so its age cannot be checked. Auto-rotation required.', EncryptionErrorCode.SENDER_KEY_EXPIRED, {
|
|
371
|
+
senderKeyId: state.senderKeyId,
|
|
372
|
+
groupId,
|
|
373
|
+
createdAt: state.createdAt,
|
|
374
|
+
maxAgeMs: this.maxSenderKeyAge,
|
|
375
|
+
});
|
|
376
|
+
}
|
|
314
377
|
const age = Date.now() - state.createdAt;
|
|
315
378
|
if (age > this.maxSenderKeyAge) {
|
|
316
379
|
throw new EncryptionError(`Sender key expired after ${Math.floor(age / (24 * 60 * 60 * 1000))} days (max: ${Math.floor(this.maxSenderKeyAge / (24 * 60 * 60 * 1000))} days). Auto-rotation required.`, EncryptionErrorCode.SENDER_KEY_EXPIRED, { senderKeyId: state.senderKeyId, groupId, ageMs: age, maxAgeMs: this.maxSenderKeyAge });
|
|
@@ -380,6 +443,45 @@ export class SenderKeyManager {
|
|
|
380
443
|
* @param message - Encrypted message
|
|
381
444
|
* @returns Decrypted plaintext
|
|
382
445
|
*/
|
|
446
|
+
/**
|
|
447
|
+
* Resolve the group a framed SenderKeyMessage belongs to.
|
|
448
|
+
*
|
|
449
|
+
* A group envelope names no group. It carries the sender's identity and an
|
|
450
|
+
* opaque distribution identifier inside the frame, and the receiver maps
|
|
451
|
+
* that identifier back to a group through its own sender key store — the
|
|
452
|
+
* store is the only thing that knows the association, which is why the
|
|
453
|
+
* relay cannot learn it.
|
|
454
|
+
*
|
|
455
|
+
* Parsing here reads unauthenticated bytes: the signature is not checked
|
|
456
|
+
* until `decryptGroupMessage`. That is safe because the only thing taken
|
|
457
|
+
* from them is an identifier used as a lookup key. A forged identifier
|
|
458
|
+
* either matches no record, or matches one — and matching one is not an
|
|
459
|
+
* escalation, since the caller's own state already binds that identifier to
|
|
460
|
+
* a public signature key, which the subsequent verification will reject the
|
|
461
|
+
* forgery against.
|
|
462
|
+
*
|
|
463
|
+
* @param framedMessage - Framed SenderKeyMessage bytes from the envelope
|
|
464
|
+
* @param senderId - Sender user identifier, from the envelope
|
|
465
|
+
* @param senderDeviceId - Sender device identifier, from the envelope
|
|
466
|
+
* @returns The group identifier, or null if no sender key matches
|
|
467
|
+
*/
|
|
468
|
+
async resolveGroupForFramedMessage(framedMessage, senderId, senderDeviceId) {
|
|
469
|
+
let senderKeyId;
|
|
470
|
+
try {
|
|
471
|
+
const { protobufBytes } = parseSenderKeyMessage(framedMessage);
|
|
472
|
+
const decoded = decodeSenderKeyMessage(protobufBytes);
|
|
473
|
+
if (!decoded.distributionUuid)
|
|
474
|
+
return null;
|
|
475
|
+
senderKeyId = new TextDecoder().decode(decoded.distributionUuid);
|
|
476
|
+
}
|
|
477
|
+
catch {
|
|
478
|
+
// Not a well-formed frame, so it names no distribution and no group.
|
|
479
|
+
return null;
|
|
480
|
+
}
|
|
481
|
+
if (!senderKeyId)
|
|
482
|
+
return null;
|
|
483
|
+
return this.storage.resolveGroupForSenderKeyId(senderKeyId, senderId, senderDeviceId);
|
|
484
|
+
}
|
|
383
485
|
async decryptGroupMessage(groupId, senderId, senderDeviceId, framedMessage) {
|
|
384
486
|
// Parse framed SenderKeyMessage: [version_byte(1)] [protobuf(N)] [signature(64)]
|
|
385
487
|
const { protobufBytes, signature } = parseSenderKeyMessage(framedMessage);
|
|
@@ -640,8 +742,7 @@ export class SenderKeyManager {
|
|
|
640
742
|
async rotateSenderKey(groupId, userId, deviceId) {
|
|
641
743
|
// Get old sender key state
|
|
642
744
|
const oldState = await this.storage.getSenderKey(groupId, userId, deviceId);
|
|
643
|
-
|
|
644
|
-
const senderKeyId = `${groupId}:${userId}:${deviceId}:${Date.now()}`;
|
|
745
|
+
const senderKeyId = await crypto.generateUuidV4();
|
|
645
746
|
const chainId = this.generateChainId(senderKeyId);
|
|
646
747
|
// Generate new key material
|
|
647
748
|
const chainKey = await crypto.generateRandomBytes(32);
|