mirror of
https://github.com/element-hq/dendrite.git
synced 2025-09-14 05:12:26 +03:00
Support for fallback keys (#3451)
Backports support for fallback keys from Harmony, which should make E2EE more reliable in the face of OTK exhaustion. Signed-off-by: Neil Alexander <git@neilalexander.dev> Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com> [skip ci]
This commit is contained in:
parent
c3d7a34c15
commit
78dbf21c5f
13 changed files with 446 additions and 20 deletions
|
@ -167,6 +167,15 @@ type KeyDatabase interface {
|
|||
// OneTimeKeysCount returns a count of all OTKs for this device.
|
||||
OneTimeKeysCount(ctx context.Context, userID, deviceID string) (*api.OneTimeKeysCount, error)
|
||||
|
||||
// StoreFallbackKeys persists the given fallback keys.
|
||||
StoreFallbackKeys(ctx context.Context, keys api.FallbackKeys) ([]string, error)
|
||||
|
||||
// UnusedFallbackKeyAlgorithms returns unused fallback algorithms for this user/device.
|
||||
UnusedFallbackKeyAlgorithms(ctx context.Context, userID, deviceID string) ([]string, error)
|
||||
|
||||
// DeleteFallbackKeys deletes all fallback keys for the user.
|
||||
DeleteFallbackKeys(ctx context.Context, userID, deviceID string) error
|
||||
|
||||
// DeviceKeysJSON populates the KeyJSON for the given keys. If any proided `keys` have a `KeyJSON` or `StreamID` already then it will be replaced.
|
||||
DeviceKeysJSON(ctx context.Context, keys []api.DeviceMessage) error
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue