tor, fuzz: reuse constants instead of duplicating

`src/torcontrol.cpp` used to define some constants that are used
explicitly in `src/torcontrol.cpp` and implicitly in
`src/test/fuzz/torcontrol.cpp` by duplicating their values.

Move the constants to `src/torcontrol.h` and reuse them in
`src/test/fuzz/torcontrol.cpp` to avoid duplication and magic
numbers.
This commit is contained in:
Vasil Dimov
2026-02-19 12:03:18 +01:00
parent 8ee24d764a
commit fb993f7604
3 changed files with 6 additions and 5 deletions

View File

@@ -53,9 +53,6 @@ const std::string DEFAULT_TOR_CONTROL = "127.0.0.1:" + ToString(DEFAULT_TOR_CONT
static const int TOR_COOKIE_SIZE = 32;
/** Size of client/server nonce for SAFECOOKIE */
static const int TOR_NONCE_SIZE = 32;
/** Tor control reply code. Ref: https://spec.torproject.org/control-spec/replies.html */
static const int TOR_REPLY_OK = 250;
static const int TOR_REPLY_UNRECOGNIZED = 510;
/** For computing serverHash in SAFECOOKIE */
static const std::string TOR_SAFE_SERVERKEY = "Tor safe cookie authentication server-to-controller hash";
/** For computing clientHash in SAFECOOKIE */