From c010c83654e5c7baabf492f82aa43999eacaf44a Mon Sep 17 00:00:00 2001 From: orignal Date: Fri, 10 Feb 2017 12:51:55 -0500 Subject: [PATCH] signaturetype ofr HTTP and SOCKS proxy --- ClientContext.cpp | 6 ++++-- Config.cpp | 3 +++ docs/configuration.md | 2 ++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ClientContext.cpp b/ClientContext.cpp index 0354e708..3edafd88 100644 --- a/ClientContext.cpp +++ b/ClientContext.cpp @@ -50,11 +50,12 @@ namespace client std::string httpProxyKeys; i2p::config::GetOption("httpproxy.keys", httpProxyKeys); std::string httpProxyAddr; i2p::config::GetOption("httpproxy.address", httpProxyAddr); uint16_t httpProxyPort; i2p::config::GetOption("httpproxy.port", httpProxyPort); + i2p::data::SigningKeyType sigType; i2p::config::GetOption("httpproxy.signaturetype", sigType); LogPrint(eLogInfo, "Clients: starting HTTP Proxy at ", httpProxyAddr, ":", httpProxyPort); if (httpProxyKeys.length () > 0) { i2p::data::PrivateKeys keys; - if(LoadPrivateKeys (keys, httpProxyKeys, i2p::data::SIGNING_KEY_TYPE_DSA_SHA1)) + if(LoadPrivateKeys (keys, httpProxyKeys, sigType)) { std::map params; ReadI2CPOptionsFromConfig ("httpproxy.", params); @@ -80,11 +81,12 @@ namespace client uint16_t socksProxyPort; i2p::config::GetOption("socksproxy.port", socksProxyPort); std::string socksOutProxyAddr; i2p::config::GetOption("socksproxy.outproxy", socksOutProxyAddr); uint16_t socksOutProxyPort; i2p::config::GetOption("socksproxy.outproxyport", socksOutProxyPort); + i2p::data::SigningKeyType sigType; i2p::config::GetOption("socksproxy.signaturetype", sigType); LogPrint(eLogInfo, "Clients: starting SOCKS Proxy at ", socksProxyAddr, ":", socksProxyPort); if (socksProxyKeys.length () > 0) { i2p::data::PrivateKeys keys; - if (LoadPrivateKeys (keys, socksProxyKeys, i2p::data::SIGNING_KEY_TYPE_DSA_SHA1)) + if (LoadPrivateKeys (keys, socksProxyKeys, sigType)) { std::map params; ReadI2CPOptionsFromConfig ("socksproxy.", params); diff --git a/Config.cpp b/Config.cpp index b8008bc3..7f8f2f53 100644 --- a/Config.cpp +++ b/Config.cpp @@ -16,6 +16,7 @@ #include #include +#include "Identity.h" #include "Config.h" #include "version.h" @@ -85,6 +86,7 @@ namespace config { ("httpproxy.address", value()->default_value("127.0.0.1"), "HTTP Proxy listen address") ("httpproxy.port", value()->default_value(4444), "HTTP Proxy listen port") ("httpproxy.keys", value()->default_value(""), "File to persist HTTP Proxy keys") + ("httpproxy.signaturetype", value()->default_value(i2p::data::SIGNING_KEY_TYPE_EDDSA_SHA512_ED25519), "Signature type for new keys. 7 (EdDSA) by default") ("httpproxy.inbound.length", value()->default_value("3"), "HTTP proxy inbound tunnel length") ("httpproxy.outbound.length", value()->default_value("3"), "HTTP proxy outbound tunnel length") ("httpproxy.inbound.quantity", value()->default_value("5"), "HTTP proxy inbound tunnels quantity") @@ -100,6 +102,7 @@ namespace config { ("socksproxy.address", value()->default_value("127.0.0.1"), "SOCKS Proxy listen address") ("socksproxy.port", value()->default_value(4447), "SOCKS Proxy listen port") ("socksproxy.keys", value()->default_value(""), "File to persist SOCKS Proxy keys") + ("socksproxy.signaturetype", value()->default_value(i2p::data::SIGNING_KEY_TYPE_EDDSA_SHA512_ED25519), "Signature type for new keys. 7 (EdDSA) by default") ("socksproxy.inbound.length", value()->default_value("3"), "SOCKS proxy inbound tunnel length") ("socksproxy.outbound.length", value()->default_value("3"), "SOCKS proxy outbound tunnel length") ("socksproxy.inbound.quantity", value()->default_value("5"), "SOCKS proxy inbound tunnels quantity") diff --git a/docs/configuration.md b/docs/configuration.md index 4894bfe3..8f17b220 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -46,6 +46,7 @@ All options below still possible in cmdline, but better write it in config file: * --httpproxy.address= - The address to listen on (HTTP Proxy) * --httpproxy.port= - The port to listen on (HTTP Proxy) 4444 by default * --httpproxy.keys= - optional keys file for HTTP proxy local destination +* --httpproxy.signaturetype= - signature type for new keys if keys file is set. 7 by default * --httpproxy.inbound.length= - Inbound tunnels length if keys is set. 3 by default * --httpproxy.inbound.quantity= - Inbound tunnels quantity if keys is set. 5 by default * --httpproxy.outbound.length= - Outbound tunnels length if keys is set. 3 by default @@ -55,6 +56,7 @@ All options below still possible in cmdline, but better write it in config file: * --socksproxy.address= - The address to listen on (SOCKS Proxy) * --socksproxy.port= - The port to listen on (SOCKS Proxy). 4447 by default * --socksproxy.keys= - optional keys file for SOCKS proxy local destination +* --socksproxy.signaturetype= - signature type for new keys if keys file is set. 7 by default * --socksproxy.inbound.length= - Inbound tunnels length if keys is set. 3 by default * --socksproxy.inbound.quantity= - Inbound tunnels quantity if keys is set. 5 by default * --socksproxy.outbound.length= - Outbound tunnels length if keys is set. 3 by default