Commit Graph

23 Commits (dfb62d06ce44b1c0032311e11a86273a76836e13)

Author SHA1 Message Date
Jason Rhinelander dfb62d06ce Shut up noisy catch tests 3 years ago
Jason Rhinelander d03066ee05
Support [dns] no-resolvconf option (ignored by lokinet) for deb compatibility (#1362)
* Add ignored [dns]no-resolvconf option for deb backwards compat

The debs hack a `#no-resolvconf=1` into the config file in 0.7 to allow
a user to disable resolvconf setup during startup by uncommenting it.
That doesn't work anymore since 0.8 errors on invalid config options, so
add it as an ignored option so that 0.7 deb config files can still be
compatible.

* Fix `[dns]upstream` comment not being produced in generated conf file

* fix test

Co-authored-by: Jeff <jeff@i2p.rocks>
4 years ago
Jeff c91e4df856
make errors with service keyfile throw (#1358) 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
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
Jeff Becker 9153f726c5 const correctness 4 years ago
Thomas Winget a487982c49 initial implementation of blinded sign -- not working yet 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 4 years ago
Jeff Becker 99eb7726ff
initial dht key blinding 4 years ago
Stephen Shelton 2c6226f54a Backup SNApp keys when migrating to new ed25519 crypto 5 years ago
Michael a62655d501
Move tests to use top-level LlarpTest 5 years ago
Michael 491fee206b
Port code to use CryptoManager over passing Crypto pointers 5 years ago
Rick V f0a4b93431
fix
(cherry picked from commit 0d2e1da774580917dcf6a05c6be81ebfe823adef)
5 years ago
Michael a83be769e2
More explicit error when keyfile is not a valid file 5 years ago
Michael 9ee525a006
Fix shadowing warnings 5 years ago
Michael 98e691f315
Tidy up more parts of the service/ directory 5 years ago
Jeff Becker c910a2a2fb
more 5 years ago
Michael f24f554a01
Convert llarp::Crypto into an abstract base class 5 years ago
Michael 04e0fe3ad7
Move crypto code to a subdirectory 5 years ago
Michael 081d4dfa32
Reorganise source into more folders 5 years ago
Michael fa2b466ffe
Reorganise tests to mirror source layout 5 years ago