Changeset View
Changeset View
Standalone View
Standalone View
src/torcontrol.cpp
Show First 20 Lines • Show All 594 Lines • ▼ Show 20 Lines | if (reply.code == 250) { | ||||
proxyType addrOnion = proxyType(resolved, true); | proxyType addrOnion = proxyType(resolved, true); | ||||
SetProxy(NET_ONION, addrOnion); | SetProxy(NET_ONION, addrOnion); | ||||
SetReachable(NET_ONION, true); | SetReachable(NET_ONION, true); | ||||
} | } | ||||
// Finally - now create the service | // Finally - now create the service | ||||
// No private key, generate one | // No private key, generate one | ||||
if (private_key.empty()) { | if (private_key.empty()) { | ||||
// Explicitly request RSA1024 - see issue #9214 | // Explicitly request key type - see issue #9214 | ||||
private_key = "NEW:RSA1024"; | private_key = "NEW:ED25519-V3"; | ||||
} | } | ||||
// Request hidden service, redirect port. | // Request hidden service, redirect port. | ||||
// Note that the 'virtual' port doesn't have to be the same as our | // Note that the 'virtual' port doesn't have to be the same as our | ||||
// internal port, but this is just a convenient choice. TODO; refactor | // internal port, but this is just a convenient choice. TODO; refactor | ||||
// the shutdown sequence some day. | // the shutdown sequence some day. | ||||
_conn.Command(strprintf("ADD_ONION %s Port=%i,127.0.0.1:%i", | _conn.Command(strprintf("ADD_ONION %s Port=%i,127.0.0.1:%i", | ||||
private_key, Params().GetDefaultPort(), | private_key, Params().GetDefaultPort(), | ||||
GetListenPort()), | GetListenPort()), | ||||
▲ Show 20 Lines • Show All 233 Lines • ▼ Show 20 Lines | if (!conn.Connect(target, | ||||
std::placeholders::_1))) { | std::placeholders::_1))) { | ||||
LogPrintf( | LogPrintf( | ||||
"tor: Re-initiating connection to Tor control port %s failed\n", | "tor: Re-initiating connection to Tor control port %s failed\n", | ||||
target); | target); | ||||
} | } | ||||
} | } | ||||
fs::path TorController::GetPrivateKeyFile() { | fs::path TorController::GetPrivateKeyFile() { | ||||
return GetDataDir() / "onion_private_key"; | return GetDataDir() / "onion_v3_private_key"; | ||||
} | } | ||||
void TorController::reconnect_cb(evutil_socket_t fd, short what, void *arg) { | void TorController::reconnect_cb(evutil_socket_t fd, short what, void *arg) { | ||||
TorController *self = static_cast<TorController *>(arg); | TorController *self = static_cast<TorController *>(arg); | ||||
self->Reconnect(); | self->Reconnect(); | ||||
} | } | ||||
/****** Thread ********/ | /****** Thread ********/ | ||||
▲ Show 20 Lines • Show All 43 Lines • Show Last 20 Lines |