| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| |
|
|
|
|
|
| |
In order to handle marked vs unmarked SHA1 correctly, it needs the
original DigestAlgoInSignature.
The only call site is in poc's verification code.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use prod's Signature instead.
This gets rid of:
* The old parsing code. We have a new approach based on
ItemValueParseable, KeywordOrString and and DigestAlgoInSignature.
* The duplicate DirectorySignaturesHashesAccu and its temporary conversions.
poc's verify_timeless function needs a little adjustment for the new
struct layout.
|
| |
|
|
|
|
| |
This function is not right, yet. We're going to fix it later.
Review with --color-moved.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This now contains the hashing code that was in poc.
In poc it was entangled with the signature type, mostly because once
upon a time the hash was inside the signature.
In the real code we can make it a standalone method. It takes
DigestAlgoInSignature so that it will be able to handle the explicit
vs implicit sha1 anomaly correctly - but it can't do that yet because
the necessary field doesn't exist yet.
Also, we are going to want to make it a bit lazier - preserve the
MR-blocking todo for that.
A handful of lines are being actually moved verbatim,
so --color-moved may help a bit.
|
| |
|
|
|
|
|
| |
There are definitely some things wrong with this, but they all have
MR-blocking TODOs so we can promote this type now.
Largely code motion. Review with --color-moved.
|
| | |
|
| |
|
|
|
|
| |
Because we have two DirectorySignatureHashAlgo types because of the
macrology problem, we need to introduce temporary conversions, to let
us move code from poc to prod.
|
| | |
|
| |
|
|
|
| |
We're going to fix this in this branch, as part of promoting the poc
code to prod.
|
| |
|
|
| |
There isn't a "this" here; self is DirectorySignaturesHashesAccu.
|
| | |
|
| | |
|
| |
|
|
| |
And remove a then-unneeded import in a using module.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
We want DirectorySignatureHashAlgo for prod's directory Signature
type.
However, for complex cfg gate and macro scoping reasons, we can't just
move the definition out of poc. Hence this rather unpleasant
intermediate state. This will go away, and become normal again, when
we can abolish poc's signatures and have poc use a prod signature
type.
Review with
git show --color=always --color-moved-ws=allow-indentation-change --color-moved
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
This allows implementing NormalItemArgument for types that can only be
parsed, or only displayed - or other combinations.
I noticed this restriction while inventing a type I later decided was
unnecessary. I still think it's a good change.
There is no practical impact elsewhere, since in practice downstream
code implements NormalItemArgument rather than relying on it.
|
| |\
| |
| |
| |
| | |
tor-netdoc: Parsing and encoding for netstatus authority sections
See merge request tpo/core/arti!3892
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Replace poc code with new ConsensusAuthoritySection.
This is an entirely new parsing approach.
Key differences:
* We parse the arguments to dir-source, which poc didn't.
* We don't clone the input and fully parse the first item; instead,
we dismantle the dir-source line ad-hoc to determine the item type.
* Rather than a Vec of Enums, we parse into two Vecs
of the different entry types.
The few lines that aren't rewritten show up as moved in
git show --color-moved --color-moved-ws=allow-indentation-change
but I suggest reviewing the new implementation de novo.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Almost entirely code motion. Review with --color-moved.
This is new correct for votes, and uses the non-poc names for things.
We'll improve up a few minor things in a moment.
The cfg situation is getting very tangled. There are already various
TODOs about this. I think it is time to bite the bullet; I will do
that separately from this MR.
|
| | |
| |
| |
| |
| | |
Prepare for the namespace environment in the mainline doc/netstatus
modules. (Add a couple of temporary use's.)
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We are going to move this code to the main doc/netstatus modules.
Rename the struct and its associated derive macro, to the naming
approach used outside poc.
We leave a `use` behind in poc. That can remain until poc is
eventually abolished.
|
| | |
| |
| |
| |
| | |
Purely whitespace change: deindent certain lines by 4.
`git show -w` is helpful.
|
| | |
| |
| |
| |
| |
| | |
This has a side effect of testing the parsing.
(Testing of the encoding will have to come a lot later.)
|
| | |
| |
| |
| | |
We'll want this with Constructor's __non_exhaustive.
|
| |/ |
|
| | |
|
| | |
|
| | |
|
| |\
| |
| |
| |
| | |
Add debugging support to ItemValueParseable derive
See merge request tpo/core/arti!3881
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
With
cargo test --all-features -p tor-netdoc -- --no-capture test2
the output now contains, amongst many other things:
netdoc TestItem parse: item start, "test-item", "N", Some("TEST OBJECT")
netdoc TestItem parse: field needed, normal, args=1, "N"
netdoc TestItem parse: field optional, normal, args=Option<_>, ""
netdoc TestItem parse: field rest, normal, args=Vec<_>, ""
netdoc TestItem parse: field object, object, object=1, Some(("TEST OBJECT", Ok(5)))
netdoc TestItem parse: item complete Ok
|
| | | |
|
| | |
| |
| |
| | |
So far this just abolishes a duplicate P.
|
| | |
| |
| |
| |
| |
| |
| | |
We're going to want tio reuse dtrace from here in the
ItemValueParseable derive (which doesn't use
NetdocSomeItemsParseableCommon because it derives for one item type,
not a document containing multiple items).
|
| | | |
|
| | | |
|
| | |
| |
| |
| | |
Ie for "arguments" that don't actually appear.
|
| |\ \
| | |
| | |
| | |
| | | |
tor-netdoc: derives: Three small improvements
See merge request tpo/core/arti!3887
|
| | | |
| | |
| | |
| | |
| | |
| | | |
This can't trigger, but when messing about with some new features,
I messed up and got a syntax error here. Let's try this feature out,
here.
|
| | |/
| |
| |
| | |
No functional change.
|
| |/
|
|
| |
When we can't parse a NormalItemArgument, that's Invalid, not Missing.
|
| |\
| |
| |
| |
| | |
Fix the testdata2 situation
See merge request tpo/core/arti!3861
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
These tests got broken due to the replacement of the testdata.
The changes required to make them work again were trivial, namely to
increase a timestamp by two hours in a consensus, as the new consensus
has a `valid-after 2000-01-01 00:02:20` followed by a fingerprint
replacement for a directory authority because the authority identity
keys were obviously also rotated.
|
| |\ \
| | |
| | |
| | |
| | | |
tor-netdoc: Three fixes to parsing and encoding
See merge request tpo/core/arti!3862
|
| | |/ |
|
| | | |
|
| |/
|
|
|
|
|
|
|
|
|
| |
The `doctype_for_error` attribute needs immediate adjustment, because
a string expression value is expected. With `quoted retain`, that
would be re-interpreted, silently. This kind of thing is why
`quoted rigorous` exists.
So change its docs and the one use site.
The macros' docs, and the other calls ites, we'll deal with shortly.
|
| |
|
|
|
|
| |
This commit removes the implementation of ItemArgumentParseable for
curve25519::PublicKey in favor of using the already existing
Curve25519Public, which also got beefed up slightly.
|
| | |
|
| | |
|
| |
|
|
| |
No change to the generated docs.
|