39 static const auto testing_setup = MakeNoLogFileContext<>();
52 tor_control_reply.
code = 250;
55 tor_control_reply.
code = 510;
58 tor_control_reply.
code = fuzzed_data_provider.ConsumeIntegral<
int>();
61 if (tor_control_reply.
lines.empty()) {
68 tor_controller.
add_onion_cb(dummy_tor_control_connection, tor_control_reply);
71 tor_controller.
auth_cb(dummy_tor_control_connection, tor_control_reply);
74 tor_controller.
authchallenge_cb(dummy_tor_control_connection, tor_control_reply);
77 tor_controller.
protocolinfo_cb(dummy_tor_control_connection, tor_control_reply);
bool Command(const std::string &, const ReplyHandlerCB &)
bool Connect(const std::string &, const ConnectionCB &, const ConnectionCB &)
DummyTorControlConnection()
Low-level handling for Tor control connection.
std::function< void(TorControlConnection &, const TorControlReply &)> ReplyHandlerCB
std::function< void(TorControlConnection &)> ConnectionCB
Reply from Tor, can be single or multi-line.
std::vector< std::string > lines
Controller that connects to Tor control socket, authenticate, then create and maintain an ephemeral o...
void add_onion_cb(TorControlConnection &conn, const TorControlReply &reply)
Callback for ADD_ONION result.
void authchallenge_cb(TorControlConnection &conn, const TorControlReply &reply)
Callback for AUTHCHALLENGE result.
void auth_cb(TorControlConnection &conn, const TorControlReply &reply)
Callback for AUTHENTICATE result.
void protocolinfo_cb(TorControlConnection &conn, const TorControlReply &reply)
Callback for PROTOCOLINFO result.
#define LIMITED_WHILE(condition, limit)
Can be used to limit a theoretically unbounded loop.
void initialize_torcontrol()
FUZZ_TARGET(torcontrol,.init=initialize_torcontrol)
size_t CallOneOf(FuzzedDataProvider &fuzzed_data_provider, Callables... callables)
std::vector< std::string > ConsumeRandomLengthStringVector(FuzzedDataProvider &fuzzed_data_provider, const size_t max_vector_size=16, const size_t max_string_length=16) noexcept