Vasil Dimov
102867c587
net: change CNetAddr::ip to have flexible size
...
Before this change `CNetAddr::ip` was a fixed-size array of 16 bytes,
not being able to store larger addresses (e.g. TORv3) and encoded
smaller ones as 16-byte IPv6 addresses.
Change its type to `prevector`, so that it can hold larger addresses and
do not disguise non-IPv6 addresses as IPv6. So the IPv4 address
`1.2.3.4` is now encoded as `01020304` instead of
`00000000000000000000FFFF01020304`.
Rename `CNetAddr::ip` to `CNetAddr::m_addr` because it is not an "IP" or
"IP address" (TOR addresses are not IP addresses).
In order to preserve backward compatibility with serialization (where
e.g. `1.2.3.4` is serialized as `00000000000000000000FFFF01020304`)
introduce `CNetAddr` dedicated legacy serialize/unserialize methods.
Adjust `CSubNet` accordingly. Still use `CSubNet::netmask[]` of fixed 16
bytes, but use the first 4 for IPv4 (not the last 4). Only allow
subnetting for IPv4 and IPv6.
Co-authored-by: Carl Dong <contact@carldong.me>
2020-08-24 21:50:59 +02:00
freenancial
c8992e8959
test: Fix fuzzer compilation on macOS
...
fixes #19557
2020-07-21 15:23:49 -07:00
practicalswift
e507c0799d
tests: Add serialization/deserialization fuzzing helpers WriteToStream(…)/ReadFromStream(…)
2020-07-15 11:41:21 +00:00
practicalswift
e48094a506
tests: Add FuzzedAutoFileProvider which provides a CAutoFile interface to FuzzedDataProvider
2020-07-15 11:41:21 +00:00
practicalswift
9dbcd6854c
tests: Add FuzzedFileProvider which provides a FILE* interface to FuzzedDataProvider using fopencookie
2020-07-15 11:41:21 +00:00
practicalswift
97846d7f5b
tests: Add fuzzing harness for BanMan
2020-07-08 05:31:43 +00:00
practicalswift
deba199f1c
tests: Add ConsumeSubNet(...). Move and increase coverage in ConsumeNetAddr(...).
2020-07-08 05:05:12 +00:00
practicalswift
4a8181b303
tests: Add std::vector<uint8_t> ConsumeFixedLengthByteVector(FuzzedDataProvider& fuzzed_data_provider, const size_t length)
2020-06-11 14:05:54 +00:00
practicalswift
c571ecb071
tests: Add fuzzing helper functions ConsumeDataStream, ConsumeTxDestination and ConsumeUInt160
2020-05-29 16:44:22 +00:00
practicalswift
f9b22e3bdb
tests: Add fuzzing harness for CCoinsViewCache
2020-05-25 10:05:06 +00:00
practicalswift
cd34038cbd
Switch from Optional<T> to std::optional<T> (C++17). Run clang-format.
2020-05-14 18:52:57 +00:00
practicalswift
2bcc2bd742
tests: Clarify how we avoid hitting the signed integer overflow in CFeeRate::GetFeePerK() when fuzzing
2020-04-30 14:19:49 +00:00
practicalswift
3439c88a5d
tests: Add fuzzing harness for CBlockPolicyEstimator
2020-04-30 13:19:24 +00:00
MarcoFalke
fa488f131f
scripted-diff: Bump copyright headers
...
-BEGIN VERIFY SCRIPT-
./contrib/devtools/copyright_header.py update ./
-END VERIFY SCRIPT-
2020-04-16 13:33:09 -04:00
practicalswift
7b9a2dc864
tests: Add fuzzing harness for AdditionOverflow(...)
2020-04-08 14:45:27 +00:00
MarcoFalke
4839560ee1
Merge #18407 : tests: Add proof-of-work fuzzing harness
...
acf269e146
tests: Add proof-of-work fuzzing harness (practicalswift)
Pull request description:
Add proof-of-work fuzzing harness.
Top commit has no ACKs.
Tree-SHA512: dcdfa211cf1ec3018b61f378bb0f95793bbbe5d00e2f4d17f9db2c7263fe8ce919760c56cae7122c62c82e05c90e7056eb1778871674bdb3c42869e5fe4c2b60
2020-04-05 04:41:07 +08:00
practicalswift
acf269e146
tests: Add proof-of-work fuzzing harness
2020-04-04 17:23:50 +00:00
practicalswift
11a520f679
tests: Add fuzzing harness for functions/classes in random.h
2020-03-29 13:17:04 +00:00
practicalswift
102f3267e9
tests: Add fuzzing harness for classes/functions in blockfilter.h
2020-03-24 17:01:54 +00:00
practicalswift
44abf417eb
tests: Add fuzzing harness for various functions taking std::string as input
2020-03-15 16:25:29 +00:00
practicalswift
7726f3bc46
tests: Add fuzzing harness for CFeeRate
2020-03-15 16:25:29 +00:00
practicalswift
e37f53648e
Make lifetime correctness easier to see (avoid reference lifetime extension)
2020-03-09 20:39:48 +00:00
practicalswift
eb7c50ca1f
tests: Add common Consume* fuzzing functions
2020-03-09 19:24:50 +00:00
practicalswift
2a6a6ea0f5
tests: Add fuzzing harness for bloom filter class CBloomFilter
2020-02-25 17:04:03 +00:00