@open-e2ee/signal-protocol-sdk 11.0.0 → 12.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ADAPTERS.md +4 -4
- package/ARCHITECTURE.md +6 -8
- package/CHANGELOG.md +1348 -0
- package/README.md +1 -1
- package/SECURITY.md +2 -2
- package/TROUBLESHOOTING.md +8 -8
- package/client/README.md +70 -37
- package/device/README.md +39 -85
- package/dist/client/client.d.ts +334 -63
- package/dist/client/client.d.ts.map +1 -1
- package/dist/client/client.js +1175 -186
- package/dist/client/client.js.map +1 -1
- package/dist/client/config.d.ts +57 -42
- package/dist/client/config.d.ts.map +1 -1
- package/dist/client/config.js +1 -1
- package/dist/client/config.js.map +1 -1
- package/dist/client/constants.d.ts +42 -8
- package/dist/client/constants.d.ts.map +1 -1
- package/dist/client/constants.js +48 -3
- package/dist/client/constants.js.map +1 -1
- package/dist/client/content-adapter.d.ts +80 -0
- package/dist/client/content-adapter.d.ts.map +1 -1
- package/dist/client/content-adapter.js +225 -12
- package/dist/client/content-adapter.js.map +1 -1
- package/dist/client/delivery-error.d.ts +150 -0
- package/dist/client/delivery-error.d.ts.map +1 -0
- package/dist/client/delivery-error.js +226 -0
- package/dist/client/delivery-error.js.map +1 -0
- package/dist/client/delivery-status.d.ts +32 -6
- package/dist/client/delivery-status.d.ts.map +1 -1
- package/dist/client/delivery-status.js +61 -13
- package/dist/client/delivery-status.js.map +1 -1
- package/dist/client/device-set-reconciliation.d.ts +196 -0
- package/dist/client/device-set-reconciliation.d.ts.map +1 -0
- package/dist/client/device-set-reconciliation.js +282 -0
- package/dist/client/device-set-reconciliation.js.map +1 -0
- package/dist/client/distribution-records.d.ts +29 -0
- package/dist/client/distribution-records.d.ts.map +1 -0
- package/dist/client/distribution-records.js +33 -0
- package/dist/client/distribution-records.js.map +1 -0
- package/dist/client/event-hooks.d.ts +280 -14
- package/dist/client/event-hooks.d.ts.map +1 -1
- package/dist/client/event-hooks.js +8 -0
- package/dist/client/event-hooks.js.map +1 -1
- package/dist/client/group-device-set.d.ts +47 -0
- package/dist/client/group-device-set.d.ts.map +1 -0
- package/dist/client/group-device-set.js +65 -0
- package/dist/client/group-device-set.js.map +1 -0
- package/dist/client/group-fetcher.d.ts +116 -0
- package/dist/client/group-fetcher.d.ts.map +1 -0
- package/dist/client/group-fetcher.js +598 -0
- package/dist/client/group-fetcher.js.map +1 -0
- package/dist/client/group-outbox.d.ts +172 -10
- package/dist/client/group-outbox.d.ts.map +1 -1
- package/dist/client/group-outbox.js +915 -74
- package/dist/client/group-outbox.js.map +1 -1
- package/dist/client/group-receive-authorization.d.ts +127 -4
- package/dist/client/group-receive-authorization.d.ts.map +1 -1
- package/dist/client/group-receive-authorization.js +270 -20
- package/dist/client/group-receive-authorization.js.map +1 -1
- package/dist/client/group-sealed-sender.d.ts +3 -0
- package/dist/client/group-sealed-sender.d.ts.map +1 -1
- package/dist/client/group-sealed-sender.js +1 -0
- package/dist/client/group-sealed-sender.js.map +1 -1
- package/dist/client/group-sender-key-operations.d.ts +14 -3
- package/dist/client/group-sender-key-operations.d.ts.map +1 -1
- package/dist/client/group-sender-key-operations.js +26 -5
- package/dist/client/group-sender-key-operations.js.map +1 -1
- package/dist/client/groups.d.ts +5 -5
- package/dist/client/groups.d.ts.map +1 -1
- package/dist/client/groups.js +5 -4
- package/dist/client/groups.js.map +1 -1
- package/dist/client/hosted-anonymous-delivery.d.ts +61 -9
- package/dist/client/hosted-anonymous-delivery.d.ts.map +1 -1
- package/dist/client/hosted-anonymous-delivery.js +242 -48
- package/dist/client/hosted-anonymous-delivery.js.map +1 -1
- package/dist/client/hosted-assertion-id.d.ts +7 -0
- package/dist/client/hosted-assertion-id.d.ts.map +1 -0
- package/dist/client/hosted-assertion-id.js +51 -0
- package/dist/client/hosted-assertion-id.js.map +1 -0
- package/dist/client/hosted-mailbox-subscription.d.ts +34 -2
- package/dist/client/hosted-mailbox-subscription.d.ts.map +1 -1
- package/dist/client/hosted-mailbox-subscription.js +87 -17
- package/dist/client/hosted-mailbox-subscription.js.map +1 -1
- package/dist/client/hosted-push.d.ts +22 -4
- package/dist/client/hosted-push.d.ts.map +1 -1
- package/dist/client/hosted-push.js +75 -22
- package/dist/client/hosted-push.js.map +1 -1
- package/dist/client/hosted-transport.d.ts +22 -28
- package/dist/client/hosted-transport.d.ts.map +1 -1
- package/dist/client/hosted-transport.js +115 -55
- package/dist/client/hosted-transport.js.map +1 -1
- package/dist/client/hosted.d.ts +10 -4
- package/dist/client/hosted.d.ts.map +1 -1
- package/dist/client/hosted.js +10 -4
- package/dist/client/hosted.js.map +1 -1
- package/dist/client/index.d.ts +5 -3
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +2 -0
- package/dist/client/index.js.map +1 -1
- package/dist/client/messages.d.ts +25 -3
- package/dist/client/messages.d.ts.map +1 -1
- package/dist/client/messages.js +111 -20
- package/dist/client/messages.js.map +1 -1
- package/dist/client/receive-admission.d.ts +58 -0
- package/dist/client/receive-admission.d.ts.map +1 -0
- package/dist/client/receive-admission.js +78 -0
- package/dist/client/receive-admission.js.map +1 -0
- package/dist/client/receive-expiry.d.ts +31 -0
- package/dist/client/receive-expiry.d.ts.map +1 -0
- package/dist/client/receive-expiry.js +35 -0
- package/dist/client/receive-expiry.js.map +1 -0
- package/dist/client/receive-hook-bound.d.ts +50 -0
- package/dist/client/receive-hook-bound.d.ts.map +1 -0
- package/dist/client/receive-hook-bound.js +115 -0
- package/dist/client/receive-hook-bound.js.map +1 -0
- package/dist/client/receive-queue.d.ts +299 -0
- package/dist/client/receive-queue.d.ts.map +1 -0
- package/dist/client/receive-queue.js +1420 -0
- package/dist/client/receive-queue.js.map +1 -0
- package/dist/client/receive-work-seed.d.ts +54 -0
- package/dist/client/receive-work-seed.d.ts.map +1 -0
- package/dist/client/receive-work-seed.js +116 -0
- package/dist/client/receive-work-seed.js.map +1 -0
- package/dist/client/recovery-driver.d.ts +25 -0
- package/dist/client/recovery-driver.d.ts.map +1 -0
- package/dist/client/recovery-driver.js +121 -0
- package/dist/client/recovery-driver.js.map +1 -0
- package/dist/client/relay-acceptance.d.ts +20 -7
- package/dist/client/relay-acceptance.d.ts.map +1 -1
- package/dist/client/relay-acceptance.js +30 -12
- package/dist/client/relay-acceptance.js.map +1 -1
- package/dist/client/relay-device-refusal.d.ts +18 -0
- package/dist/client/relay-device-refusal.d.ts.map +1 -1
- package/dist/client/relay-device-refusal.js +31 -0
- package/dist/client/relay-device-refusal.js.map +1 -1
- package/dist/client/relay-sealed-route.d.ts +36 -0
- package/dist/client/relay-sealed-route.d.ts.map +1 -0
- package/dist/client/relay-sealed-route.js +45 -0
- package/dist/client/relay-sealed-route.js.map +1 -0
- package/dist/client/relay-subscription.d.ts +56 -13
- package/dist/client/relay-subscription.d.ts.map +1 -1
- package/dist/client/relay-subscription.js +193 -123
- package/dist/client/relay-subscription.js.map +1 -1
- package/dist/client/resendable-content.d.ts +98 -0
- package/dist/client/resendable-content.d.ts.map +1 -0
- package/dist/client/resendable-content.js +136 -0
- package/dist/client/resendable-content.js.map +1 -0
- package/dist/client/retry-family.d.ts +57 -10
- package/dist/client/retry-family.d.ts.map +1 -1
- package/dist/client/retry-family.js +54 -12
- package/dist/client/retry-family.js.map +1 -1
- package/dist/client/retry-request-envelope.d.ts +107 -8
- package/dist/client/retry-request-envelope.d.ts.map +1 -1
- package/dist/client/retry-request-envelope.js +172 -23
- package/dist/client/retry-request-envelope.js.map +1 -1
- package/dist/client/retry-request-lifecycle.d.ts +70 -14
- package/dist/client/retry-request-lifecycle.d.ts.map +1 -1
- package/dist/client/retry-request-lifecycle.js +162 -32
- package/dist/client/retry-request-lifecycle.js.map +1 -1
- package/dist/client/retry-terminal-recovery.d.ts +100 -0
- package/dist/client/retry-terminal-recovery.d.ts.map +1 -0
- package/dist/client/retry-terminal-recovery.js +164 -0
- package/dist/client/retry-terminal-recovery.js.map +1 -0
- package/dist/client/retry-utils.d.ts +27 -0
- package/dist/client/retry-utils.d.ts.map +1 -1
- package/dist/client/retry-utils.js +46 -0
- package/dist/client/retry-utils.js.map +1 -1
- package/dist/client/retry.d.ts +100 -12
- package/dist/client/retry.d.ts.map +1 -1
- package/dist/client/retry.js +619 -116
- package/dist/client/retry.js.map +1 -1
- package/dist/client/sealed-sender.d.ts +23 -6
- package/dist/client/sealed-sender.d.ts.map +1 -1
- package/dist/client/sealed-sender.js +30 -6
- package/dist/client/sealed-sender.js.map +1 -1
- package/dist/client/sessions.d.ts +2 -2
- package/dist/client/sessions.js +2 -2
- package/dist/client/signal-service-cipher.d.ts +726 -19
- package/dist/client/signal-service-cipher.d.ts.map +1 -1
- package/dist/client/signal-service-cipher.js +2260 -342
- package/dist/client/signal-service-cipher.js.map +1 -1
- package/dist/client/state.d.ts +5 -0
- package/dist/client/state.d.ts.map +1 -1
- package/dist/client/state.js +11 -1
- package/dist/client/state.js.map +1 -1
- package/dist/client/storage-protection.d.ts +64 -0
- package/dist/client/storage-protection.d.ts.map +1 -0
- package/dist/client/storage-protection.js +150 -0
- package/dist/client/storage-protection.js.map +1 -0
- package/dist/client/types.d.ts +149 -15
- package/dist/client/types.d.ts.map +1 -1
- package/dist/client/types.js +1 -1
- package/dist/client/types.js.map +1 -1
- package/dist/device/constants.d.ts +0 -5
- package/dist/device/constants.d.ts.map +1 -1
- package/dist/device/constants.js +0 -5
- package/dist/device/constants.js.map +1 -1
- package/dist/device/expo/index.d.ts +4 -17
- package/dist/device/expo/index.d.ts.map +1 -1
- package/dist/device/expo/index.js +4 -23
- package/dist/device/expo/index.js.map +1 -1
- package/dist/device/index.d.ts +0 -2
- package/dist/device/index.d.ts.map +1 -1
- package/dist/device/index.js +0 -7
- package/dist/device/index.js.map +1 -1
- package/dist/device/lifecycle/manager.d.ts +5 -4
- package/dist/device/lifecycle/manager.d.ts.map +1 -1
- package/dist/device/lifecycle/manager.js +16 -16
- package/dist/device/lifecycle/manager.js.map +1 -1
- package/dist/device/lifecycle/types.d.ts +2 -2
- package/dist/device/lifecycle/types.d.ts.map +1 -1
- package/dist/device/react-native/index.d.ts +4 -15
- package/dist/device/react-native/index.d.ts.map +1 -1
- package/dist/device/react-native/index.js +4 -21
- package/dist/device/react-native/index.js.map +1 -1
- package/dist/device/types.d.ts +1 -1
- package/dist/groups/index.d.ts +1 -1
- package/dist/groups/index.d.ts.map +1 -1
- package/dist/index.d.ts +8 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/internal/crypto/ec/x25519-validation.d.ts +0 -1
- package/dist/internal/crypto/ec/x25519-validation.d.ts.map +1 -1
- package/dist/internal/crypto/ec/x25519-validation.js +0 -1
- package/dist/internal/crypto/ec/x25519-validation.js.map +1 -1
- package/dist/internal/crypto/validation.d.ts +2 -2
- package/dist/internal/groups/index.d.ts +1 -0
- package/dist/internal/groups/index.d.ts.map +1 -1
- package/dist/internal/groups/index.js +1 -0
- package/dist/internal/groups/index.js.map +1 -1
- package/dist/internal/groups/manager.d.ts +37 -16
- package/dist/internal/groups/manager.d.ts.map +1 -1
- package/dist/internal/groups/manager.js +46 -1
- package/dist/internal/groups/manager.js.map +1 -1
- package/dist/internal/groups/receive-record.d.ts +78 -0
- package/dist/internal/groups/receive-record.d.ts.map +1 -0
- package/dist/internal/groups/receive-record.js +43 -0
- package/dist/internal/groups/receive-record.js.map +1 -0
- package/dist/internal/groups/sdk-store.d.ts +27 -3
- package/dist/internal/groups/sdk-store.d.ts.map +1 -1
- package/dist/internal/groups/sdk-store.js +151 -19
- package/dist/internal/groups/sdk-store.js.map +1 -1
- package/dist/internal/groups/wire.d.ts +12 -1
- package/dist/internal/groups/wire.d.ts.map +1 -1
- package/dist/internal/groups/wire.js +36 -0
- package/dist/internal/groups/wire.js.map +1 -1
- package/dist/internal/manager/index.d.ts +1 -1
- package/dist/internal/manager/manager.d.ts +26 -20
- package/dist/internal/manager/manager.d.ts.map +1 -1
- package/dist/internal/manager/manager.js +64 -41
- package/dist/internal/manager/manager.js.map +1 -1
- package/dist/internal/protocol/double-ratchet/chains.d.ts +4 -18
- package/dist/internal/protocol/double-ratchet/chains.d.ts.map +1 -1
- package/dist/internal/protocol/double-ratchet/chains.js +23 -74
- package/dist/internal/protocol/double-ratchet/chains.js.map +1 -1
- package/dist/internal/protocol/double-ratchet/index.d.ts +1 -1
- package/dist/internal/protocol/double-ratchet/index.d.ts.map +1 -1
- package/dist/internal/protocol/double-ratchet/index.js +1 -1
- package/dist/internal/protocol/double-ratchet/index.js.map +1 -1
- package/dist/internal/protocol/double-ratchet/ratchet.d.ts +5 -7
- package/dist/internal/protocol/double-ratchet/ratchet.d.ts.map +1 -1
- package/dist/internal/protocol/double-ratchet/ratchet.js +4 -6
- package/dist/internal/protocol/double-ratchet/ratchet.js.map +1 -1
- package/dist/internal/protocol/pqxdh/pqxdh.d.ts.map +1 -1
- package/dist/internal/protocol/pqxdh/pqxdh.js +2 -1
- package/dist/internal/protocol/pqxdh/pqxdh.js.map +1 -1
- package/dist/internal/protocol/sealed-sender/types.d.ts +6 -8
- package/dist/internal/protocol/sealed-sender/types.d.ts.map +1 -1
- package/dist/internal/protocol/sealed-sender/types.js +8 -9
- package/dist/internal/protocol/sealed-sender/types.js.map +1 -1
- package/dist/internal/protocol/sender-keys/handoff-ledger.d.ts +110 -0
- package/dist/internal/protocol/sender-keys/handoff-ledger.d.ts.map +1 -0
- package/dist/internal/protocol/sender-keys/handoff-ledger.js +124 -0
- package/dist/internal/protocol/sender-keys/handoff-ledger.js.map +1 -0
- package/dist/internal/protocol/sender-keys/manager.d.ts +71 -62
- package/dist/internal/protocol/sender-keys/manager.d.ts.map +1 -1
- package/dist/internal/protocol/sender-keys/manager.js +228 -175
- package/dist/internal/protocol/sender-keys/manager.js.map +1 -1
- package/dist/internal/protocol/spqr/index.d.ts +2 -2
- package/dist/internal/protocol/spqr/index.d.ts.map +1 -1
- package/dist/internal/protocol/spqr/index.js +2 -2
- package/dist/internal/protocol/spqr/index.js.map +1 -1
- package/dist/internal/protocol/spqr/serialize.d.ts +9 -1
- package/dist/internal/protocol/spqr/serialize.d.ts.map +1 -1
- package/dist/internal/protocol/spqr/serialize.js +56 -16
- package/dist/internal/protocol/spqr/serialize.js.map +1 -1
- package/dist/internal/protocol/spqr/spqr.d.ts +1 -14
- package/dist/internal/protocol/spqr/spqr.d.ts.map +1 -1
- package/dist/internal/protocol/spqr/spqr.js +54 -42
- package/dist/internal/protocol/spqr/spqr.js.map +1 -1
- package/dist/internal/protocol/spqr/validate.d.ts +26 -6
- package/dist/internal/protocol/spqr/validate.d.ts.map +1 -1
- package/dist/internal/protocol/spqr/validate.js +49 -21
- package/dist/internal/protocol/spqr/validate.js.map +1 -1
- package/dist/internal/sesame/index.d.ts +1 -1
- package/dist/internal/sesame/index.d.ts.map +1 -1
- package/dist/internal/sesame/index.js.map +1 -1
- package/dist/internal/sesame/manager.d.ts +66 -13
- package/dist/internal/sesame/manager.d.ts.map +1 -1
- package/dist/internal/sesame/manager.js +221 -87
- package/dist/internal/sesame/manager.js.map +1 -1
- package/dist/internal/sesame/types.d.ts +95 -17
- package/dist/internal/sesame/types.d.ts.map +1 -1
- package/dist/internal/sesame/types.js +17 -0
- package/dist/internal/sesame/types.js.map +1 -1
- package/dist/internal/session/builder.d.ts +5 -5
- package/dist/internal/session/builder.d.ts.map +1 -1
- package/dist/internal/session/builder.js +12 -17
- package/dist/internal/session/builder.js.map +1 -1
- package/dist/internal/session/cipher.d.ts +15 -13
- package/dist/internal/session/cipher.d.ts.map +1 -1
- package/dist/internal/session/cipher.js +41 -23
- package/dist/internal/session/cipher.js.map +1 -1
- package/dist/internal/session/factory.d.ts +5 -5
- package/dist/internal/session/factory.d.ts.map +1 -1
- package/dist/internal/session/factory.js +4 -4
- package/dist/internal/session/factory.js.map +1 -1
- package/dist/internal/session/handshake.d.ts +14 -16
- package/dist/internal/session/handshake.d.ts.map +1 -1
- package/dist/internal/session/handshake.js +18 -75
- package/dist/internal/session/handshake.js.map +1 -1
- package/dist/internal/session/index.d.ts +1 -1
- package/dist/internal/session/index.js +1 -1
- package/dist/internal/session/record-locks.d.ts +17 -6
- package/dist/internal/session/record-locks.d.ts.map +1 -1
- package/dist/internal/session/record-locks.js +43 -7
- package/dist/internal/session/record-locks.js.map +1 -1
- package/dist/internal/session/session-resolver.d.ts +1 -1
- package/dist/internal/session/session-resolver.js +1 -1
- package/dist/internal/session/state.d.ts +2 -2
- package/dist/internal/session/state.js +1 -1
- package/dist/internal/session/types.d.ts +5 -13
- package/dist/internal/session/types.d.ts.map +1 -1
- package/dist/internal/session/types.js +1 -1
- package/dist/keys/generation.d.ts +2 -2
- package/dist/keys/generation.js +2 -2
- package/dist/keys/types.d.ts +5 -5
- package/dist/keys/types.d.ts.map +1 -1
- package/dist/keys/types.js +1 -1
- package/dist/layers.d.ts +1 -1
- package/dist/layers.js +2 -2
- package/dist/layers.js.map +1 -1
- package/dist/local/store/expo/adapter.d.ts.map +1 -1
- package/dist/local/store/expo/adapter.js +12 -8
- package/dist/local/store/expo/adapter.js.map +1 -1
- package/dist/local/store/key-value/adapter.d.ts +76 -10
- package/dist/local/store/key-value/adapter.d.ts.map +1 -1
- package/dist/local/store/key-value/adapter.js +367 -61
- package/dist/local/store/key-value/adapter.js.map +1 -1
- package/dist/local/store/key-value/backend-conformance.d.ts.map +1 -1
- package/dist/local/store/key-value/backend-conformance.js +74 -0
- package/dist/local/store/key-value/backend-conformance.js.map +1 -1
- package/dist/local/store/key-value/batch.d.ts +2 -0
- package/dist/local/store/key-value/batch.d.ts.map +1 -1
- package/dist/local/store/key-value/batch.js +26 -0
- package/dist/local/store/key-value/batch.js.map +1 -1
- package/dist/local/store/key-value/receive-work.d.ts +55 -0
- package/dist/local/store/key-value/receive-work.d.ts.map +1 -0
- package/dist/local/store/key-value/receive-work.js +162 -0
- package/dist/local/store/key-value/receive-work.js.map +1 -0
- package/dist/local/store/key-value/send-log.d.ts +61 -0
- package/dist/local/store/key-value/send-log.d.ts.map +1 -0
- package/dist/local/store/key-value/send-log.js +430 -0
- package/dist/local/store/key-value/send-log.js.map +1 -0
- package/dist/local/store/key-value/sender-key-handoff.d.ts +68 -0
- package/dist/local/store/key-value/sender-key-handoff.d.ts.map +1 -0
- package/dist/local/store/key-value/sender-key-handoff.js +189 -0
- package/dist/local/store/key-value/sender-key-handoff.js.map +1 -0
- package/dist/local/store/key-value/storage.d.ts +15 -0
- package/dist/local/store/key-value/storage.d.ts.map +1 -1
- package/dist/local/store/keyed-index.d.ts +23 -0
- package/dist/local/store/keyed-index.d.ts.map +1 -0
- package/dist/local/store/keyed-index.js +41 -0
- package/dist/local/store/keyed-index.js.map +1 -0
- package/dist/local/store/memory/adapter.d.ts +44 -12
- package/dist/local/store/memory/adapter.d.ts.map +1 -1
- package/dist/local/store/memory/adapter.js +197 -46
- package/dist/local/store/memory/adapter.js.map +1 -1
- package/dist/local/store/memory/send-log.d.ts +42 -0
- package/dist/local/store/memory/send-log.d.ts.map +1 -0
- package/dist/local/store/memory/send-log.js +190 -0
- package/dist/local/store/memory/send-log.js.map +1 -0
- package/dist/local/store/node/adapter.d.ts.map +1 -1
- package/dist/local/store/node/adapter.js +8 -6
- package/dist/local/store/node/adapter.js.map +1 -1
- package/dist/local/store/react-native/adapter.d.ts.map +1 -1
- package/dist/local/store/react-native/adapter.js +12 -8
- package/dist/local/store/react-native/adapter.js.map +1 -1
- package/dist/local/store/receive-work.d.ts +87 -0
- package/dist/local/store/receive-work.d.ts.map +1 -0
- package/dist/local/store/receive-work.js +204 -0
- package/dist/local/store/receive-work.js.map +1 -0
- package/dist/local/store/received-content.d.ts +3 -3
- package/dist/local/store/received-content.d.ts.map +1 -1
- package/dist/local/store/received-content.js +2 -11
- package/dist/local/store/received-content.js.map +1 -1
- package/dist/local/store/reliability.d.ts +317 -18
- package/dist/local/store/reliability.d.ts.map +1 -1
- package/dist/local/store/reliability.js +371 -46
- package/dist/local/store/reliability.js.map +1 -1
- package/dist/local/store/send-log-order.d.ts +15 -0
- package/dist/local/store/send-log-order.d.ts.map +1 -0
- package/dist/local/store/send-log-order.js +24 -0
- package/dist/local/store/send-log-order.js.map +1 -0
- package/dist/local/store/sender-key-handoff-index.d.ts +38 -0
- package/dist/local/store/sender-key-handoff-index.d.ts.map +1 -0
- package/dist/local/store/sender-key-handoff-index.js +101 -0
- package/dist/local/store/sender-key-handoff-index.js.map +1 -0
- package/dist/local/store/sender-key-handoff-table.d.ts +29 -0
- package/dist/local/store/sender-key-handoff-table.d.ts.map +1 -0
- package/dist/local/store/sender-key-handoff-table.js +97 -0
- package/dist/local/store/sender-key-handoff-table.js.map +1 -0
- package/dist/local/store/sqlite/driver.d.ts +9 -0
- package/dist/local/store/sqlite/driver.d.ts.map +1 -1
- package/dist/local/store/sqlite/encryption.d.ts +8 -1
- package/dist/local/store/sqlite/encryption.d.ts.map +1 -1
- package/dist/local/store/sqlite/encryption.js +9 -0
- package/dist/local/store/sqlite/encryption.js.map +1 -1
- package/dist/local/store/sqlite/key-storage/index.d.ts +25 -4
- package/dist/local/store/sqlite/key-storage/index.d.ts.map +1 -1
- package/dist/local/store/sqlite/key-storage/index.js +68 -7
- package/dist/local/store/sqlite/key-storage/index.js.map +1 -1
- package/dist/local/store/sqlite/key-storage/message-records.d.ts +16 -4
- package/dist/local/store/sqlite/key-storage/message-records.d.ts.map +1 -1
- package/dist/local/store/sqlite/key-storage/message-records.js +49 -6
- package/dist/local/store/sqlite/key-storage/message-records.js.map +1 -1
- package/dist/local/store/sqlite/key-storage/metadata.d.ts +8 -7
- package/dist/local/store/sqlite/key-storage/metadata.d.ts.map +1 -1
- package/dist/local/store/sqlite/key-storage/metadata.js +17 -15
- package/dist/local/store/sqlite/key-storage/metadata.js.map +1 -1
- package/dist/local/store/sqlite/key-storage/receive-work.d.ts +27 -0
- package/dist/local/store/sqlite/key-storage/receive-work.d.ts.map +1 -0
- package/dist/local/store/sqlite/key-storage/receive-work.js +98 -0
- package/dist/local/store/sqlite/key-storage/receive-work.js.map +1 -0
- package/dist/local/store/sqlite/key-storage/send-log.d.ts +27 -0
- package/dist/local/store/sqlite/key-storage/send-log.d.ts.map +1 -0
- package/dist/local/store/sqlite/key-storage/send-log.js +178 -0
- package/dist/local/store/sqlite/key-storage/send-log.js.map +1 -0
- package/dist/local/store/sqlite/key-storage/sender-key-handoff.d.ts +27 -0
- package/dist/local/store/sqlite/key-storage/sender-key-handoff.d.ts.map +1 -0
- package/dist/local/store/sqlite/key-storage/sender-key-handoff.js +75 -0
- package/dist/local/store/sqlite/key-storage/sender-key-handoff.js.map +1 -0
- package/dist/local/store/sqlite/key-storage/session-trust.d.ts +2 -2
- package/dist/local/store/sqlite/key-storage/session-trust.js +5 -5
- package/dist/local/store/sqlite/key-storage/session-trust.js.map +1 -1
- package/dist/local/store/sqlite/migrations.d.ts.map +1 -1
- package/dist/local/store/sqlite/migrations.js +101 -0
- package/dist/local/store/sqlite/migrations.js.map +1 -1
- package/dist/local/store/sqlite/models/index.d.ts +2 -1
- package/dist/local/store/sqlite/models/index.d.ts.map +1 -1
- package/dist/local/store/sqlite/models/index.js +5 -1
- package/dist/local/store/sqlite/models/index.js.map +1 -1
- package/dist/local/store/sqlite/models/message-record.d.ts +15 -0
- package/dist/local/store/sqlite/models/message-record.d.ts.map +1 -1
- package/dist/local/store/sqlite/models/message-record.js +24 -0
- package/dist/local/store/sqlite/models/message-record.js.map +1 -1
- package/dist/local/store/sqlite/models/send-log.d.ts +51 -0
- package/dist/local/store/sqlite/models/send-log.d.ts.map +1 -0
- package/dist/local/store/sqlite/models/send-log.js +206 -0
- package/dist/local/store/sqlite/models/send-log.js.map +1 -0
- package/dist/local/store/sqlite/open-store.d.ts +9 -1
- package/dist/local/store/sqlite/open-store.d.ts.map +1 -1
- package/dist/local/store/sqlite/open-store.js +20 -1
- package/dist/local/store/sqlite/open-store.js.map +1 -1
- package/dist/local/store/sqlite/schema.d.ts +34 -1
- package/dist/local/store/sqlite/schema.d.ts.map +1 -1
- package/dist/local/store/sqlite/schema.js +14 -0
- package/dist/local/store/sqlite/schema.js.map +1 -1
- package/dist/local/store/sqlite/store.d.ts +61 -11
- package/dist/local/store/sqlite/store.d.ts.map +1 -1
- package/dist/local/store/sqlite/store.js +191 -27
- package/dist/local/store/sqlite/store.js.map +1 -1
- package/dist/local/store/sqlite/web/sqlite3mc/sqlite3.mjs +2 -1
- package/dist/local/store/sqlite/web/worker.d.ts +8 -0
- package/dist/local/store/sqlite/web/worker.d.ts.map +1 -1
- package/dist/local/store/sqlite/web/worker.js +64 -2
- package/dist/local/store/sqlite/web/worker.js.map +1 -1
- package/dist/local/store/web/adapter.d.ts +76 -8
- package/dist/local/store/web/adapter.d.ts.map +1 -1
- package/dist/local/store/web/adapter.js +579 -127
- package/dist/local/store/web/adapter.js.map +1 -1
- package/dist/local/store/web/receive-work.d.ts +57 -0
- package/dist/local/store/web/receive-work.d.ts.map +1 -0
- package/dist/local/store/web/receive-work.js +99 -0
- package/dist/local/store/web/receive-work.js.map +1 -0
- package/dist/local/store/web/send-log.d.ts +92 -0
- package/dist/local/store/web/send-log.d.ts.map +1 -0
- package/dist/local/store/web/send-log.js +267 -0
- package/dist/local/store/web/send-log.js.map +1 -0
- package/dist/local/store/web/sender-key-handoff.d.ts +81 -0
- package/dist/local/store/web/sender-key-handoff.d.ts.map +1 -0
- package/dist/local/store/web/sender-key-handoff.js +156 -0
- package/dist/local/store/web/sender-key-handoff.js.map +1 -0
- package/dist/local/store/web-sqlite/adapter.d.ts +2 -0
- package/dist/local/store/web-sqlite/adapter.d.ts.map +1 -1
- package/dist/local/store/web-sqlite/adapter.js +12 -6
- package/dist/local/store/web-sqlite/adapter.js.map +1 -1
- package/dist/local/vault/custody.d.ts +8 -0
- package/dist/local/vault/custody.d.ts.map +1 -0
- package/dist/local/vault/custody.js +9 -0
- package/dist/local/vault/custody.js.map +1 -0
- package/dist/local/vault/electron-safe-storage.d.ts +3 -1
- package/dist/local/vault/electron-safe-storage.d.ts.map +1 -1
- package/dist/local/vault/electron-safe-storage.js +2 -0
- package/dist/local/vault/electron-safe-storage.js.map +1 -1
- package/dist/local/vault/expo-secure-store.d.ts +3 -1
- package/dist/local/vault/expo-secure-store.d.ts.map +1 -1
- package/dist/local/vault/expo-secure-store.js +2 -0
- package/dist/local/vault/expo-secure-store.js.map +1 -1
- package/dist/local/vault/indexed-db.d.ts +3 -1
- package/dist/local/vault/indexed-db.d.ts.map +1 -1
- package/dist/local/vault/indexed-db.js +2 -0
- package/dist/local/vault/indexed-db.js.map +1 -1
- package/dist/local/vault/react-native-keychain.d.ts +3 -1
- package/dist/local/vault/react-native-keychain.d.ts.map +1 -1
- package/dist/local/vault/react-native-keychain.js +2 -0
- package/dist/local/vault/react-native-keychain.js.map +1 -1
- package/dist/remote/relay/device-set.d.ts +94 -0
- package/dist/remote/relay/device-set.d.ts.map +1 -0
- package/dist/remote/relay/device-set.js +156 -0
- package/dist/remote/relay/device-set.js.map +1 -0
- package/dist/remote/relay/types.d.ts +92 -107
- package/dist/remote/relay/types.d.ts.map +1 -1
- package/dist/safety/core.d.ts +15 -6
- package/dist/safety/core.d.ts.map +1 -1
- package/dist/safety/core.js +41 -27
- package/dist/safety/core.js.map +1 -1
- package/dist/safety/index.d.ts +2 -1
- package/dist/safety/index.d.ts.map +1 -1
- package/dist/safety/index.js +12 -18
- package/dist/safety/index.js.map +1 -1
- package/dist/types/api.d.ts +707 -62
- package/dist/types/api.d.ts.map +1 -1
- package/dist/types/errors.d.ts +14 -33
- package/dist/types/errors.d.ts.map +1 -1
- package/dist/types/errors.js +14 -24
- package/dist/types/errors.js.map +1 -1
- package/dist/types/messages.d.ts +2 -2
- package/dist/types/messages.js +1 -1
- package/dist/types/protocol-config.d.ts +175 -42
- package/dist/types/protocol-config.d.ts.map +1 -1
- package/dist/types/protocol-config.js +19 -38
- package/dist/types/protocol-config.js.map +1 -1
- package/dist/types/protocol-constants.d.ts +6 -6
- package/dist/types/protocol-constants.js +6 -6
- package/dist/types/session.d.ts +7 -7
- package/dist/types/session.d.ts.map +1 -1
- package/dist/types/session.js +39 -21
- package/dist/types/session.js.map +1 -1
- package/dist/username/link.d.ts +2 -2
- package/dist/username/link.js +2 -2
- package/dist/utils/origin-lock.d.ts +45 -0
- package/dist/utils/origin-lock.d.ts.map +1 -0
- package/dist/utils/origin-lock.js +80 -0
- package/dist/utils/origin-lock.js.map +1 -0
- package/docs/ASSURANCE.md +6 -6
- package/docs/CLIENT_COMPOSITION.md +2 -2
- package/docs/DEVIATIONS.md +677 -182
- package/docs/E2EE.md +1 -1
- package/docs/ERROR_HANDLING.md +165 -2
- package/docs/GETTING_STARTED.md +7 -4
- package/docs/INTERFACES.md +1 -1
- package/docs/PACKAGE_SURFACE.md +6 -5
- package/docs/PROTOCOL_POLICY.md +102 -22
- package/docs/RECIPES.md +3 -15
- package/docs/SECURITY.md +90 -5
- package/keys/README.md +3 -3
- package/local/store/README.md +78 -14
- package/local/store/key-value/README.md +14 -3
- package/local/store/node/README.md +8 -3
- package/local/store/web/README.md +9 -0
- package/local/store/web-sqlite/README.md +14 -2
- package/local/vault/README.md +21 -0
- package/package.json +1 -6
- package/remote/README.md +0 -1
- package/remote/relay/README.md +2 -2
- package/dist/device/provisioning.d.ts +0 -242
- package/dist/device/provisioning.d.ts.map +0 -1
- package/dist/device/provisioning.js +0 -421
- package/dist/device/provisioning.js.map +0 -1
- package/dist/internal/protocol/x3dh/index.d.ts +0 -15
- package/dist/internal/protocol/x3dh/index.d.ts.map +0 -1
- package/dist/internal/protocol/x3dh/index.js +0 -13
- package/dist/internal/protocol/x3dh/index.js.map +0 -1
- package/dist/internal/protocol/x3dh/x3dh.d.ts +0 -131
- package/dist/internal/protocol/x3dh/x3dh.d.ts.map +0 -1
- package/dist/internal/protocol/x3dh/x3dh.js +0 -261
- package/dist/internal/protocol/x3dh/x3dh.js.map +0 -1
package/README.md
CHANGED
|
@@ -39,7 +39,7 @@ The relay never needs message plaintext or device private keys.
|
|
|
39
39
|
|
|
40
40
|
The OpenE2EE Signal Protocol SDK implements a versioned profile of the published Signal Protocol specifications. It is not affiliated with Signal Messenger and is **not wire-compatible with Signal Messenger or libsignal**. Messages, identities, and safety numbers do not interoperate. See the [notice](./NOTICE) and [documented deviations](./docs/DEVIATIONS.md).
|
|
41
41
|
|
|
42
|
-
Version `
|
|
42
|
+
Version `12.0.x`. Public APIs and persisted formats follow semantic versioning.
|
|
43
43
|
|
|
44
44
|
## Install
|
|
45
45
|
|
package/SECURITY.md
CHANGED
package/TROUBLESHOOTING.md
CHANGED
|
@@ -110,7 +110,7 @@ await signal.encryptMessage('bob:2', 'Hello'); // Secondary device
|
|
|
110
110
|
The protocol handles out-of-order messages automatically via MKSKIPPED. For failures:
|
|
111
111
|
|
|
112
112
|
1. Check that both parties established sessions
|
|
113
|
-
2. Verify message counters are not too far apart (maxSkip limit:
|
|
113
|
+
2. Verify message counters are not too far apart (default `maxSkip` limit: 25000)
|
|
114
114
|
3. Check that no sender or transport duplicates messages
|
|
115
115
|
4. Check that skipped keys did not expire (7-day default)
|
|
116
116
|
|
|
@@ -118,12 +118,12 @@ The protocol handles out-of-order messages automatically via MKSKIPPED. For fail
|
|
|
118
118
|
|
|
119
119
|
**"Failed to decrypt" or "MAC verification failed"**
|
|
120
120
|
|
|
121
|
-
| Symptom | Cause
|
|
122
|
-
| ----------- |
|
|
123
|
-
| MAC failed | Data corrupted
|
|
124
|
-
| Wrong key | Session mismatch
|
|
125
|
-
| Key expired | Message > 7 days old
|
|
126
|
-
| Counter gap | >
|
|
121
|
+
| Symptom | Cause | Solution |
|
|
122
|
+
| ----------- | ------------------------ | ------------------------------------------------ |
|
|
123
|
+
| MAC failed | Data corrupted | Check network, verify no modification in transit |
|
|
124
|
+
| Wrong key | Session mismatch | Verify sessionId matches sender |
|
|
125
|
+
| Key expired | Message > 7 days old | Cannot recover; re-send message |
|
|
126
|
+
| Counter gap | > 25000 messages skipped | Increase `maxSkip` or re-establish session |
|
|
127
127
|
|
|
128
128
|
---
|
|
129
129
|
|
|
@@ -178,7 +178,7 @@ await signal.confirmSafetyNumber(safetyNumber.confirmation);
|
|
|
178
178
|
| ------------------------- | ------------------- |
|
|
179
179
|
| Key generation | `internal/crypto/` |
|
|
180
180
|
| Key types, bundles | `keys/` |
|
|
181
|
-
| Key exchange (
|
|
181
|
+
| Key exchange (PQXDH) | `internal/protocol/` |
|
|
182
182
|
| Ratchet state | `internal/protocol/` |
|
|
183
183
|
| Session state | `internal/session/` |
|
|
184
184
|
| Multi-device | `internal/sesame/` |
|
package/client/README.md
CHANGED
|
@@ -93,18 +93,10 @@ await createSignalProtocolClient({
|
|
|
93
93
|
});
|
|
94
94
|
```
|
|
95
95
|
|
|
96
|
-
`postQuantum: 'required'` and `braid: 'required'` are the defaults.
|
|
97
|
-
`
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
<!-- doc-snippet:skip requires-external-context -->
|
|
101
|
-
```ts
|
|
102
|
-
await createSignalProtocolClient({
|
|
103
|
-
identity: { userId },
|
|
104
|
-
adapters: { storage, relay },
|
|
105
|
-
protocol: { postQuantum: 'compatible', braid: 'required' },
|
|
106
|
-
});
|
|
107
|
-
```
|
|
96
|
+
`postQuantum: 'required'` and `braid: 'required'` are the defaults.
|
|
97
|
+
`'required'` is the only `postQuantum` value. The SDK has no classical key
|
|
98
|
+
agreement, so a session with a peer that publishes no ML-KEM prekeys fails
|
|
99
|
+
with `PQXDHRequiredError` (`PQXDH_REQUIRED`).
|
|
108
100
|
|
|
109
101
|
Use direct SPQR only as an explicit product-reviewed escape hatch:
|
|
110
102
|
|
|
@@ -173,26 +165,57 @@ const rotation = await signal.rotatePreKeys();
|
|
|
173
165
|
|
|
174
166
|
Register `onMessageDecrypted` before calling `pullHostedRelayAfterWake()`.
|
|
175
167
|
The handler must persist application content before it resolves. Use the message
|
|
176
|
-
ID for idempotent application writes.
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
168
|
+
ID for idempotent application writes.
|
|
169
|
+
|
|
170
|
+
The hosted pull uses the same receive path as the foreground subscription. The
|
|
171
|
+
client decrypts each envelope and commits its content as a receive record with
|
|
172
|
+
the ratchet update or skipped-key consumption. It acknowledges the envelope only
|
|
173
|
+
after that commit. The receive queue then decides the group of the content,
|
|
174
|
+
gives the content to the handler, sends the E2EE delivery receipt, and deletes
|
|
175
|
+
the record. The E2EE receipt is the only proof that the application processed
|
|
176
|
+
the content. A Relay delivery receipt marks only the handoff to the device.
|
|
177
|
+
Content that waits for its group state stays on the device. A waiting record
|
|
178
|
+
holds back the later content of its conversation only. Group content waits by
|
|
179
|
+
its group, a sent transcript by its destination, and other content by its
|
|
180
|
+
sender account. A restart resumes the record with no sender retransmission. A
|
|
181
|
+
rejected handler runs again after a backoff. After 10 attempts, the record no
|
|
182
|
+
longer holds back the later content of its conversation. Each start then gives
|
|
183
|
+
it to the handler once, in the start pass or when `onMessageDecrypted` is
|
|
184
|
+
registered. After that, only `processPendingReceives` runs it again before the
|
|
185
|
+
next start. A pass that ends before the retry, at a deadline or at a failed
|
|
186
|
+
page read, leaves the retry to the next pass. That retry runs after the other
|
|
187
|
+
content of the pass, so a hook call that ends the process on it does not stop
|
|
188
|
+
the later content of its conversation. `listPendingReceives` gives the
|
|
189
|
+
`hookAttempts` of each record. `discardPendingReceive` removes a record that
|
|
190
|
+
the application cannot process, with no receipt, no handler call, and no
|
|
191
|
+
expiry report.
|
|
192
|
+
|
|
193
|
+
A receive pass waits for each hook for at most
|
|
194
|
+
`protocol.receiveQueue.receiveHookTimeoutMs`, 2 minutes by default. A timeout
|
|
195
|
+
of `onMessageDecrypted` counts as one failed attempt. A handler that settles
|
|
196
|
+
after the bound writes nothing. Content that waits
|
|
197
|
+
30 days on the device runs `onReceiveExpired`, and the client deletes its
|
|
198
|
+
record. The 30 days are fixed. Before the hook, the
|
|
199
|
+
client reads the record again. Content that the client completed before that
|
|
200
|
+
read, such as at the redelivery of its envelope, gets no expiry report. A
|
|
201
|
+
record that waits only for its E2EE delivery receipt completes 1 day after the
|
|
202
|
+
receipt becomes due, with no receipt and no expiry report.
|
|
203
|
+
|
|
204
|
+
At a receive queue bound, the client decrypts nothing more and does not
|
|
205
|
+
acknowledge the envelope, so the Relay keeps it. A refused envelope expires at
|
|
206
|
+
the Relay at the TTL of the Relay project, and no local hook reports that
|
|
207
|
+
expiry. While the mailbox of the device is full, the Relay refuses a new message
|
|
208
|
+
to it with `MAILBOX_FULL` to its sender. Refused envelopes do not stop the
|
|
209
|
+
messages behind them, on the socket or on an HTTP pull.
|
|
210
|
+
The client handles receipts and typing separately from application messages.
|
|
211
|
+
|
|
212
|
+
The handler can run again if its write succeeds but the record does not
|
|
213
|
+
complete. Use the message ID to prevent duplicate application records.
|
|
214
|
+
|
|
215
|
+
`processIncomingEnvelopes()` is the receive helper for an application that pulls
|
|
216
|
+
envelopes itself. It returns a receive outcome for each envelope and does not run
|
|
217
|
+
the application handler. A `processed` receive keeps its content until the
|
|
218
|
+
application calls `completeReceive()`.
|
|
196
219
|
|
|
197
220
|
### Delivery receipts
|
|
198
221
|
|
|
@@ -210,8 +233,10 @@ With `'auto'` on the Signal Protocol Relay, the client sends no end-to-end
|
|
|
210
233
|
receipt for an identified message that the Relay acknowledgment lists as
|
|
211
234
|
receipted. On any other relay, `'auto'` sends the same receipts as `'always'`.
|
|
212
235
|
`DecryptedEnvelope.arrivedSealed` tells whether a message arrived through sealed
|
|
213
|
-
sender. The client seals a receipt when it holds the access key of the sender
|
|
214
|
-
|
|
236
|
+
sender. The client seals a receipt when it holds the access key of the sender.
|
|
237
|
+
Otherwise it sends the receipt identified only when the `deliveryMode` of
|
|
238
|
+
`sealedSender` permits it, and `'required'` sends no identified receipt. A
|
|
239
|
+
retry request follows the same rule. Read receipts are not affected.
|
|
215
240
|
|
|
216
241
|
The sender gets each receipt through the `onDelivered` hook, once for each
|
|
217
242
|
source and recipient device:
|
|
@@ -223,8 +248,16 @@ source and recipient device:
|
|
|
223
248
|
|
|
224
249
|
The status of a device only moves forward. `sources` holds each source that the
|
|
225
250
|
device has given so far, so an `'e2ee'` event after a `'relay'` event carries
|
|
226
|
-
both. A
|
|
227
|
-
|
|
251
|
+
both. A receipt for a send that has not resolved yet comes after the send
|
|
252
|
+
resolves.
|
|
253
|
+
|
|
254
|
+
The hook runs at least once for each source. The client marks a source
|
|
255
|
+
announced only after the hook returns. A hook that throws, a `stop()` during the
|
|
256
|
+
hook, or a crash leaves the source unannounced. An error from the hook fails the
|
|
257
|
+
receipt, so the relay delivers it again, and the hook runs again with the next
|
|
258
|
+
receipt for the message. A second receipt of the same source after the hook
|
|
259
|
+
returned changes nothing. Make the hook idempotent for one `clientMessageId`,
|
|
260
|
+
`recipientDeviceId`, and `source`.
|
|
228
261
|
|
|
229
262
|
The sender keeps a copy of each message that it sends, plaintext included, so
|
|
230
263
|
that it can send the message again when the recipient asks for a retry. An
|
|
@@ -308,7 +341,7 @@ const result = await rotateKeysHeadless(relay, userId, deviceId, { storage });
|
|
|
308
341
|
|
|
309
342
|
- device `1` is the primary device
|
|
310
343
|
- linked devices use device IDs `2-5`
|
|
311
|
-
-
|
|
344
|
+
- put the account identity into the linked device's storage by device transfer or by a channel that the application owns before `DefaultSignalProtocolClient.create(..., { deviceId: 2 })`
|
|
312
345
|
|
|
313
346
|
## Notes
|
|
314
347
|
|
package/device/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Device Lifecycle, Linking, and Transfer
|
|
2
2
|
|
|
3
3
|
The device module contains the platform-bound workflows for device identity,
|
|
4
|
-
registration,
|
|
5
|
-
|
|
4
|
+
registration, device-name encryption, and encrypted device-to-device state
|
|
5
|
+
transfer.
|
|
6
6
|
|
|
7
7
|
## Why it exists
|
|
8
8
|
|
|
@@ -10,13 +10,17 @@ Signal Protocol sessions address individual devices. The application therefore
|
|
|
10
10
|
needs a lifecycle that coordinates a locally persisted device ID with the
|
|
11
11
|
authenticated backend's device registry.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
A linked device needs the account identity before it joins the account. Two
|
|
14
|
+
separate operations do that work:
|
|
14
15
|
|
|
15
|
-
- **
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
- **Transfer** sends an identity-only bundle over an application-owned
|
|
17
|
+
encrypted device-to-device channel. The receiving device generates fresh
|
|
18
|
+
prekeys and sessions after import. The application can also put the account
|
|
19
|
+
identity into the new device's store by a channel that it owns.
|
|
20
|
+
- **The managed device link** is `linkHostedRelayDevice()` from the package
|
|
21
|
+
root. It joins a store that already holds the account identity to the Relay
|
|
22
|
+
account. It runs in one process that holds the active device's store and the
|
|
23
|
+
new device's store. It sends no private key to the Relay.
|
|
20
24
|
|
|
21
25
|
The primary device uses ID `1`. The backend allocates linked device IDs from
|
|
22
26
|
`2` through `5`. A client must not choose its own linked-device ID.
|
|
@@ -92,82 +96,31 @@ it only after preload or in code that can safely tolerate that fallback.
|
|
|
92
96
|
|
|
93
97
|
## Link a device
|
|
94
98
|
|
|
95
|
-
|
|
99
|
+
Put the account identity into the new device's store first, by device transfer
|
|
100
|
+
or by a channel that the application owns. Then join the new device to the
|
|
101
|
+
Relay account:
|
|
96
102
|
|
|
97
103
|
<!-- doc-snippet:skip requires-external-context -->
|
|
98
104
|
```ts
|
|
99
|
-
import {
|
|
100
|
-
generateProvisioningQR,
|
|
101
|
-
provisionDevice,
|
|
102
|
-
} from "@open-e2ee/signal-protocol-sdk/device/provisioning";
|
|
103
|
-
|
|
104
|
-
const {
|
|
105
|
-
sessionId,
|
|
106
|
-
qrCodeUrl,
|
|
107
|
-
ephemeralKeyPair,
|
|
108
|
-
} = await generateProvisioningQR(relay, userId);
|
|
109
|
-
|
|
110
|
-
await appQr.show(qrCodeUrl);
|
|
111
|
-
|
|
112
|
-
const { newDeviceEphemeralPublicKey } =
|
|
113
|
-
await appProvisioning.waitForLinkedDevice(sessionId);
|
|
114
|
-
|
|
115
|
-
await provisionDevice(
|
|
116
|
-
relay,
|
|
117
|
-
appProfile,
|
|
118
|
-
sessionId,
|
|
119
|
-
ephemeralKeyPair.privateKey,
|
|
120
|
-
newDeviceEphemeralPublicKey,
|
|
121
|
-
userId,
|
|
122
|
-
{ identityStore, groupStateStore },
|
|
123
|
-
);
|
|
124
|
-
```
|
|
105
|
+
import { linkHostedRelayDevice } from "@open-e2ee/signal-protocol-sdk";
|
|
125
106
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
import {
|
|
132
|
-
connectToProvisioningSession,
|
|
133
|
-
parseProvisioningQR,
|
|
134
|
-
receiveProvisioningMessage,
|
|
135
|
-
} from "@open-e2ee/signal-protocol-sdk/device/provisioning";
|
|
136
|
-
// Reads the local platform, so it is imported separately from the protocol
|
|
137
|
-
// itself. Use `./device/react-native` off Expo, or build the fields by hand.
|
|
138
|
-
import { getDeviceMetadata } from "@open-e2ee/signal-protocol-sdk/device/expo";
|
|
139
|
-
|
|
140
|
-
const {
|
|
141
|
-
sessionId,
|
|
142
|
-
primaryEphemeralPublicKey,
|
|
143
|
-
} = parseProvisioningQR(scannedQrCode);
|
|
144
|
-
|
|
145
|
-
const deviceMetadata = getDeviceMetadata("Alice's tablet");
|
|
146
|
-
const linkedKeys = await connectToProvisioningSession(
|
|
147
|
-
relay,
|
|
148
|
-
sessionId,
|
|
149
|
-
deviceMetadata,
|
|
150
|
-
);
|
|
151
|
-
|
|
152
|
-
const provisioning = await receiveProvisioningMessage(
|
|
153
|
-
relay,
|
|
154
|
-
sessionId,
|
|
155
|
-
linkedKeys.privateKey,
|
|
156
|
-
primaryEphemeralPublicKey,
|
|
157
|
-
{
|
|
158
|
-
identityStore,
|
|
159
|
-
localStateStore,
|
|
160
|
-
groupStateStore,
|
|
161
|
-
usernameStateStore,
|
|
162
|
-
deviceMetadata,
|
|
163
|
-
},
|
|
164
|
-
);
|
|
165
|
-
|
|
166
|
-
console.log(provisioning.deviceId);
|
|
107
|
+
const client = await linkHostedRelayDevice({
|
|
108
|
+
adapters: { storage: linkedStorage },
|
|
109
|
+
activeDeviceStorage,
|
|
110
|
+
hosted: { relayUrl, adapter: managedLinkAdapter },
|
|
111
|
+
});
|
|
167
112
|
```
|
|
168
113
|
|
|
169
|
-
|
|
170
|
-
|
|
114
|
+
`activeDeviceStorage` is the store of a device that is already signed in. Its
|
|
115
|
+
account identity must match the identity in `linkedStorage`. The call reads
|
|
116
|
+
the device-authentication private key from each store and signs the link
|
|
117
|
+
challenge in the calling process. Thus that process must hold the active
|
|
118
|
+
device's store, private keys included. The adapter's `linkDevice()` gets a
|
|
119
|
+
challenge signer for each device and no private key.
|
|
120
|
+
|
|
121
|
+
The link copies no protocol state and no group state. Sessions start fresh.
|
|
122
|
+
For each group, the application brings the group master key to the new device,
|
|
123
|
+
and the new device then calls `syncGroup()`.
|
|
171
124
|
|
|
172
125
|
## Transfer cryptographic state
|
|
173
126
|
|
|
@@ -198,16 +151,17 @@ durably restores the backup.
|
|
|
198
151
|
|
|
199
152
|
## Security boundaries
|
|
200
153
|
|
|
201
|
-
-
|
|
202
|
-
- Ephemeral ECDH keys derive the provisioning/transfer encryption keys.
|
|
154
|
+
- Ephemeral ECDH keys derive the transfer encryption keys.
|
|
203
155
|
- The SDK encrypts identity material before it reaches a relay or transport.
|
|
204
|
-
-
|
|
205
|
-
|
|
206
|
-
- The QR
|
|
156
|
+
- Transfer bundles never contain signed prekeys, one-time prekeys, ratchet
|
|
157
|
+
sessions, sender-key state, message state, or retry outbox state.
|
|
158
|
+
- The transfer QR code authenticates the channel only to the extent that the
|
|
207
159
|
application protects what the user scans or shares.
|
|
160
|
+
- The managed device link sends no private key to the Relay. The process that
|
|
161
|
+
calls it must hold the active device's store.
|
|
208
162
|
- The SDK encrypts device names for backend storage.
|
|
209
|
-
- Backend authentication must bind registration,
|
|
210
|
-
|
|
163
|
+
- Backend authentication must bind registration, unlink, and removal to the
|
|
164
|
+
owning account.
|
|
211
165
|
- Account reset must clear the device-ID cache, platform secret storage, and
|
|
212
166
|
protocol store as one product-level lifecycle.
|
|
213
167
|
|