From c653c72dc84b7c5fe99f2aa189e9cf1da80a9ed5 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Mon, 12 Jan 2015 17:46:20 +0900 Subject: Add --bt-force-encryption option This option requires BitTorrent message payload encryption with arc4. This is a shorthand of --bt-requre-crypto --bt-min-crypto-level=arc4. If true is given, deny legacy BitTorrent handshake and only use Obfuscation handshake and always encrypt message payload. This option defaults to false. --- src/OptionHandlerFactory.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/OptionHandlerFactory.cc') diff --git a/src/OptionHandlerFactory.cc b/src/OptionHandlerFactory.cc index f2f4eec9..8542900c 100644 --- a/src/OptionHandlerFactory.cc +++ b/src/OptionHandlerFactory.cc @@ -1757,6 +1757,18 @@ std::vector OptionHandlerFactory::createOptionHandlers() op->setChangeOptionForReserved(true); handlers.push_back(op); } + { + OptionHandler* op(new BooleanOptionHandler + (PREF_BT_FORCE_ENCRYPTION, + TEXT_BT_FORCE_ENCRYPTION, + A2_V_FALSE, + OptionHandler::OPT_ARG)); + op->addTag(TAG_BITTORRENT); + op->setInitialOption(true); + op->setChangeGlobalOption(true); + op->setChangeOptionForReserved(true); + handlers.push_back(op); + } { OptionHandler* op(new NumberOptionHandler (PREF_BT_KEEP_ALIVE_INTERVAL, -- cgit