Bitcoin Core 29.99.0
P2P Digital Currency
Public Member Functions | Static Public Attributes | Static Private Member Functions | Private Attributes | List of all members
TorStreamIsolationCredentialsGenerator Class Reference

Generate unique credentials for Tor stream isolation. More...

Public Member Functions

 TorStreamIsolationCredentialsGenerator ()
 
ProxyCredentials Generate ()
 Return the next unique proxy credentials. More...
 

Static Public Attributes

static constexpr size_t PREFIX_BYTE_LENGTH = 8
 Size of session prefix in bytes. More...
 

Static Private Member Functions

static std::string GenerateUniquePrefix ()
 Generate a random prefix for each of the credentials returned by this generator. More...
 

Private Attributes

const std::string m_prefix
 
std::atomic< uint64_t > m_counter
 

Detailed Description

Generate unique credentials for Tor stream isolation.

Tor will create separate circuits for SOCKS5 proxy connections with different credentials, which makes it harder to correlate the connections.

Definition at line 757 of file netbase.cpp.

Constructor & Destructor Documentation

◆ TorStreamIsolationCredentialsGenerator()

TorStreamIsolationCredentialsGenerator::TorStreamIsolationCredentialsGenerator ( )
inline

Definition at line 760 of file netbase.cpp.

Member Function Documentation

◆ Generate()

ProxyCredentials TorStreamIsolationCredentialsGenerator::Generate ( )
inline

Return the next unique proxy credentials.

Definition at line 765 of file netbase.cpp.

Here is the caller graph for this function:

◆ GenerateUniquePrefix()

static std::string TorStreamIsolationCredentialsGenerator::GenerateUniquePrefix ( )
inlinestaticprivate

Generate a random prefix for each of the credentials returned by this generator.

This makes sure that different launches of the application (either successively or in parallel) will not share the same circuits, as would be the case with a bare counter.

Definition at line 782 of file netbase.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ m_counter

std::atomic<uint64_t> TorStreamIsolationCredentialsGenerator::m_counter
private

Definition at line 776 of file netbase.cpp.

◆ m_prefix

const std::string TorStreamIsolationCredentialsGenerator::m_prefix
private

Definition at line 775 of file netbase.cpp.

◆ PREFIX_BYTE_LENGTH

constexpr size_t TorStreamIsolationCredentialsGenerator::PREFIX_BYTE_LENGTH = 8
staticconstexpr

Size of session prefix in bytes.

Definition at line 773 of file netbase.cpp.


The documentation for this class was generated from the following file: