Commit Graph

48 Commits

Author SHA1 Message Date
Nick Mathewson 1dc3fc214a Implement From, not Into.
These traits are inverses of one another, but implementing From is
always preferred since rust 1.41 relaxed the "orphan rules".
2020-10-19 17:40:43 -04:00
Nick Mathewson f3e1fafca2 Validate master-key-ed25519 field in routerdescs 2020-10-19 09:44:38 -04:00
Nick Mathewson 295a791a82 Improvements to Relay type in tor-netdir.
Now, a Relay is always valid.  This required some changes to the
API: all_relays() has to return a new UncheckedRelay type that might
or might not be valid, and the functions on Relay and ChanTarget
that return ed25519 identities need to return an Ed25519Identity,
not an ed25519::PublicKey.

This change required some new encoding/decoding/conversion functions
on Ed25519Identity.
2020-10-19 09:22:49 -04:00
Nick Mathewson 1abd93d696 Clarify kludgey magic in our to_der() function. 2020-10-18 16:50:40 -04:00
Nick Mathewson 3408c9ad26 Run "cargo upgrade". 2020-10-15 13:32:02 -04:00
Nick Mathewson 6f75b82ef3 Use Ed25519Identity in microdescriptors. 2020-10-15 12:42:09 -04:00
Nick Mathewson c00f1671a2 Add an (unchecked) Ed25519Identity type
This type differs from ed25519::PublicKey in that it is _not_
checked or expanded.
2020-10-15 12:15:51 -04:00
Nick Mathewson 85151085ec llcrypto: Move ed25519 module into its own file. 2020-10-15 11:45:06 -04:00
Nick Mathewson 02e5380a73 tests for some failing cases in mdconsensus 2020-10-06 14:12:43 -04:00
Nick Mathewson 17273d38d9 Make rsa::PublicKey derive Debug. 2020-10-02 14:03:15 -04:00
Nick Mathewson 610739c139 Enable batch ed25519 verification. 2020-10-02 11:53:50 -04:00
Nick Mathewson a3143ab960 Run cargo upgrade. 2020-09-26 14:20:28 -04:00
Nick Mathewson f945af0c41 Document private members in most crates 2020-09-24 19:25:37 -04:00
Nick Mathewson 0c131dc080 Run cargo upgrade 2020-09-21 13:45:36 -04:00
Nick Mathewson 963ab969cf Add test for failing RSA identity construction 2020-09-13 17:44:34 -04:00
Nick Mathewson 41ca4eb154 Add some test vectors for rsa, taken from chutney 2020-09-13 17:39:01 -04:00
Nick Mathewson 9a94f11938 Now that the rsa crate has pkcs1 decoding, use it.
Also, instead of implementing an otherwise-derivable Hash for rsa
public keys, tell clippy not to worry that we're defining
partialeq but not hash.
2020-09-13 17:37:11 -04:00
Nick Mathewson dcc155027d stop exposing rsa::errors::Result. 2020-09-13 13:04:19 -04:00
Nick Mathewson fe5a05497f Add unit test for ValidatableEd25519Signature 2020-09-13 12:41:59 -04:00
Nick Mathewson 2040db71d0 Add test vectors for curve25519->ed25519 parts of llcrypto
Also add a terminating NUL byte to a derivation string, to ensure
that our results match Tor's results.  (This does not actually serve
a purpose FWICT.)
2020-09-13 12:10:56 -04:00
Nick Mathewson 6c4944ab3e llcrypto: Fix a bug in ed25519->curve25519 secret key conversion
We were taking the sign bit from the _secret_ key, which is totally
incorrect.  Instead it needs to be taken from the _public_ key.

