Changeset View
Changeset View
Standalone View
Standalone View
src/torcontrol.cpp
Show First 20 Lines • Show All 669 Lines • ▼ Show 20 Lines | if (reply.code == 250) { | ||||
"HASHEDPASSWORD authentication is not available\n"); | "HASHEDPASSWORD authentication is not available\n"); | ||||
} | } | ||||
} else if (methods.count("NULL")) { | } else if (methods.count("NULL")) { | ||||
LogPrint(BCLog::TOR, "tor: Using NULL authentication\n"); | LogPrint(BCLog::TOR, "tor: Using NULL authentication\n"); | ||||
_conn.Command("AUTHENTICATE", | _conn.Command("AUTHENTICATE", | ||||
boost::bind(&TorController::auth_cb, this, _1, _2)); | boost::bind(&TorController::auth_cb, this, _1, _2)); | ||||
} else if (methods.count("SAFECOOKIE")) { | } else if (methods.count("SAFECOOKIE")) { | ||||
// Cookie: hexdump -e '32/1 "%02x""\n"' ~/.tor/control_auth_cookie | // Cookie: hexdump -e '32/1 "%02x""\n"' ~/.tor/control_auth_cookie | ||||
LogPrint(BCLog::TOR, "tor: Using SAFECOOKIE authentication, " | LogPrint(BCLog::TOR, | ||||
"tor: Using SAFECOOKIE authentication, " | |||||
"reading cookie authentication from %s\n", | "reading cookie authentication from %s\n", | ||||
cookiefile); | cookiefile); | ||||
std::pair<bool, std::string> status_cookie = | std::pair<bool, std::string> status_cookie = | ||||
ReadBinaryFile(cookiefile, TOR_COOKIE_SIZE); | ReadBinaryFile(cookiefile, TOR_COOKIE_SIZE); | ||||
if (status_cookie.first && | if (status_cookie.first && | ||||
status_cookie.second.size() == TOR_COOKIE_SIZE) { | status_cookie.second.size() == TOR_COOKIE_SIZE) { | ||||
// _conn.Command("AUTHENTICATE " + HexStr(status_cookie.second), | // _conn.Command("AUTHENTICATE " + HexStr(status_cookie.second), | ||||
// boost::bind(&TorController::auth_cb, this, _1, _2)); | // boost::bind(&TorController::auth_cb, this, _1, _2)); | ||||
cookie = std::vector<uint8_t>(status_cookie.second.begin(), | cookie = std::vector<uint8_t>(status_cookie.second.begin(), | ||||
▲ Show 20 Lines • Show All 125 Lines • Show Last 20 Lines |