| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| |
|
|
|
| |
This derives Eq for Nickname because we will need it for unit tests that
will be added later on.
|
| |
|
|
|
|
| |
This type comes from the specification and indicates overload
information about a relay. We will use it in router descriptors at one
point, hence why we are adding it already.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit adds a new type, NumericBoolean, which implements
NormalItemArgument in order to be parseable with parse2.
It works very simple, namely it can be used to decode/encode a boolean
as a `0` (false) or `1` (true) which is found in a few places around
tor-netdoc.
The reason why this is its own type instead of implementing
NormalItemValue for the bool primitive is, that booleans are special
numerical types and to be future-proof against other oddities, a
separate wrapper type makes most sense.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
We don't need the helper struct for this.
|
| | |
|
| |
|
|
|
|
| |
Start a new encode_impls module.
The pub(super) will be used in a moment.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
Ie for "arguments" that don't actually appear.
|
| |
|
|
|
|
|
|
| |
This will let us use it in more places, more sensibly.
Sadly it means a lot of syntactic vinegar at many of the call sites in
the old parser, which has very janky ideas about how errors should
work.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
Test the parsing and printing success cases.
Given that the parsing implementation is just a wrapper around B16's,
we don't need explicit tests for that.
|
| |
|
|
|
| |
Make this a public BytesTransparent newtype like B64, implementing all
the same traits etc.
|
| |
|
|
|
|
|
|
| |
Firstly, make its field pub.
Secondly, make the into_array method crate-private. It has a
crate-specific (albeit public) error type, The same basic effect can
be achieved with methods from std on arrays and slices.
|
| |
|
|
|
|
| |
Make this type public.
The new macro call means this type now implements many more traits.
|
| |
|
|
|
| |
I think these are all the traits that a parsing/printing newtype
adapter ought to implement.
|
| | |
|
| |
|
|
| |
Callers now have to use PortRange::new which checks the input.
|
| |
|
|
|
|
| |
This commit removes the implementation of ItemArgumentParseable for
curve25519::PublicKey in favor of using the already existing
Curve25519Public, which also got beefed up slightly.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This commit fixes a bug in the microdescriptor parser to properly parse
multiple family-ids.
Previously, we interpreted the spec to simply contain multiple
`family-ids` lines. This is wrong however. Instead, there may only be
a single such line with multiple values.
To fix this issues, we itnroduce a `RelayFamilyIds` type, similar to
`RelayFamily`, that stores multiple `RelayFamilyId` entires in a `Vec`.
Then, we just derive `ItemValueParseable` on it and win.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This makes it possible to parse2 micro descriptors, which will be very
useful later on.
For this, it makes a few changes. Most notably, it introduces a
(private) field called `onion_key`, which stores an optional RSA onion
key, as it serves as the introduction line for this netdoc document
type. Besides, it also changes the `ed25519_id` type to the
`Ed25519IdentityLine` wrapper type, although the signature of the
respective getter remains the same.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
This method verifies all the signatures, and checks that the signing
authority is in the provided list. Anyway, authcerts aren't really
self-signed: they're a signature by KS_auth_id_rsa on
KP_auth_sign_rsa.
Note that there is also a `verify_selfcert` method which does only
some of the checks, and has some code duplication. That will be
cleaned up later.
|
| |
|
|
|
|
|
|
|
|
|
| |
With the introduction of the derives for document encoding, we now
have a trait ItemObjectEncodable. We will want a method on
ItemEncoder that takes an ItemObjectEncodable, and that should be
called `object` since it's a better approach than working ad-hoc with
tor_bytes::Writeable. (For example, an ItemObjectEncodable knows its
own label.)
So, rename `object` to `object_bytes`.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
This was a weird name, and while working in this area it all seemed to
make the docs strange.
Rename it. This is quite invasive!
In theory we could have the macros generate compatibility aliases, but
that seems quite complex.
|
| | |
|
| |
|
|
| |
As per doc/dev/notes/authcert-in-consensus.md.
|
| |
|
|
|
|
|
|
| |
The string so far is exposed already via whole_for_signatures.
It is unusual for a doc parser to need this, but embedded documents
can use this plus byte_position to get the original input text for
their part of the outer document.
|
| | |
|
| |
|
|
|
| |
Fix the conflict in tor-netdoc/semver.md by hand, including the new
entries already landed since v1.9.0.
|
| | |
|
| | |
|
| |
|
|
| |
There are no in-tree callers.
|
| |
|
|
|
| |
AuthCert is about to lose its copy of H(KP_auth_sign_rsa) so it needs
to return an owned value.
|