Additionally, add a unit test for ed25519->curve25519 code.
2020-09-13 12:10:56 -04:00
Nick Mathewson 8fee269f94 llcrypto: tests for rsa kludge 2020-09-13 12:10:56 -04:00
Nick Mathewson ee71abe560 Pare down and sort dependencies 2020-09-09 19:17:49 -04:00
Nick Mathewson 9f30b47cb7 Run cargo upgrade, except for stream-cipher. 2020-09-09 19:06:00 -04:00
Nick Mathewson e95dec2437 cargo fix --edition-idioms 2020-09-09 18:59:04 -04:00
Nick Mathewson e02255ec00 Also RSA identities on channel handshakes
This took a good bit of hacking, including a kludge to extract an
RSA subject key from an x509 cert, since we didn't have a good way
to do that.
2020-09-09 18:08:33 -04:00
Nick Mathewson b7b5d92847 Fix bogus docs in ll::pk::rsa 2020-09-09 16:58:35 -04:00
Nick Mathewson a4f1b27334 Fix clippy warnings; improve key type for consensus. 2020-09-07 17:27:29 -04:00
Nick Mathewson 3df3198363 RSAIdentity: Better Display and Debug. 2020-09-07 17:15:03 -04:00
Nick Mathewson b3358673b5 Migrate certificate and routerdesc checking to tor-checkable
Now these types are parsed and returned wrapped inside a checkable
object.
2020-09-03 14:45:46 -04:00
Nick Mathewson 4ec97aa613 llcrypto: Define a "ValidatableSignature" type
This type wraps a signature, a public key, and the signed object.
It's meant to be useful for implementing SelfSigned objects.
2020-09-03 10:34:40 -04:00
Nick Mathewson 790d6becf2 Implement an ersatz hash() for RSAIdentity
For whatever reason, something I had didn't like me implementing a
custom PartialEq but deriving Hash
2020-08-28 18:16:56 -04:00
Nick Mathewson 4b75c51882 Run cargo-upgrade. 2020-08-28 18:14:17 -04:00
Nick Mathewson f55f86c6a8 llcrypto: add test vectors for sha3 and shake 2020-08-28 17:47:16 -04:00
Nick Mathewson e221146d9e llcrypto: make RSAIdentity implement the Hash trait. 2020-08-27 12:54:07 -04:00
Nick Mathewson 173bec26a5 Update to latest packages; ed25519 now needs signature crate traits. 2020-07-20 20:55:03 -04:00
Nick Mathewson c602883881 Use "cargo upgrade" from cargo-edit to list current versions 2020-06-12 21:06:07 -04:00
Nick Mathewson 32ecff11eb Upgrade to latest version of rsa crate 2020-06-12 21:05:01 -04:00
Nick Mathewson 6264041b77 update to use latest rust-crypto traits and modules 2020-06-10 14:16:07 -04:00
Nick Mathewson 75d24e6742 llcrypto: test vectors for sha2 2020-05-21 13:27:48 -04:00
Nick Mathewson 641576aa44 Use links for traits in llcrypto docs 2020-05-08 22:32:17 -04:00
Nick Mathewson f24ddf0682 Upgrade to a modern version of "sha-1".
Apparently the "sha1" crate doesn't implement the RustCrypto
API, but the "sha-1" crate does.
2020-05-08 22:32:17 -04:00
Nick Mathewson 75a1269429 make id field in RSAIdentity private 2020-05-08 22:32:17 -04:00
Nick Mathewson b48597fb18 most missing docs for llcrypto 2020-05-08 22:32:17 -04:00
Nick Mathewson 3c7f75302b Stop re-exporting traits from tor-llcrypto. It does not help. 2020-05-08 22:32:17 -04:00
Nick Mathewson dd17ba05d0 llcrypto: small documentation improvements 2020-05-08 22:32:17 -04:00
Nick Mathewson d0af946b9b Use cargo-husky to add automatic git commit/push hooks. 2020-05-08 22:21:47 -04:00
Nick Mathewson bbcbf47902 Fresh git repository for work on "arti"
Arti is a rust tor implementation.  It's project I've been working
on for a few months now, in weekends and in spare time.  It doesn't
speak the tor protocol yet, and it doesn't connect to the network at
all.

It needs much more documentation and testing, but I'm just about
ready to show it to others.  See the README.md for a description of
what is there and what isn't.
2020-05-07 19:58:14 -04:00