Kim De Mey
2557fd35c6
Use aesKeySize const for aes key instead if ivSize (same values) ( #375 )
2021-07-16 14:55:52 +02:00
kdeme
00a45a7b91
Remove inline pragmas
2021-05-11 09:59:58 +02:00
kdeme
e10ef19f81
Move push raises to top and add/update license info where needed
2021-04-28 16:20:05 +02:00
Kim De Mey
762415319c
Add build_dcli target and add it to CI ( #344 )
...
* Add build_dcli target and add it to CI
* Fix local imports for dcli
* And use local imports for all other files too
* Use local imports in tests and rlpx protocols
2021-04-06 13:33:24 +02:00
Kim De Mey
a339944bcf
Some discv5 cleanup / refactor ( #326 )
...
* Use Address in HandshakeKey
* Refactor + comments + dcli use queryRandom
* Rename types.nim to messages.nim
2021-02-02 22:47:21 +01:00
kdeme
44637cdd8e
Remove support for discovery v5.0
2020-11-13 12:33:07 +01:00
Kim De Mey
6b17531d48
Improvements on dropping of challenges and handling of too large distance ( #296 )
...
- drop handshake challenge on invalid handshake
- send empty nodes reponse when distance is > 256
- misc
2020-09-30 09:43:51 +02:00
Kim De Mey
c9caafb2a4
Replace memory db with lrucache for temporary storage of sessions ( #292 )
2020-09-10 14:49:48 +02:00
kdeme
f0638eb3f1
Add rlp_decode fuzz test + some corpus generate code
2020-07-20 17:09:15 +02:00
kdeme
4e4836a0fe
Add discv5 fuzzing test targets
2020-07-20 14:17:44 +02:00
kdeme
1eae8f93f9
Fix empty ENR list in auth-response properly + potentially request new ENR on revalidation
2020-07-17 16:18:50 +02:00
kdeme
84fd39a8f8
Update enrs in buckets and replacement caches and fix empty ENR list in AuthResponse
2020-07-17 11:14:08 +02:00
Kim De Mey
0888667ac0
Comments and cleanup ( #276 )
...
* Fix dcli + add more comments
* Fix pong enr sequence number + varia cleanup
* Send randomData in case no handshake was done yet. Fix #277
2020-07-12 17:25:18 +02:00
Jacek Sieka
484fbcab1b
use bearssl rng throughout ( #265 )
...
* use bearssl rng throughout
* seeder can fail
* imports and exports
* modules, sigh
* one more try
* move var
* even fewer thread vars
* remove out-of-date genrated files
2020-07-07 10:56:26 +02:00
Jacek Sieka
61feae0f21
secp: requiresInit updates ( #258 )
...
* secp: requiresInit updates
* fixup!
* clean up mapconverts
2020-06-22 18:07:48 +02:00
kdeme
6dd820840a
Add simple auth header encode/decode test
2020-06-04 15:03:41 +02:00
kdeme
12627b34d3
Don't allow to use HandshareSecrets if auth response is invalid
2020-06-04 13:38:04 +02:00
kdeme
47602e634c
Add node id check and id-nonce-sig verification #204
2020-06-04 12:19:06 +02:00
Kim De Mey
a110f091af
Discv5 eh2 ( #240 )
...
* Discv5: More error handling improvements
- More results usage and raises pragma annotations
- Remove ENode related code and adjust Node object
- Misc.
* Add sendMessage and catch RlpError when decoding WhoAreYou
* Make the receive proc exception free
Except for `Exception` hah...
* Address review comments
* And another bunch of results and raises annotations
* Send Nodes Message also on 0 nodes and remove usage of broken require
2020-05-28 10:19:36 +02:00
kdeme
887cbba563
discv5: Address review comments
2020-05-01 22:34:26 +02:00
kdeme
74df90e16d
discv5: further prepping for results error handling
2020-04-30 00:11:03 +02:00
kdeme
3a6d4336bc
Bunch of renames to use same nomenclature as spec
2020-04-27 14:13:00 +02:00
kdeme
09a127ef1b
Pass packet as decoding result
2020-04-24 16:52:41 +02:00
kdeme
5dec5c5a9b
discv5 encoding: First steps to move to result based error handling
2020-04-24 15:51:04 +02:00
Jacek Sieka
fd6caa0fdc
Rlp experimental ( #227 )
...
* rlp: remove experimental features
* avoid range library
* trie: avoid reference-unsafe bitrange type
2020-04-20 20:14:39 +02:00
Jacek Sieka
0b110f3287
Secp more refactor ( #211 )
...
* simplify some modules
* mark several modules with raises
* fix clearing of keys in auth.nim
* fix keyfile case dropping off
* fix keyfile stream storage
* uuid should be output in lowercase
* enode: simplify API
2020-04-06 18:24:15 +02:00
Jacek Sieka
ac5bbe4d3d
keys: get rid of deprecated calls ( #213 )
2020-04-04 18:44:01 +02:00
kdeme
a9ff761d68
For now use directly address/id instead of Node to workaround node isNil problem in edge cases
2020-03-24 16:45:15 +02:00
kdeme
55b8e3e23f
Update address to UDP endpoint and delete keys on removal from DHT
2020-03-24 16:45:15 +02:00
kdeme
267a06dbe6
discv5: Pass bootstrap nodes and add deletion of nodes
2020-03-24 16:45:15 +02:00
kdeme
172173b863
Discv5: set recordSeq in whoareyou to 0 so we receive always an ENR
2020-03-10 22:44:10 +01:00
kdeme
596f148974
Discv5: Specifically handle decryption errors
2020-03-10 16:01:04 +01:00
kdeme
0d63ff4db4
(Quick)fix hashing for handshakes by adding Ports + tests
2020-02-29 14:16:27 +01:00
kdeme
6b01ada194
Add address to handshakes key
2020-02-29 14:16:27 +01:00
kdeme
1fab56f894
Introduce more constants and type aliases
2020-02-29 14:16:27 +01:00
kdeme
ad99b96e12
Drop additional handshakes with same nodeid and add timeout on handshakes
2020-02-29 14:09:12 +01:00
kdeme
fc844347a4
Don't send Whoareyou on handshake failure
2020-02-29 14:09:12 +01:00
Zahary Karadjov
e89e59aa59
`enterList` now returns a bool
2020-02-27 20:09:05 +02:00
Zahary Karadjov
74d0247e6b
Tweak some retry limits and timeouts
2020-02-22 20:49:14 +02:00
kdeme
3dd26e8526
Attempt to further add the discv5 wire test vectors
2020-02-20 15:09:31 +02:00
Zahary Karadjov
cca931d0b5
Reduce the use of the general Exception type and improve the exception tarcking in protocol.receive
2020-02-18 00:47:13 +02:00
kdeme
79dfe88ec8
Add Packet encodings tests
2020-02-17 22:38:56 +02:00
kdeme
5daaf73d2e
Clean up logging and some exception handling
2020-02-17 22:38:56 +02:00
Zahary Karadjov
a1a6862c7c
More spec compliant ENR
...
* Don't use signed integers in RLP
* Don't store IP addresses as var-sized ints (use fixed-sized blobs instead)
* Allow constructing ENR from ENode.Address
2020-02-12 11:58:14 +02:00
Yuriy Glukhov
3527d47cb5
Added packet encoding tests
2020-01-08 17:22:43 +02:00
Yuriy Glukhov
129710d3e4
Liveness checks
2020-01-08 17:22:43 +02:00
Yuriy Glukhov
9772fbe470
Use addresses instead of stubs as db keys
2020-01-08 17:22:43 +02:00
Yuriy Glukhov
eda6c2906c
Discv5 WIP
2020-01-08 17:22:43 +02:00