summaryrefslogtreecommitdiff
path: root/crates/tor-cert/src/encode.rs
Commit message (Collapse)AuthorAgeFilesLines
* Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-101-0/+1
|
* Replace usage of KeyUnknownCert::check_key.Nick Mathewson2023-05-161-1/+1
|
* Use the type system to enforce use of blinded keys.Gabriela Moldovan2023-03-271-4/+6
| | | | | | | | | | | | | | | Hidden services use blinded singing keys derived from the identity key to sign descriptor signing keys. Before this patch, the hidden descriptor builder represented its blinded signing keys (`blinded_id`) as plain `ed25519::Keypair`s. This was not ideal, as there was nothing preventing the caller from accidentally initializing `blinded_id` with an unblinded keypair. This introduces a new `HsBlindKeypair` type to represent blinded keypairs. Signed-off-by: Gabriela Moldovan <[email protected]>
* Allow clippy::unchecked_duration_subtraction in testsNick Mathewson2023-01-271-0/+1
| | | | | This panics on error, and we're fine with a panic on misbehavior in tests.
* test lint blocks: Add many many automaticallyIan Jackson2022-12-121-0/+9
| | | | | This is precisely the result of running the rune in maint/adhoc-add-lint-blocks.
* Work around a new nightly clippy warningNick Mathewson2022-09-301-1/+1
| | | | | | | | | | | | | | The warning `clippy::bool_to_int_with_if` is meant to shout at you when you say `if x { 1 } else { 0 }` and instead suggest that you say `inttype::from(x)`. I agreed with this for the case in tor-cert, where we are literally converting a boolean into a flag. I don't agree with this in tor-netdoc, where we are using a boolean to decide how many fields to skip in a given document format. So for this case, I decided to clean up the code a little by renaming "skip" to "n_skip", and changing the boolean to use an enum instead.
* change usage of PublicKey to Ed25519 in tor-certtrinity-1686a2022-07-231-6/+6
| | | | and propagate to other affected crates
* change check_key to take a Option<&_> instead of &Option<_>trinity-1686a2022-07-231-1/+1
|
* tor-cert: Remove all usage of infallible writers.Nick Mathewson2022-07-111-1/+1
|
* tor-cert: Encoding now uses Writeable trait.Nick Mathewson2022-07-111-23/+18
| | | | This lets us remove a few TODOs.
* Rename "write" methods on tor-bytes to "write_infallible".Nick Mathewson2022-07-111-1/+1
| | | | | | | | | | | | | | | This comprises four renames: ``` write_onto -> write_onto_infallible write_into -> write_into_infallible write -> write_infallible writer_and_consume -> write_and_consume_infallible. ``` The rest of this branch will be concerned with replacing these `_infallible` methods with ones that return a `Result`. This is part of #513.
* Implement functionality to construct signed Ed25519 certs.Nick Mathewson2022-07-061-0/+200
This is behind a feature flag, since it isn't needed for pure clients: only onion services and relays need this. I've named the object that constructs these certs `Ed25519CertConstructor` because it doesn't follow the builder pattern exactly: mainly because you can't get an Ed25519Cert out of it. _That_ part is necessary because we require that an Ed25519Cert should only exist if the certificate was found to be well-signed with the right public key. Closes #511.