From 742dbdb68a45884ae26913f8aeccc2a46960e873 Mon Sep 17 00:00:00 2001 From: orignal Date: Sun, 7 Mar 2021 10:07:51 -0500 Subject: [PATCH] rekey low badwidth routers to ECIES --- libi2pd/RouterContext.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libi2pd/RouterContext.cpp b/libi2pd/RouterContext.cpp index 809c73db..0f7afa4f 100644 --- a/libi2pd/RouterContext.cpp +++ b/libi2pd/RouterContext.cpp @@ -647,7 +647,14 @@ namespace i2p } } std::shared_ptr oldIdentity; - if (m_Keys.GetPublic ()->GetSigningKeyType () == i2p::data::SIGNING_KEY_TYPE_DSA_SHA1) + bool rekey = m_Keys.GetPublic ()->GetSigningKeyType () == i2p::data::SIGNING_KEY_TYPE_DSA_SHA1; + if (!rekey && m_Keys.GetPublic ()->GetCryptoKeyType () == i2p::data::CRYPTO_KEY_TYPE_ELGAMAL) + { + // rekey routers with bandwidth = L (or default) this time + std::string bandwidth; i2p::config::GetOption("bandwidth", bandwidth); + if (bandwidth.empty () || bandwidth[0] == 'L') rekey = true; + } + if (rekey) { // update keys LogPrint (eLogInfo, "Router: router keys are obsolete. Creating new");