aboutsummaryrefslogtreecommitdiff
path: root/src/torcontrol.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge #13780: 0.17: Pre-branch maintenanceWladimir J. van der Laan2018-08-081-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | 3fc20632a3ad30809356a58d2cf0ea4a4ad4cec3 qt: Set BLOCK_CHAIN_SIZE = 220 (DrahtBot) 2b6a2f4a28792f2fe9dc1be843b1ff1ecae35e8a Regenerate manpages (DrahtBot) eb7daf4d600eeb631427c018a984a77a34aca66e Update copyright headers to 2018 (DrahtBot) Pull request description: Some trivial maintenance to avoid having to do it again after the 0.17 branch off. (The scripts to do this are in `./contrib/`) Tree-SHA512: 16b2af45e0351b1c691c5311d48025dc6828079e98c2aa2e600dc5910ee8aa01858ca6c356538150dc46fe14c8819ed8ec8e4ec9a0f682b9950dd41bc50518fa
| * Update copyright headers to 2018DrahtBot2018-07-271-1/+1
| |
* | Return void instead of bool for functions that cannot failpracticalswift2018-07-271-3/+2
|/ | | | | | | | | | | | | | | | | * CBlockTreeDB::ReadReindexing(...) * CChainState::ResetBlockFailureFlags(...) * CTxMemPool::addUnchecked(...) * CWallet::LoadDestData(...) * CWallet::LoadKeyMetadata(...) * CWallet::LoadScriptMetadata(...) * CWallet::LoadToWallet(...) * CWallet::SetHDChain(...) * CWallet::SetHDSeed(...) * RemoveLocal(...) * SetMinVersion(...) * StartHTTPServer(...) * StartRPC(...) * TorControlConnection::Disconnect(...)
* scripted-diff: Replace NET_TOR with NET_ONIONwodry2018-07-021-2/+2
| | | | | | | | | | -BEGIN VERIFY SCRIPT- sed --in-place'' --expression='s/NET_TOR/NET_ONION/g' $(git grep -I --files-with-matches 'NET_TOR') -END VERIFY SCRIPT- The --in-place'' hack is required for sed on macOS to edit files in-place without passing a backup extension.
* Declare TorReply parsing functions in torcontrol_testsBen Woosley2018-05-211-3/+2
| | | | | Rather than including the implementation file into the test, which is bad practice.
* boost: drop boost threads from torcontrolCory Fields2018-02-081-3/+3
|
* Merge #10498: Use static_cast instead of C-style casts for non-fundamental typesMarcoFalke2018-02-071-3/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 9ad6746ccd Use static_cast instead of C-style casts for non-fundamental types (practicalswift) Pull request description: A C-style cast is equivalent to try casting in the following order: 1. `const_cast(...)` 2. `static_cast(...)` 3. `const_cast(static_cast(...))` 4. `reinterpret_cast(...)` 5. `const_cast(reinterpret_cast(...))` By using `static_cast<T>(...)` explicitly we avoid the possibility of an unintentional and dangerous `reinterpret_cast`. Furthermore `static_cast<T>(...)` allows for easier grepping of casts. For a more thorough discussion, see ["ES.49: If you must use a cast, use a named cast"](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#es49-if-you-must-use-a-cast-use-a-named-cast) in the C++ Core Guidelines (Stroustrup & Sutter). Tree-SHA512: bd6349b7ea157da93a47b8cf238932af5dff84731374ccfd69b9f732fabdad1f9b1cdfca67497040f14eaa85346391404f4c0495e22c467f26ca883cd2de4d3c
| * Use static_cast instead of C-style casts for non-fundamental typespracticalswift2017-09-221-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | A C-style cast is equivalent to try casting in the following order: 1. const_cast(...) 2. static_cast(...) 3. const_cast(static_cast(...)) 4. reinterpret_cast(...) 5. const_cast(reinterpret_cast(...)) By using static_cast<T>(...) explicitly we avoid the possibility of an unintentional and dangerous reinterpret_cast. Furthermore static_cast<T>(...) allows for easier grepping of casts.
* | Increment MIT Licence copyright header year on files modified in 2017Akira Takizawa2018-01-031-1/+1
| |
* | scripted-diff: Replace #include "" with #include <> (ryanofsky)MeshCollider2017-11-161-6/+6
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -BEGIN VERIFY SCRIPT- for f in \ src/*.cpp \ src/*.h \ src/bench/*.cpp \ src/bench/*.h \ src/compat/*.cpp \ src/compat/*.h \ src/consensus/*.cpp \ src/consensus/*.h \ src/crypto/*.cpp \ src/crypto/*.h \ src/crypto/ctaes/*.h \ src/policy/*.cpp \ src/policy/*.h \ src/primitives/*.cpp \ src/primitives/*.h \ src/qt/*.cpp \ src/qt/*.h \ src/qt/test/*.cpp \ src/qt/test/*.h \ src/rpc/*.cpp \ src/rpc/*.h \ src/script/*.cpp \ src/script/*.h \ src/support/*.cpp \ src/support/*.h \ src/support/allocators/*.h \ src/test/*.cpp \ src/test/*.h \ src/wallet/*.cpp \ src/wallet/*.h \ src/wallet/test/*.cpp \ src/wallet/test/*.h \ src/zmq/*.cpp \ src/zmq/*.h do base=${f%/*}/ relbase=${base#src/} sed -i "s:#include \"\(.*\)\"\(.*\):if test -e \$base'\\1'; then echo \"#include <\"\$relbase\"\\1>\\2\"; else echo \"#include <\\1>\\2\"; fi:e" $f done -END VERIFY SCRIPT-
* Declare single-argument (non-converting) constructors "explicit"practicalswift2017-08-161-1/+1
| | | | In order to avoid unintended implicit conversions.
* Use nullptr instead of zero (0) as the null pointer constantpracticalswift2017-08-161-4/+4
|
* scripted-diff: stop using the gArgs wrappersMarko Bencun2017-08-141-3/+3
| | | | | | | | They were temporary additions to ease the transition. -BEGIN VERIFY SCRIPT- find src/ -name "*.cpp" ! -wholename "src/util.h" ! -wholename "src/util.cpp" | xargs perl -i -pe 's/(?<!\.)(ParseParameters|ReadConfigFile|IsArgSet|(Soft|Force)?(Get|Set)(|Bool|)Arg(s)?)\(/gArgs.\1(/g' -END VERIFY SCRIPT-
* scripted-diff: Use the C++11 keyword nullptr to denote the pointer literal ↵practicalswift2017-08-071-6/+6
| | | | | | | | | | | | | instead of the macro NULL -BEGIN VERIFY SCRIPT- sed -i 's/\<NULL\>/nullptr/g' src/*.cpp src/*.h src/*/*.cpp src/*/*.h src/qt/*/*.cpp src/qt/*/*.h src/wallet/*/*.cpp src/wallet/*/*.h src/support/allocators/*.h sed -i 's/Prefer nullptr, otherwise SAFECOOKIE./Prefer NULL, otherwise SAFECOOKIE./g' src/torcontrol.cpp sed -i 's/tor: Using nullptr authentication/tor: Using NULL authentication/g' src/torcontrol.cpp sed -i 's/METHODS=nullptr/METHODS=NULL/g' src/test/torcontrol_tests.cpp src/torcontrol.cpp sed -i 's/nullptr certificates/NULL certificates/g' src/qt/paymentserver.cpp sed -i 's/"nullptr"/"NULL"/g' src/torcontrol.cpp src/test/torcontrol_tests.cpp -END VERIFY SCRIPT-
* Fix subscript[0] in torcontrolJeremy Rubin2017-07-081-1/+1
|
* Merge #10193: scripted-diff: Remove #include <boost/foreach.hpp>Wladimir J. van der Laan2017-07-041-1/+0
|\ | | | | | | | | | | | | | | | | | | b1268a1 clang-format: Delete ForEachMacros (Jorge Timón) 5995735 scripted-diff: Remove #include <boost/foreach.hpp> (Jorge Timón) 3eff827 scripted-diff: Remove BOOST_REVERSE_FOREACH (Jorge Timón) 33aed5b Fix const_reverse_iterator constructor (pass const ptr) (Jorge Timón) 300851e Introduce src/reverse_iterator.hpp and include it... (Jorge Timón) Tree-SHA512: df3405328e9602d0a433ac134ba59a5c9a6202ef64188df2f94a59b2ce58dec7c988b25d0671c7937de516a96b2e6daeb9d04c82fa363b616ee4cf6e9cb0fac6
| * scripted-diff: Remove #include <boost/foreach.hpp>Jorge Timón2017-06-221-1/+0
| | | | | | | | | | | | -BEGIN VERIFY SCRIPT- sed -i ':a;N;$!ba;s/#include <boost\/foreach.hpp>\n//' ./src/*.h ./src/*.cpp ./src/*/*.h ./src/*/*.cpp ./src/*/*/*.h ./src/*/*/*.cpp -END VERIFY SCRIPT-
* | Fixed multiple typosDimitris Tsapakidis2017-06-221-1/+1
| | | | | | | | | | | | | | A few "a->an" and "an->a". "Shows, if the supplied default SOCKS5 proxy" -> "Shows if the supplied default SOCKS5 proxy". Change made on 3 occurrences. "without fully understanding the ramification of a command" -> "without fully understanding the ramifications of a command". Removed duplicate words such as "the the".
* | Net: Fix resource leak in ReadBinaryFile(...)practicalswift2017-06-141-1/+3
|/ | | | Introduced in 0b6f40d4cabb3bebf551a49a69ce36d4b0375b6a via PR #10408.
* Merge #10502: scripted-diff: Remove BOOST_FOREACH, Q_FOREACH and PAIRTYPEPieter Wuille2017-06-131-3/+3
|\ | | | | | | | | | | | | | | | | 1238f13cf scripted-diff: Remove PAIRTYPE (Jorge Timón) 18dc3c396 scripted-diff: Remove Q_FOREACH (Jorge Timón) 7c00c2672 scripted-diff: Fully remove BOOST_FOREACH (Jorge Timón) a5410ac5e Small preparations for Q_FOREACH, PAIRTYPE and #include <boost/foreach.hpp> removal (Jorge Timón) Tree-SHA512: d3ab4a173366402e7dcef31608977b757d4aa07abbbad2ee1bcbcfa311e994a4552f24e5a55272cb22c2dcf89a4b0495e02e9d9aceae4b08c0bab668f20e324c
| * scripted-diff: Fully remove BOOST_FOREACHJorge Timón2017-06-051-3/+3
| | | | | | | | | | | | -BEGIN VERIFY SCRIPT- sed -i 's/BOOST_FOREACH *(\(.*\),/for (\1 :/' ./src/*.h ./src/*.cpp ./src/*/*.h ./src/*/*.cpp ./src/*/*/*.h ./src/*/*/*.cpp ; -END VERIFY SCRIPT-
* | Remove unused Boost includespracticalswift2017-06-091-1/+0
|/
* Merge #10408: Net: Improvements to Tor control port parserWladimir J. van der Laan2017-05-181-7/+75
|\ | | | | | | | | | | | | | | | | | | | | 49a199b torcontrol: Handle escapes in Tor QuotedStrings (Jack Grigg) 0182a11 torcontrol: Log invalid parameters in Tor reply strings where meaningful (Jack Grigg) 0b6f40d torcontrol: Check for reading errors in ReadBinaryFile (Jack Grigg) d63677b torcontrol: Fix ParseTorReplyMapping (Jack Grigg) 29f3c20 torcontrol: Add unit tests for Tor reply parsers (Jack Grigg) d8e03c0 torcontrol: Improve comments (Jack Grigg) Tree-SHA512: aa3ce8072d20299b38c4ba9471af7fab1f5df096c237bf40a96ee9274a357f7366f95ced0cc80f8da1f22f6455a1a8e68bad9a5ff71817eef3397b6aefcbc7ae
| * torcontrol: Handle escapes in Tor QuotedStringsJack Grigg2017-05-161-4/+49
| | | | | | | | | | | | | | | | | | | | | | https://trac.torproject.org/projects/tor/ticket/14999 is tracking an encoding bug with the Tor control protocol, where many of the QuotedString instances that Tor outputs are in fact CStrings, but it is not documented which ones are which. https://spec.torproject.org/control-spec section 2.1.1 provides a future-proofed rule for handing QuotedStrings, which this commit implements. This commit merges all six commits from https://github.com/zcash/zcash/pull/2251
| * torcontrol: Log invalid parameters in Tor reply strings where meaningfulJack Grigg2017-05-161-0/+12
| |
| * torcontrol: Check for reading errors in ReadBinaryFileJack Grigg2017-05-161-0/+4
| | | | | | | | | | This ensures that ReadBinaryFile never returns exactly TOR_COOKIE_SIZE bytes if the file was larger than that.
| * torcontrol: Fix ParseTorReplyMappingJack Grigg2017-05-161-2/+4
| | | | | | | | | | - Ignore remaining input if it is an OptArguments - Correctly handle escapes
| * torcontrol: Improve commentsJack Grigg2017-05-161-1/+6
| |
* | Replace boost::function with std::function (C++11)practicalswift2017-05-131-5/+4
|/
* torcontrol: Use fs::path instead of std::string for private key pathWladimir J. van der Laan2017-04-031-10/+10
|
* Change LogAcceptCategory to use uint32_t rather than sets of strings.Gregory Maxwell2017-04-011-18/+19
| | | | | | | | | | | | | | | | | This changes the logging categories to boolean flags instead of strings. This simplifies the acceptance testing by avoiding accessing a scoped static thread local pointer to a thread local set of strings. It eliminates the only use of boost::thread_specific_ptr outside of lockorder debugging. This change allows log entries to be directed to multiple categories and makes it easy to change the logging flags at runtime (e.g. via an RPC, though that isn't done by this commit.) It also eliminates the fDebug global. Configuration of unknown logging categories now produces a warning.
* Make some global variables less-global (static)Pavel Janík2017-03-181-2/+2
|
* Prevent -Wshadow warnings with gcc versions 4.8.5, 5.3.1 and 6.2.1.Pavel Janík2017-03-181-11/+11
|
* [trivial] Fix typos in commentspracticalswift2017-01-271-1/+1
|
* Increment MIT Licence copyright header year on files modified in 2016isle29832016-12-311-1/+1
| | | | | | Edited via: $ contrib/devtools/copyright_header.py update .
* Refactor: Removed begin/end_ptr functions.Karl-Johan Alm2016-12-091-4/+4
|
* torcontrol: Explicitly request RSA1024 private keyWladimir J. van der Laan2016-11-281-1/+1
| | | | | | | | | | When generating a new service key, explicitly request a RSA1024 one. The bitcoin P2P protocol has no support for the longer hidden service names that will come with ed25519 keys, until it does, we depend on the old hidden service type so make this explicit. See #9214.
* Do not shadow variablesPavel Janík2016-09-271-23/+23
|
* net: Have LookupNumeric return a CService directlyCory Fields2016-08-041-3/+2
| | | | | | Also fix up a few small issues: - Lookup with "badip:port" now sets the port to 0 - Don't allow assert to have side-effects
* net: narrow include scope after moving to netaddressCory Fields2016-07-311-0/+1
| | | | | Net functionality is no longer needed for CAddress/CAddrman/etc. now that CNetAddr/CService/CSubNet are dumb storage classes.
* net: Split resolving out of CServiceCory Fields2016-07-311-3/+4
|
* Merge #7703: tor: Change auth order to only use password auth if -torpasswordWladimir J. van der Laan2016-06-081-8/+10
|\ | | | | | | 2e49448 tor: Change auth order to only use HASHEDPASSWORD if -torpassword (Wladimir J. van der Laan)
| * tor: Change auth order to only use HASHEDPASSWORD if -torpasswordWladimir J. van der Laan2016-06-061-8/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | Change authentication order to make it more clear (see #7700). - If the `-torpassword` option is provided, force use of `HASHEDPASSWORD` auth. - Give error message if `-torpassword` provided, but `HASHEDPASSWORD` auth is not available. - Give error message if only `HASHEDPASSWORD` available, but `-torpassword` not given.
* | net: disable resolving from storage structuresCory Fields2016-04-201-1/+1
|/ | | | CNetAddr/CService/CSubnet can no longer resolve DNS.
* Fix torcontrol.cpp unused private field warningJonas Schnelli2016-03-141-2/+2
|
* Merge #7553: Remove vfReachable and modify IsReachable to only use vfLimited.Wladimir J. van der Laan2016-03-111-1/+1
|\ | | | | | | 110b62f Remove vfReachable and modify IsReachable to only use vfLimited. (Patrick Strateman)
| * Remove vfReachable and modify IsReachable to only use vfLimited.Patrick Strateman2016-02-171-1/+1
| | | | | | | | We do not know that a class of Network is reachable, only that it is not.
* | Fix memleak in TorController [rework]Wladimir J. van der Laan2016-03-031-4/+9
|/ | | | | | | | | | | It looks like, TorController::disconnected_cb(TorControlConnection& conn) gets called multiple times which results in multiple event_new(). Avoid this by creating the event only once in the constructore, and deleting it only once in the destructor (thanks to Cory Fields for the idea). Replaces the fix by Jonas Schnelli in #7610, see discussion there.
* fix spelling of advertise in src and docjloughry2016-02-121-2/+2
|
* Merge #7300: [trivial] Add missing copyright headersWladimir J. van der Laan2016-01-271-0/+4
|\ | | | | | | | | | | fabcee1 Remove copyright header from autogenerated chainparamsseeds.h (MarcoFalke) fa60d05 Add missing copyright headers (MarcoFalke) fa7e4c0 Bump copyright headers to 2014 (MarcoFalke)