summaryrefslogtreecommitdiff
path: root/src/ReceiverMSEHandshakeCommand.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2015-01-12 17:46:20 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2015-01-12 17:46:20 +0900
commitc653c72dc84b7c5fe99f2aa189e9cf1da80a9ed5 (patch)
treeec0497de2d684cc0b5030c94e0334c73754b8954 /src/ReceiverMSEHandshakeCommand.cc
parentcc36df2625c1fee8e4f013becff07d3b4c38b12d (diff)
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.
Diffstat (limited to 'src/ReceiverMSEHandshakeCommand.cc')
-rw-r--r--src/ReceiverMSEHandshakeCommand.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ReceiverMSEHandshakeCommand.cc b/src/ReceiverMSEHandshakeCommand.cc
index f0c611d4..02205383 100644
--- a/src/ReceiverMSEHandshakeCommand.cc
+++ b/src/ReceiverMSEHandshakeCommand.cc
@@ -96,7 +96,9 @@ bool ReceiverMSEHandshakeCommand::executeInternal()
sequence_ = RECEIVER_WAIT_KEY;
break;
case MSEHandshake::HANDSHAKE_LEGACY: {
- if(getDownloadEngine()->getOption()->getAsBool(PREF_BT_REQUIRE_CRYPTO)){
+ const auto option = getDownloadEngine()->getOption();
+ if(option->getAsBool(PREF_BT_FORCE_ENCRYPTION) ||
+ option->getAsBool(PREF_BT_REQUIRE_CRYPTO)){
throw DL_ABORT_EX
("The legacy BitTorrent handshake is not acceptable by the"
" preference.");