Jeff Becker
e6174efa21
don't derive x25519 key from ed25519 key
2020-02-03 17:21:31 -05:00
Jeff
c122b460e1
Merge pull request #1075 from jagerman/dht-blinding
...
Dht blinding
2020-02-03 16:44:25 -05:00
Jeff Becker
80f8363386
don't drop messages with pathid zero which belong to snode to snode dht and path build requests.
2020-02-03 16:24:45 -05:00
Jason Rhinelander
8cd95c01b3
Abstract signing hash data location
...
This makes the interface a little cleaner by not requiring the class
user to know how we laid out the data in the object.
2020-02-02 16:38:48 -04:00
Jason Rhinelander
739ce92aeb
Remove unused ristretto includes
2020-02-01 12:44:31 -04:00
Jeff Becker
ee752c00e6
make format
2020-02-01 10:28:10 -05:00
Jeff Becker
c014d21f84
use std::shared_ptr not a bare pointer to prevent memleak
2020-02-01 09:31:53 -05:00
Stephen Shelton
5631983716
Make format
2020-01-31 14:52:59 -07:00
Stephen Shelton
8921125924
Fix buffer overflow when version encodes too many integers
2020-01-31 14:48:00 -07:00
Jason Rhinelander
f1171ed7a2
make format 😠 🤮
2020-01-31 17:05:50 -04:00
Jason Rhinelander
46f3459b79
Fixed EncryptedIntroSet signing to use PrivateKey
...
We can generate both root and derived signatures from a PrivateKey, but
only root from a SecretKey, so just change it to use a PrivateKey.
2020-01-31 16:47:25 -04:00
Jason Rhinelander
cd8f26deff
Use hash instead of random for signing hash data
...
This makes PrivateKey store both the key followed by the hash. For
PrivateKeys based on SecretKeys this just means the second half of the
SHA-512 of the seed, and makes a PrivateKey constructed from a SecretKey
give an identical signature to signing directly with sodium.
For derived keys we use a ShortHash of the root key's signing hash
concatenated with the publicly known hash value, so that our derived key
signing hash will be different from the root signing hash and also
different for different derivation parameters.
This also changed one of the asserts in crypto_noop, but upon closer
inspection the copying of the secret key into the signature seems really
wrong, so just changed them to fill with 0s.
2020-01-31 16:47:25 -04:00
Jason Rhinelander
fe8a72750a
Silence unused parameter warning
2020-01-31 16:47:25 -04:00
Stephen Shelton
cfabe72587
Fix RouterVersion::IsEmpty() and RouterVersion::Clear()
2020-01-31 13:31:00 -07:00
Stephen Shelton
f0571a9f2c
Fix IsCompatableWith() logic WRT emptyRouterVersion, add unit tests
2020-01-31 13:23:48 -07:00
Thomas Winget
afd87eedb4
NO CLAMPS YOU IDIOT!!!
2020-01-31 12:05:27 -04:00
Thomas Winget
a487982c49
initial implementation of blinded sign -- not working yet
2020-01-31 12:05:20 -04:00
Jason Rhinelander
f7cd10a82e
Fix Recalculate()
...
Recalculate did what should have been the right thing but wasn't because
of libsodium's mislabelling the "seed" as the secret key.
2020-01-30 12:38:39 -04:00
Jason Rhinelander
860c5efd47
Derived key fixes
...
The reason things weren't working here is because libsodium does
something completely unintuitive and called the seed the "secret key"
when it isn't, it's the seed.
This adds a new PrivateKey class (alongside the existing SecretKey and
PubKey) that holds just a private key value but no seed -- which we need
to do because there is no way we can get a seed after calculating a
derived keypair.
With these changes, we now generate exactly the same keys and subkeys as
Tor (and a new test case uses values generated in Tor to verify this).
This is incomplete -- the subkey signing code is still not implemented;
it has to be adapted to create a signature from a PrivateKey rather than
a SecretKey which will probably requiring working around/reimplementing
some of what libsodium does for creating a signature since it expects
"secret keys" i.e. the seed.
2020-01-30 12:34:05 -04:00
Jeff Becker
0f13591802
does not work
2020-01-28 16:55:36 -05:00
Jeff Becker
99eb7726ff
initial dht key blinding
2020-01-27 16:30:41 -05:00
Jeff Becker
1543284f6b
make it compile
2020-01-27 11:56:07 -05:00
Jeff Becker
4f81b913ef
make router version member optional on serialization
2020-01-27 11:55:19 -05:00
Jeff Becker
9efd796145
initial wack at 0.7.0 dht fixes
2020-01-27 11:54:51 -05:00
jeff
f6813717b5
Merge branch '2020-01-25-router-version' of ssh://github.com/majestrate/loki-network into 2020-01-25-router-version
2020-01-25 14:05:35 -05:00
jeff
898c98b170
use double braces
2020-01-25 14:04:21 -05:00
Jeff Becker
bb6dce486f
don't use a pointer
2020-01-25 12:41:34 -05:00
Jeff Becker
8c82bfe5bf
operator !=
2020-01-25 12:39:00 -05:00
Jeff Becker
03c13f4261
make it compile
2020-01-25 12:38:12 -05:00
jeff
816070be62
dont inherit std::array
2020-01-25 12:21:28 -05:00
jeff
fa30a6f9b2
router version
2020-01-25 11:29:01 -05:00
jeff
f728e6016b
router version
2020-01-25 11:28:07 -05:00
Jeff Becker
b280bac141
don't always use bootstrap when exploring
2020-01-23 12:49:33 -05:00
Jeff Becker
7146857df6
use static initialization for started times
2020-01-23 12:14:26 -05:00
Jeff Becker
7aa1b2c27c
monotonic time and run testnet at 20% realtime
2020-01-23 12:14:25 -05:00
Jeff Becker
626b2a6196
return true
2020-01-23 12:10:58 -05:00
Jeff Becker
e87b754906
fix recursion depth on introset lookup
2020-01-23 12:10:58 -05:00
Jeff Becker
2c0dc12f39
refactor single char variables in DHT (mostly)
2020-01-23 12:10:58 -05:00
Jeff Becker
ae8bb3751b
connect to closest for RC lookups too
2020-01-23 12:10:58 -05:00
Jeff Becker
49f696de9c
connect to closer nodes for introset lookups
2020-01-23 12:10:57 -05:00
Jeff Becker
3b66cf6e75
dht fixes, disable iterative lookups on clients, revert "fixes" from 0.6.3, pass in recursion depth from introset lookup
2020-01-22 17:08:05 -05:00
Stephen Shelton
fba12093ac
Remove dead code (AbstractRouter::EnsureRouter())
2020-01-22 11:15:40 -07:00
Jeff
51e4b47cf8
Merge pull request #1061 from majestrate/fix-log-level-2020-01-20
...
configurable log level
2020-01-21 15:58:49 -05:00
Jeff Becker
1165466d56
don't deadlock when we want to remove lots of paths, flush queue instead when full
2020-01-21 12:28:23 -05:00
Jeff Becker
2f02073cac
unsigned char
2020-01-20 16:16:00 -05:00
Jeff Becker
c69eb2c970
off -> none
2020-01-20 16:12:19 -05:00
Jeff Becker
ef0595602b
reduce number of values for LogLevelFromString
2020-01-20 16:11:34 -05:00
Jeff Becker
40876a6e3f
configurable log level
2020-01-20 16:00:08 -05:00
Jason Rhinelander
95b0eeda29
Add support for lokid's "unchanged" response
...
If we pass the last block hash to lokid it can give us an "unchanged"
response instead of the service node states to tell us that there is no
updated needed.
2020-01-20 16:47:08 -04:00
Jason Rhinelander
1ba1e04390
Separate json SN parsing definition/declaration
...
No changes to code here (committing this separately to make the changes
in the following commit easier to follow).
2020-01-20 16:43:27 -04:00
Jeff Becker
c86fb19187
bump version for 0.6.4
2020-01-19 07:18:58 -05:00
Jeff Becker
12899701c5
inform congestion on tail drop
2020-01-18 17:03:24 -05:00
Jeff Becker
860891b6a6
tail drop
2020-01-18 16:59:50 -05:00
Jeff Becker
4185d47d4b
link layer message priority
2020-01-18 16:55:45 -05:00
Jeff
a681c28e5f
Merge pull request #1050 from majestrate/tweak-limits-2020-01-16
...
Tweak limits
2020-01-18 16:55:11 -05:00
Jeff Becker
c3f99e1b5c
make format
2020-01-18 16:53:42 -05:00
Stephen Shelton
f01392cc49
Start stale router lookup 5 minutes before its expiration
2020-01-18 14:37:42 -07:00
Stephen Shelton
9b00e6fa8d
Bump RC expiration constants significantly
2020-01-18 14:07:21 -07:00
jeff
79fd08e559
fix typo
2020-01-18 15:56:29 -05:00
jeff
4a761be52d
use std::chrono
2020-01-18 15:56:29 -05:00
Jeff Becker
fe148f7823
merge conflict fix
2020-01-18 15:55:50 -05:00
Jeff
493213717f
Merge pull request #1054 from notlesh/message-queue-stats-2020-01-17
...
Include outbound message queue stats in dumpState API response
2020-01-17 19:06:53 -05:00
Stephen Shelton
3cf4bd8f97
Lookup routers at maximum frequency of 10 minutes
2020-01-17 14:54:34 -07:00
Stephen Shelton
698dddc151
Use std::max() and make format
2020-01-17 11:19:53 -07:00
Stephen Shelton
5c518d6586
Include outbound message queue stats in dumpState API response
2020-01-17 10:14:24 -07:00
Stephen Shelton
169ece08e8
Fix HaveReceivedWhitelist() typo
2020-01-16 14:32:52 -07:00
Jason Rhinelander
a1333c901c
Merge pull request #1044 from notlesh/bump-version-0.6.3-2019-01-15
...
Bump version (0.6.3)
2020-01-16 01:08:30 -04:00
Jason Rhinelander
acd53f08b1
Merge pull request #1042 from jagerman/fix-jsonapi-bind-ip
...
Fix json api bind IP
2020-01-16 01:06:53 -04:00
Jason Rhinelander
ba89df40c8
Merge pull request #1041 from notlesh/dht-fixes-cleanup
...
Dht fixes cleanup
2020-01-16 01:04:51 -04:00
Stephen Shelton
2607bdbee6
Bump version (0.6.3)
2020-01-15 21:55:34 -07:00
Stephen Shelton
702c130020
Remove dead code in llarp_nodedb::Insert()
2020-01-15 21:44:25 -07:00
Jason Rhinelander
eadfeefafc
Merge pull request #1038 from majestrate/dht-disable-iterative-lookup-2020-01-14
...
disable iterative behavior in DHT
2020-01-16 00:22:12 -04:00
Jason Rhinelander
416c71e554
Fix json api bind IP
...
Only the port was being used, the IP was being ignored and it was always
binding to localhost.
2020-01-16 00:16:56 -04:00
Stephen Shelton
fbb274a724
Make format (mutter mutter)
2020-01-15 21:15:37 -07:00
Stephen Shelton
8206557ac7
Don't respect whitelist when we haven't received it yet
2020-01-15 21:12:38 -07:00
Stephen Shelton
c92e7ae5c7
Add warning when we found a null RC for a DHT lookup
2020-01-15 19:37:12 -07:00
Stephen Shelton
08149112b2
Randomize routers to explore in ExploreNetwork()
2020-01-15 19:16:18 -07:00
Jeff Becker
a17b5f25b5
check for zero'd rc
2020-01-15 10:43:21 -05:00
Jeff Becker
d9297a4907
log invalid signatures
2020-01-15 10:42:28 -05:00
Jeff Becker
4cb6301e28
use copy not move
2020-01-15 10:41:43 -05:00
Jeff Becker
c5feb07fb9
address feedback from tom
2020-01-14 15:48:39 -05:00
Jeff Becker
6fd714d193
contrib/testnet: fix up testnet config generator to make super centralized topology
...
llarp/context.cpp, llarp/nodedb.{h,c}pp: load netdb AFTER whitelist
llarp/router/router.cpp: explore always
llarp/router/{i,}rc_lookup_handler.{h,c}pp explore with whitelist, update routers with lookup before stale
2020-01-14 15:12:47 -05:00
Jeff Becker
9322df013b
check with rc handler before insert
2020-01-14 13:39:08 -05:00
Jeff Becker
2af64671bf
make it compile
2020-01-14 13:10:10 -05:00
Jeff Becker
0526fef37b
store RCs if valid
2020-01-14 13:08:27 -05:00
Jeff Becker
b56a3528db
periodic nodedb flush
2020-01-14 12:01:41 -05:00
Jeff Becker
495ad6d566
testnet patch
2020-01-14 07:07:29 -05:00
Jeff Becker
09f5f6dfa7
disable iterative lookup
2020-01-14 07:07:10 -05:00
Jeff Becker
c7b94f32be
reduce disk io
2020-01-12 07:30:03 -05:00
Jeff
0e2c5736a8
Merge pull request #1034 from majestrate/dht-timeout-fixes-2020-01-10
...
dht timeout tweak
2020-01-10 17:35:56 -05:00
Jeff
0ad2809ac7
Merge pull request #1033 from majestrate/prevent-segfault-2020-01-10
...
prevent segfault
2020-01-10 17:35:49 -05:00
Jeff Becker
78cdf8f96b
variable lookup timeout on participants
2020-01-10 11:23:30 -05:00
Jeff Becker
8bb492da6e
dht timeout tweak
2020-01-10 10:45:25 -05:00
Jeff Becker
77f0944d6d
use shared_from_this
2020-01-10 07:35:00 -05:00
Jeff Becker
78e325c4c5
always lookup introset from nearest router
2020-01-09 07:21:38 -05:00
Jeff Becker
2d82e931da
try doing lookup from close router, randomize when above lookup threshold
2020-01-09 06:26:41 -05:00
Jeff Becker
b2784dd5ec
explore faster
2020-01-09 06:14:04 -05:00
Jeff
ac46d99107
Merge pull request #1029 from majestrate/expire-snode-sessions-based-off-activity-2020-01-08
...
Expire snode sessions based off activity
2020-01-08 16:37:17 -05:00
Jeff Becker
eb174923ad
m_LastUse shouldn't be 0 ever now
2020-01-08 11:05:29 -05:00
Jeff Becker
1a80153352
mark used on costructed so it doesn't go away
2020-01-08 11:05:04 -05:00