Commit Graph

32 Commits (dev)

Author SHA1 Message Date
Jeff Becker 4508c59cd3
redo includes to be consistent 1 year ago
Jason Rhinelander 9a2cd19eb8
Fix obsolete oxenmq/hex.h usage 2 years ago
Jeff 8d1d1d0b57 make unit tests happy 2 years ago
Jason Rhinelander c82ade2d81
Make test code work with new logging 2 years ago
Jeff Becker fedc56e3f1
initial commit for #1595 3 years ago
Jeff Becker 54c56a6d28
remove references to lokimq namespace
these were not found during the first passes and now that lokimq is gone from my machine this failed to compile
3 years ago
Jason Rhinelander dfb62d06ce Shut up noisy catch tests 3 years ago
lyyn ece91e87fc
Migrate tests from gtest to catch2 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 21930cf667
LNS (#1342)
* initial relay side lns

* fix typo

* add reserved names and refactor test for dns

* lns name decryption

* all wired up (allegedly)

* refact to use service::EncryptedName for LNS responses to include nonce with ciphertext

* fully rwemove tag_lookup_job

* replace lns cache with DecayingHashTable

* check for lns name validity against the following rules:

* not localhost.loki, loki.loki, or snode.loki

* if it contains no dash then max 32 characters long, not including the .loki tld (and also assuming a leading subdomain has been stripped)

* These are from general DNS requirements, and also enforced in
registrations:

* Must be all [A-Za-z0-9-]. (A-Z will be lower-cased by the RPC call).

* cannot start or end with a -

* max 63 characters long if it does contain a dash

* cannot contain -- in the third and fourth characters unless it starts with xn--

* handle timeout in name lookup job by calling the right handler with std::nullopt
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
Jeff Becker fea64eaf12
handle subdomains 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