status-go/services/shhext/chat
Andrea Maria Piana ee3c05c79b
Change handling of skipped/deleted keys & add version (#1261)
- Skipped keys

The purpose of limiting the number of skipped keys generated is to avoid a dos
attack whereby an attacker would send a large N, forcing the device to
compute all the keys between currentN..N .

Previously the logic for handling skipped keys was:

- If in the current receiving chain there are more than maxSkip keys,
throw an error

This is problematic as in long-lived session dropped/unreceived messages starts
piling up, eventually reaching the threshold (1000 dropped/unreceived
messages).

This logic has been changed to be more inline with signals spec, and now
it is:

- If N is > currentN + maxSkip, throw an error

The purpose of limiting the number of skipped keys stored is to avoid a dos
attack whereby an attacker would force us to store a large number of
keys, filling up our storage.

Previously the logic for handling old keys was:

- Once you have maxKeep ratchet steps, delete any key from
currentRatchet - maxKeep.

This, in combination with the maxSkip implementation, capped the number of stored keys to
maxSkip * maxKeep.

The logic has been changed to:

- Keep a maximum of MaxMessageKeysPerSession

and additionally we delete any key that has a sequence number <
currentSeqNum - maxKeep

- Version

We check now the version of the bundle so that when we get a bundle from
the same installationID with a higher version, we mark the previous
bundle as expired and use the new bundle the next time a message is sent
2018-11-05 20:00:04 +01:00
..
crypto Add extract group membership signatures (#1226) 2018-10-04 18:53:48 +02:00
migrations Change handling of skipped/deleted keys & add version (#1261) 2018-11-05 20:00:04 +01:00
chat.pb.go Add x3dh key exchange (#1127) 2018-09-24 20:07:34 +02:00
chat.proto Add x3dh key exchange (#1127) 2018-09-24 20:07:34 +02:00
encryption.go Change handling of skipped/deleted keys & add version (#1261) 2018-11-05 20:00:04 +01:00
encryption.pb.go Add bundles.added signal & pairing endpoint (#1237) 2018-10-16 12:31:05 +02:00
encryption.proto Add bundles.added signal & pairing endpoint (#1237) 2018-10-16 12:31:05 +02:00
encryption_multi_device_test.go Add bundles.added signal & pairing endpoint (#1237) 2018-10-16 12:31:05 +02:00
encryption_test.go Change handling of skipped/deleted keys & add version (#1261) 2018-11-05 20:00:04 +01:00
persistence.go Add bundles.added signal & pairing endpoint (#1237) 2018-10-16 12:31:05 +02:00
protocol.go Change handling of skipped/deleted keys & add version (#1261) 2018-11-05 20:00:04 +01:00
protocol_test.go Change handling of skipped/deleted keys & add version (#1261) 2018-11-05 20:00:04 +01:00
rpc.go Add x3dh key exchange (#1127) 2018-09-24 20:07:34 +02:00
sql_lite_persistence.go Change handling of skipped/deleted keys & add version (#1261) 2018-11-05 20:00:04 +01:00
sql_lite_persistence_keys_storage_test.go Change handling of skipped/deleted keys & add version (#1261) 2018-11-05 20:00:04 +01:00
sql_lite_persistence_test.go Change handling of skipped/deleted keys & add version (#1261) 2018-11-05 20:00:04 +01:00
test.db Add x3dh key exchange (#1127) 2018-09-24 20:07:34 +02:00
whisper.go Add bundles.added signal & pairing endpoint (#1237) 2018-10-16 12:31:05 +02:00
whisper_test.go Add bundles.added signal & pairing endpoint (#1237) 2018-10-16 12:31:05 +02:00
x3dh.go Add bundles.added signal & pairing endpoint (#1237) 2018-10-16 12:31:05 +02:00
x3dh_test.go Add bundles.added signal & pairing endpoint (#1237) 2018-10-16 12:31:05 +02:00