From ab6688f1eb8bd7557c15e2ba20827c599005980f Mon Sep 17 00:00:00 2001 From: csoler Date: Tue, 6 Oct 2020 21:15:54 +0200 Subject: [PATCH] switched to ED25519-V3 --- retroshare-gui/src/TorControl/AddOnionCommand.cpp | 4 +++- retroshare-gui/src/TorControl/CryptoKey.cpp | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/retroshare-gui/src/TorControl/AddOnionCommand.cpp b/retroshare-gui/src/TorControl/AddOnionCommand.cpp index 68b560461..fb2047dc7 100644 --- a/retroshare-gui/src/TorControl/AddOnionCommand.cpp +++ b/retroshare-gui/src/TorControl/AddOnionCommand.cpp @@ -56,7 +56,9 @@ QByteArray AddOnionCommand::build() out += " "; out += m_service->privateKey().bytes(); } else { - out += " NEW:RSA1024"; // this is v2. For v3, use NEW:BEST, or NEW:ED25519-V3 + //out += " NEW:RSA1024"; // this is v2. For v3, use NEW:BEST, or NEW:ED25519-V3 + //out += " NEW:ED25519-V3"; // this is v3. + out += " NEW:BEST"; // this is v3, but without control of key type. Generates a RSA1024 key on older Tor versions. } foreach (const HiddenService::Target &target, m_service->targets()) { diff --git a/retroshare-gui/src/TorControl/CryptoKey.cpp b/retroshare-gui/src/TorControl/CryptoKey.cpp index 82fa62087..1cffca9f3 100644 --- a/retroshare-gui/src/TorControl/CryptoKey.cpp +++ b/retroshare-gui/src/TorControl/CryptoKey.cpp @@ -155,11 +155,11 @@ bool CryptoKey::loadFromTorMessage(const QByteArray& b) if(b.startsWith("RSA1024")) std::cerr << " type: RSA-1024 (Tor v2)" << std::endl; - else if(b.startsWith("ED25529-V3")) + else if(b.startsWith("ED25519-V3")) std::cerr << " type: ED25519-V3 (Tor v3)" << std::endl; - else + else if(b.indexOf(':')) { - std::cerr << " unknown type \"" << b.left(b.indexOf(':')).toStdString() << "\"" << std::endl; + std::cerr << " unknown type, or bad syntax in key: \"" << b.left(b.indexOf(':')).toStdString() << "\". Not accepted." << std::endl; return false; }