Commit Graph

5044 Commits (702ab29ce4568844e061735fe3d4124b0b50418e)
 

Author SHA1 Message Date
Jeff 702ab29ce4
Merge pull request #1080 from majestrate/fix-kdf-2020-02-03
don't derive x25519 key from ed25519 key
4 years ago
Jeff Becker 1318846a08
test/service/test_llarp_service_identity.cpp:
* remove failing irrelevent test
* add expect_call in EnsureKeys to match expected bevahior
4 years ago
Jeff Becker e6174efa21
don't derive x25519 key from ed25519 key 4 years ago
Jeff c122b460e1
Merge pull request #1075 from jagerman/dht-blinding
Dht blinding
4 years ago
Jason Rhinelander 73239f4c39 Use glob to find sodium source files
Manually changing the list every time we want to change the libsodium
version is painful.

I tested this glob against libsodium 1.0.17 and verified it produces the
same set of files (aside from the generated version.h), and that in
1.0.18 it produces the same set modulo upstream files removed/added.
4 years ago
Jason Rhinelander b72a4296b7 Fix libsodium 1.0.18 URL 4 years ago
Jeff c8417a7270
Merge pull request #1076 from majestrate/plug-memory-leak-2020-02-01
use std::shared_ptr not a bare pointer to prevent memleak
4 years ago
Jason Rhinelander 2b93ccb393 Bump libsodium required version to 1.0.18
We use crypto_core_ed25519_scalar_mul which is only exported by
libsodium >= 1.0.18.
4 years ago
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.
4 years ago
Jason Rhinelander 739ce92aeb Remove unused ristretto includes 4 years ago
Jeff Becker ee752c00e6
make format 4 years ago
Jeff Becker c014d21f84
use std::shared_ptr not a bare pointer to prevent memleak 4 years ago
Jason Rhinelander f1171ed7a2 make format 😠 🤮 4 years ago
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.
4 years ago
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.
4 years ago
Jason Rhinelander fe8a72750a Silence unused parameter warning 4 years ago
Jeff Becker 9153f726c5 const correctness 4 years ago
Thomas Winget afd87eedb4 NO CLAMPS YOU IDIOT!!! 4 years ago
Thomas Winget a487982c49 initial implementation of blinded sign -- not working yet 4 years ago
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.
4 years ago
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.
4 years ago
Jeff Becker 0f13591802
does not work 5 years ago
Jeff Becker 99eb7726ff
initial dht key blinding 5 years ago
Jeff Becker 1543284f6b
make it compile 5 years ago
Jeff Becker 4f81b913ef
make router version member optional on serialization 5 years ago
Jeff Becker 9efd796145
initial wack at 0.7.0 dht fixes 5 years ago
jeff f6813717b5 Merge branch '2020-01-25-router-version' of ssh://github.com/majestrate/loki-network into 2020-01-25-router-version 5 years ago
jeff 898c98b170 use double braces 5 years ago
Jeff Becker bb6dce486f
don't use a pointer 5 years ago
Jeff Becker 8c82bfe5bf
operator != 5 years ago
Jeff Becker 03c13f4261
make it compile 5 years ago
jeff 816070be62 dont inherit std::array 5 years ago
jeff fa30a6f9b2 router version 5 years ago
jeff f728e6016b router version 5 years ago
Jeff 227926a525
Merge pull request #1071 from majestrate/dont-always-use-bootstrap-in-explore-2020-01-23
don't always use bootstrap when exploring
5 years ago
Jeff Becker b280bac141
don't always use bootstrap when exploring 5 years ago
Jeff 68b22735d9
Merge pull request #1070 from majestrate/monotonic-time-2020-01-23
make all timestamps monotonic and run loopback testnet at 1/5 speed
5 years ago
Jeff Becker 7146857df6
use static initialization for started times 5 years ago
Jeff Becker 7aa1b2c27c
monotonic time and run testnet at 20% realtime 5 years ago
Jeff 0edad0a817
Merge pull request #1069 from majestrate/refactor-single-char-variables-2020-01-23
Refactor single char variables in dht messages
5 years ago
Jeff Becker 626b2a6196
return true 5 years ago
Jeff Becker e87b754906
fix recursion depth on introset lookup 5 years ago
Jeff Becker 2c0dc12f39
refactor single char variables in DHT (mostly) 5 years ago
Jeff Becker ae8bb3751b
connect to closest for RC lookups too 5 years ago
Jeff Becker 49f696de9c
connect to closer nodes for introset lookups 5 years ago
Jeff Becker 3b66cf6e75
dht fixes, disable iterative lookups on clients, revert "fixes" from 0.6.3, pass in recursion depth from introset lookup 5 years ago
Jeff d059723f30
Merge pull request #1066 from notlesh/remove-dead-code-2020-01-22
Remove dead code (AbstractRouter::EnsureRouter())
5 years ago
Stephen Shelton fba12093ac
Remove dead code (AbstractRouter::EnsureRouter()) 5 years ago
Jeff 51e4b47cf8
Merge pull request #1061 from majestrate/fix-log-level-2020-01-20
configurable log level
5 years ago
Stephen Shelton 9a65f19bb0
Add test to ensure config loading impacts runtime log level 5 years ago