@@ -533,13 +533,13 @@ void TorController::auth_cb(TorControlConnection& _conn, const TorControlReply&
533533 }
534534
535535 // Finally - now create the service
536- if (private_key.empty ()) // No private key, generate one
537- private_key = " NEW:RSA1024 " ; // Explicitly request RSA1024 - see issue #9214
538- // Request hidden service, redirect port.
539- // Note that the 'virtual' port doesn't have to be the same as our internal port, but this is just a convenient
540- // choice. TODO; refactor the shutdown sequence some day .
541- _conn.Command (strprintf (" ADD_ONION %s Port=%i,127.0.0.1:%i " , private_key, GetListenPort (), GetListenPort ()),
542- boost ::bind (&TorController::add_onion_cb, this , _1, _2));
536+ if (private_key.empty ()) { // No private key, generate one
537+ private_key = " NEW:ED25519-V3 " ; // Explicitly request key type - see issue #9214
538+ }
539+ // Request onion service, redirect port.
540+ // Note that the 'virtual' port is always the default port to avoid decloaking nodes using other ports .
541+ _conn.Command (strprintf (" ADD_ONION %s Port=%i,%s " , private_key, Params (). GetDefaultPort (), m_target. ToStringIPPort ()),
542+ std ::bind (&TorController::add_onion_cb, this , std::placeholders:: _1, std::placeholders:: _2));
543543 } else {
544544 LogPrintf (" tor: Authentication failed\n " );
545545 }
0 commit comments