wodry
07c493f2d1
scripted-diff: Replace NET_TOR with NET_ONION
...
-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.
2018-07-02 16:41:13 +02:00
Ben Woosley
97c112d4ca
Declare TorReply parsing functions in torcontrol_tests
...
Rather than including the implementation file into the test,
which is bad practice.
2018-05-21 10:53:18 -07:00
Cory Fields
08272671d2
boost: drop boost threads from torcontrol
2018-02-08 14:35:29 -05:00
MarcoFalke
0277173b1d
Merge #10498 : Use static_cast instead of C-style casts for non-fundamental types
...
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
2018-02-07 16:15:28 -05:00
Akira Takizawa
595a7bab23
Increment MIT Licence copyright header year on files modified in 2017
2018-01-03 02:26:56 +09:00
MeshCollider
1a445343f6
scripted-diff: Replace #include "" with #include <> (ryanofsky)
...
-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-
2017-11-16 08:23:01 +13:00
practicalswift
9ad6746ccd
Use static_cast instead of C-style casts for non-fundamental types
...
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.
2017-09-22 14:59:27 +02:00
practicalswift
64fb0ac016
Declare single-argument (non-converting) constructors "explicit"
...
In order to avoid unintended implicit conversions.
2017-08-16 16:33:25 +02:00
practicalswift
36d326e8b0
Use nullptr instead of zero (0) as the null pointer constant
2017-08-16 10:24:18 +02:00
Marko Bencun
bb81e17355
scripted-diff: stop using the gArgs wrappers
...
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-
2017-08-14 17:02:10 +02:00
practicalswift
90d4d89230
scripted-diff: Use the C++11 keyword nullptr to denote the pointer literal 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-
2017-08-07 07:36:37 +02:00
Jeremy Rubin
ac658e55ff
Fix subscript[0] in torcontrol
2017-07-08 13:33:01 -07:00
Wladimir J. van der Laan
6dbcc74a0e
Merge #10193 : scripted-diff: Remove #include <boost/foreach.hpp>
...
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
2017-07-04 18:05:18 +02:00
Dimitris Tsapakidis
0a5a6b90bc
Fixed multiple typos
...
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".
2017-06-22 19:18:10 +03:00
Jorge Timón
5995735c5b
scripted-diff: Remove #include <boost/foreach.hpp>
...
-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-
2017-06-22 03:48:52 +02:00
practicalswift
f2fb132cb0
Net: Fix resource leak in ReadBinaryFile(...)
...
Introduced in 0b6f40d4ca
via PR #10408 .
2017-06-14 17:35:37 +02:00
Pieter Wuille
1ad3d4e126
Merge #10502 : scripted-diff: Remove BOOST_FOREACH, Q_FOREACH and PAIRTYPE
...
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
2017-06-13 18:05:58 -07:00
practicalswift
49de096c2a
Remove unused Boost includes
2017-06-09 10:25:26 +02:00
Jorge Timón
7c00c26726
scripted-diff: Fully remove BOOST_FOREACH
...
-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-
2017-06-05 20:10:50 +02:00
Wladimir J. van der Laan
28c6e8d71b
Merge #10408 : Net: Improvements to Tor control port parser
...
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
2017-05-18 19:58:51 +02:00
Jack Grigg
49a199bb51
torcontrol: Handle escapes in Tor QuotedStrings
...
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
2017-05-16 18:22:25 +12:00
Jack Grigg
0182a11737
torcontrol: Log invalid parameters in Tor reply strings where meaningful
2017-05-16 18:22:22 +12:00
Jack Grigg
0b6f40d4ca
torcontrol: Check for reading errors in ReadBinaryFile
...
This ensures that ReadBinaryFile never returns exactly TOR_COOKIE_SIZE bytes if
the file was larger than that.
2017-05-16 18:22:19 +12:00
Jack Grigg
d63677bbb2
torcontrol: Fix ParseTorReplyMapping
...
- Ignore remaining input if it is an OptArguments
- Correctly handle escapes
2017-05-16 18:22:16 +12:00
Jack Grigg
d8e03c0340
torcontrol: Improve comments
2017-05-16 18:21:54 +12:00
practicalswift
1b936f5926
Replace boost::function with std::function (C++11)
2017-05-13 17:59:09 +02:00
Wladimir J. van der Laan
75594bd7f2
torcontrol: Use fs::path instead of std::string for private key path
2017-04-03 12:33:14 +02:00
Gregory Maxwell
6b3bb3d9ba
Change LogAcceptCategory to use uint32_t rather than sets of strings.
...
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.
2017-04-01 18:53:29 +00:00
Pavel Janík
c4b60b3d9c
Make some global variables less-global (static)
2017-03-18 07:59:50 +01:00
Pavel Janík
bb2aaeeeea
Prevent -Wshadow warnings with gcc versions 4.8.5, 5.3.1 and 6.2.1.
2017-03-18 07:59:50 +01:00
practicalswift
cc16d99f1d
[trivial] Fix typos in comments
2017-01-27 21:22:35 +01:00
isle2983
27765b6403
Increment MIT Licence copyright header year on files modified in 2016
...
Edited via:
$ contrib/devtools/copyright_header.py update .
2016-12-31 11:01:21 -07:00
Karl-Johan Alm
8c1dbc5e9d
Refactor: Removed begin/end_ptr functions.
2016-12-09 13:15:19 +09:00
Wladimir J. van der Laan
7d3b627395
torcontrol: Explicitly request RSA1024 private key
...
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 .
2016-11-28 17:18:46 +01:00
Pavel Janík
4731cab8fb
Do not shadow variables
2016-09-27 09:25:15 +02:00
Cory Fields
8945384bca
net: Have LookupNumeric return a CService directly
...
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
2016-08-04 16:41:39 -04:00
Cory Fields
21ba407a73
net: narrow include scope after moving to netaddress
...
Net functionality is no longer needed for CAddress/CAddrman/etc. now that
CNetAddr/CService/CSubNet are dumb storage classes.
2016-07-31 14:01:44 -04:00
Cory Fields
f96c7c4d91
net: Split resolving out of CService
2016-07-31 13:24:07 -04:00
Wladimir J. van der Laan
761cddb690
Merge #7703 : tor: Change auth order to only use password auth if -torpassword
...
2e49448
tor: Change auth order to only use HASHEDPASSWORD if -torpassword (Wladimir J. van der Laan)
2016-06-08 13:09:41 +02:00
Wladimir J. van der Laan
2e494489c3
tor: Change auth order to only use HASHEDPASSWORD if -torpassword
...
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.
2016-06-06 10:38:54 +02:00
Cory Fields
d39f5b425d
net: disable resolving from storage structures
...
CNetAddr/CService/CSubnet can no longer resolve DNS.
2016-04-20 13:08:19 -04:00
Jonas Schnelli
3d7e97376a
Fix torcontrol.cpp unused private field warning
2016-03-14 16:07:42 +01:00
Wladimir J. van der Laan
9f14e5ad91
Merge #7553 : Remove vfReachable and modify IsReachable to only use vfLimited.
...
110b62f
Remove vfReachable and modify IsReachable to only use vfLimited. (Patrick Strateman)
2016-03-11 08:25:28 +01:00
Wladimir J. van der Laan
e219503711
Fix memleak in TorController [rework]
...
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.
2016-03-03 13:31:26 +01:00
Patrick Strateman
110b62f069
Remove vfReachable and modify IsReachable to only use vfLimited.
...
We do not know that a class of Network is reachable, only that it is not.
2016-02-17 23:21:27 -08:00
jloughry
37767fd46f
fix spelling of advertise in src and doc
2016-02-12 12:51:54 -07:00
Wladimir J. van der Laan
9189e30b12
Merge #7300 : [trivial] Add missing copyright headers
...
fabcee1
Remove copyright header from autogenerated chainparamsseeds.h (MarcoFalke)
fa60d05
Add missing copyright headers (MarcoFalke)
fa7e4c0
Bump copyright headers to 2014 (MarcoFalke)
2016-01-27 12:06:31 +01:00
Wladimir J. van der Laan
5e00147838
Merge pull request #7313
...
0331aa3
Fixing typos on security-check.py and torcontrol.cpp (calebogden)
2016-01-18 10:45:25 +01:00
Chris Wheeler
9d263bd17c
Typo fixes in comments
2016-01-17 11:03:56 +00:00
calebogden
0331aa350c
Fixing typos on security-check.py and torcontrol.cpp
2016-01-08 13:31:42 -08:00