| Commit message (Collapse) | Author | Age | Files | Lines |
| |\
| |
| |
| |
| | |
Implement EncodedAuthCert and use it in poc for votes
See merge request tpo/core/arti!3592
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | | |
|
| | |
| |
| |
| | |
Roughly as per the proposal in `doc/dev/notes/authcert-in-consensus.md`.
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We can use the real AuthCert now that it implements the parse2 traits.
The verification function is still used by poc's netstatus code and by
a test case.
We must change the field names in a few places, because the real
AuthCert's struct field names are the keywords, whereas the poc's are
the key names. (A shame that they're different!)
|
| | |
| |
| |
| |
| |
| |
| | |
Use accessors for the body.
(Eventually this function will replace, be replaced by, or merge with,
the existing signature code outside poc.)
|
| | | |
|
| | | |
|
| |/
|
|
|
|
|
| |
This commit changes `ErrorProblem::Other` to
`ErrorProblem::OtherBadDocument` while adding two new variants:
* `ErrorProblem::Internal`
* `ErrorProblem::BadApiUsage`
|
| |
|
|
|
| |
This lets us having document items that are "manually non exhaustive"
which is necessary for struct literal constructors.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
According to the spec we always use this fixed exponent, and we have a
minimum size of 1024. This is checked adhoc in the old parser with
some slight assistance from what is now `RsaPublicParse1Helper`.
It's not clear to me that checking the exponent is actually a good
idea. I think checking the size is probably a bad idea, and if it is
a good idea then 1024 is clearly too short.
But rather than revisit these questions, let's reproduce the old
behaviour in parse2.
In parse2 these checks should be features of the type.
|
| | |
|
| |
|
|
| |
This was missed, apparently.
|
| | |
|
| |
|
|
|
| |
Signature encoding is not yet supported. We need to consider how this
will work.
|
| |
|
|
|
|
|
|
| |
We want to recognise `#[deftly(netdoc(debug))]` because otherwise we
have to make lots of these attributes conditional.
So, implement it for *all* the derives, providing a nugatory debug
statement.
|
| | |
|
| |
|
|
| |
What is being written to here is StderrLock, not a String.
|
| |
|
|
|
|
| |
While testing I discovered that the `#[deftly(netdoc(debug))]`
feature (which dumps parsing progress to stderr) didn't compile if the
derive was invoked from elsewhere.
|
| |
|
|
|
|
| |
Code motion fromk NetdocParseableFields to NetdocFieldsDeriveCommon.
This uses the derive-deftly imported doc comment feature.
|
| |
|
|
| |
Code motion from NetdocParseable to NetdocEntireDeriveCommon.
|
| |
|
|
| |
Code motion from ItemValueParseable to NetdocItemDeriveCommon.
|
| |
|
|
|
|
|
|
| |
Code motion from NetdocParseable to NetdocEntireDeriveCommon.
Code motion from NetdocParseableFields to NetdocFieldsDeriveCommon.
Again, the encoder wants exactly this logic.
|
| |
|
|
|
|
|
| |
Code motion from NetdocSomeItemsParseableCommon to
NetdocSomeItemsDeriveCommon.
Encoding wants exactly the same logic.
|
| |
|
|
|
|
|
| |
There is nothing actually in any of these yet. But it is most
convenient to lay out the structure now.
We'll move code into these modules in forthcoming commits.
|
| |
|
|
|
|
|
|
| |
This is only used for structs which contain items, not item value
structs.
We need a name that reflects this, especially as we are going to add a
bunch more modules full of common macro elements.
|
| | |
|
| |
|
|
|
|
|
|
| |
This is quite like the one for parse2, but separate for Reasons.
Also add a bit of explanation to parse2's multiplicity.rs, about why
there are all these different FooSetMethods traits, which the encoder
doesn't need.
|
| |
|
|
|
|
|
| |
When we implemented this we documented it for ItemValueParseable but
forgot to do so for NetdocParseable.
Add some xrefs to the traits to try to stop similar mistakes.
|
| |
|
|
|
|
|
|
|
| |
This commit implements directory authority certificates using the
`parse2` approaches.
For now, those are in a module `doc::authcert::tmp`, with the eventual
goal of moving it into its super module after removing/deprecating the
legacy types.
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
This code sometimes expands to `let item = item;`. That's OK.
In derive-deftly 1.5.x the two `item` wrongly had different hygiene
span so the warning didn't trigger.
|
| |
|
|
|
| |
As per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3502/diffs?commit_id=f9a6d90ec6d5abf2958534d2c100c84f325e3634#2525aaf11b44162850101813478c4734160e11fa_920_919
|
| |
|
|
|
|
| |
The error is not really discarded (which would seem to mean ignoring
it). The erorr *value* is discarded and is replaced with a less
informative error value.
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
The path in `with` must always be a module, not a function, because we
need to use it for encoding too.
In the case of `rest`, it's probably sensible to require a different
function name, given that the semantics are subtly different to those
of `rest` without `with`, since the latter can only get a single word
but with `rest` you get the whole line.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
This commit moves the "Naming Convention" of the parse2::poc module into
the respective module, as it does not apply to parse2 itself, as
outlined in arti!3462.
With this commit, there remains `NdaSystemTimeDeprecatedSyntax` as the
only type outside poc following this naming schema. However, because it
is more or less already deprecated anyways, there is no real need to
bother with it any further.
|
| |
|
|
|
| |
This is in the ItemValueParseable derive, so the individual fields are
Arguments, not Items.
|
| | |
|
| |\
| |
| |
| |
| | |
tor-netdoc: Move parse2/test.rs to test2.rs
See merge request tpo/core/arti!3486
|
| | |
| |
| |
| |
| |
| |
| | |
We're going to use this for the encoder testing too, so it needs to be
not buried inside parse2.
This commit is the file rename plus minimal changes to make it compile.
|
| |\ \
| |/
|/|
| |
| | |
tor-netdoc: parse2: Combine MultiplicitySelector
See merge request tpo/core/arti!3478
|
| | | |
|
| | |
| |
| |
| |
| | |
There is no conflict between the different uses. Having just one type
makes things simpler.
|
| | |
| |
| |
| |
| |
| |
| | |
We're going to combine all the Selector types, so it won't be able to
have these.
The diff is misleading: it's docs for the Selectors that's moving.
|