Skip to main content

Module replay

Module replay 

Source
Expand description

Facility for detecting and preventing replays on introduction requests.

If we were to permit the introduction point to replay the same request multiple times, it would cause the service to contact the rendezvous point again with the same rendezvous cookie as before, which could help with traffic analysis.

(This could also be a DoS vector if the introduction point decided to overload the service.)

Because we use the same introduction point keys across restarts, we need to make sure that our replay logs are already persistent. We do this by using a file on disk.

Modulesยง

data ๐Ÿ”’
Wrapper around a fast-ish data structure for detecting replays with some false positive rate. Bloom filters, cuckoo filters, and xorf filters are all an option here. You could even use a HashSet.
ipt ๐Ÿ”’
Code for a replay log for Introduce2 messages.
pow ๐Ÿ”’
Code for a replay log for Proof-of-Work Nonces.

Structsยง

OpenReplayLogError
Error occurred while opening replay log.
PersistFile ๐Ÿ”’
Persistent state file, and associated data
ReplayLog ๐Ÿ”’
A probabilistic data structure to record fingerprints of observed Introduce2 messages.

Enumsยง

LogContentError ๐Ÿ”’
A problem that prevents us from reading a ReplayLog from disk.
ReplayError ๐Ÿ”’
An error occurred while checking whether weโ€™ve seen an element before.

Constantsยง

MAGIC_LEN ๐Ÿ”’
The length of the ReplayLogType::MAGIC constant.
OUTPUT_LEN ๐Ÿ”’
The length of the message that we store on disk, in bytes.
REPLAY_LOG_SUFFIX ๐Ÿ”’
Replay log files have a .bin suffix.

Traitsยง

ReplayLogType ๐Ÿ”’
A trait to represent a set of types that ReplayLog can be used with.

Type Aliasesยง

IptReplayLog ๐Ÿ”’
A ReplayLog for Introduce2 messages.
PowNonceReplayLog ๐Ÿ”’
A ReplayLog for Proof-of-Work Nonces.