Crate bitcoin_tor

source ·

Modules

Structs

  • | Low-level handling for Tor control | connection. | | Speaks the SMTP-like protocol as defined | in torspec/control-spec.txt |
  • | Reply from Tor, can be single or multi-line |
  • | Controller that connects to Tor control | socket, authenticate, then create | and maintain an ephemeral onion service. |

Constants

Functions

  • | Compute Tor SAFECOOKIE response. | | ServerHash is computed as: | | HMAC-SHA256(“Tor safe cookie | authentication | server-to-controller hash”, | CookieString | ClientNonce | ServerNonce) | | (with the HMAC key as its first argument) | | After a controller sends a successful | AUTHCHALLENGE command, the next command sent | on the connection must be an AUTHENTICATE | command, and the only authentication string | which that AUTHENTICATE command will accept | is: | | HMAC-SHA256(“Tor safe cookie | authentication | controller-to-server hash”, | CookieString | ClientNonce | ServerNonce) |
  • | Parse reply arguments in the form ‘METHODS=COOKIE,SAFECOOKIE | COOKIEFILE=“…/control_auth_cookie”’. | | Returns a map of keys to values, or an | empty map if there was an error. | | Grammar is implicitly defined in https://spec.torproject.org/control-spec | by the server reply formats for PROTOCOLINFO | (S3.21), AUTHCHALLENGE (S3.24), and | ADD_ONION (S3.27). See also sections | 2.1 and 2.3. |
  • | Split reply line in the form ‘AUTH METHODS=…’ | into a type ‘AUTH’ and arguments ‘METHODS=…’. | | Grammar is implicitly defined in https://spec.torproject.org/control-spec | by the server reply formats for PROTOCOLINFO | (S3.21) and AUTHCHALLENGE (S3.24). |