| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| | |/
| |
| |
| | |
T_SIGNATURES is false, just above.
|
| |\ \
| | |
| | |
| | |
| | | |
tor-netdoc: parse2: Fix error for invalid item argument
See merge request tpo/core/arti!3879
|
| | |/
| |
| |
| | |
When we can't parse a NormalItemArgument, that's Invalid, not Missing.
|
| | |
| |
| |
| |
| | |
I also searched this file for FromStr impls and these types were the
only ones that ought to be NormalItemArgument but weren't.
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| | |
Unfortunately one derive can't invoke another, so we must open-code
them, just like the other traits.
|
| | |
| |
| |
| |
| |
| |
| | |
Nothing derives just Transparent yet.
Mostly code motion, with some additional furniture and docs.
Review with git show --color-moved.
|
| | |
| |
| |
| |
| |
| | |
This error message is going to be used by both Transparent and
BytesTransparent. Put it in the code that is going to be part of
Transparent, and remove the macro name from it.
|
| | | |
|
| | |
| |
| |
| | |
This reduces clutter some more.
|
| | |
| |
| |
| |
| |
| | |
This is in the use's at the top of the file. If we `use super::*`
(like we do in the newer modules): the code can get a lot more
readable.
|
| | |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| |
| |
| |
| |
| | |
On reflection, and looking at the test cases, I think the name `B16`
should refer to the lowercase version. I'll introduce a type for
uppercase in a moment.
Test the display implementation.
|
| | |
| |
| |
| |
| |
| |
| | |
Replace the open-coded .parse() calls with a closure.
This will let us test round trips, other types, etc., for each pairs
of test values.
|
| | |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| |
| |
| |
| | |
Actually make the macro be a proper d-d macro. Replace uses of .0
with $fname, B64 with $ftype, etc.
No functional change in this commit.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Break various open-coded impls on B64 into this macro. That will let
us reuse this code for other types, making all these bytes wrappers
similar to each other.
In this commit, we just move the code. The macro is wrong because it
ought to refer to $ttype and so on. Review with git show --color-moved.
No functional change in this commit.
|
| | |
| |
| |
| |
| | |
This is slightly more logical and will make the next commit slightly
easier to read.
|
| |/
|
|
| |
This will reduce some duplication and simplify some macrology.
|
| |\
| |
| |
| |
| | |
tor-netdoc: ContactInfo
See merge request tpo/core/arti!3866
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| | |
Otherwise you might, for example, receive a String from a config file,
JSON API submission, RPC call, or whatever, containing a newline, and
then encode it into a netdoc giving a syntax error or, worse,
smuggling additional items into the document!
|
| | | |
|
| | |
| |
| |
| | |
Otherwise the cfg_attr for the field would need to name both features.
|
| | | |
|
| | | |
|
| |\ \
| | |
| | |
| | |
| | | |
Fix the testdata2 situation
See merge request tpo/core/arti!3861
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | | |
This commit adds a manual test case for happy families in microdesc with
parse2. Manual in the sense that we hardcode a microdescriptor taken
from the wild here, as testdata2 does not contain them at the current
moment, which is unfortunate but reported.
|
| | | |
| | |
| | |
| | |
| | | |
This commit adjust the family value for the microdesc test to the one
actually found in testdata2/.
|
| | | |
| | |
| | |
| | |
| | |
| | | |
This commit updates the microdesc test EC keys with the new ones from
testdata2/ while also changing the encoding from a byte array to the
base64 value found in the microdesc itself.
|
| | | |
| | |
| | |
| | |
| | | |
This commit updates the microdesc onion key with the new one from
testdata2.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This commit removes the assert_eq for mds[6]. The reason for this was
to have a test case with happy families set. However, these values were
manually hacked into the respective file which is not the correct way.
Instead, we will test this in a separate test that will be added later,
as the current testdata2/ is not capable of this. This is an already
reported chutney issue.
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | | |
This removes unused imports as well as the read_b64 and to_der helper
functions which are all no longer used.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This commit updates the dir_auth_cross_cert() test case with the new
constants, replacing the longclaw ones.
The replacement also involves a slight refactoring on the way how we
obtain the encoded and decoded variable, namely because we have the data
in a PEM encoded string now and no longer in separate file, making the
use of read_b64 impossible.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This commit updates the invalid outer signature test case by copying the
outer signature of the alternative certificate into our test object,
which should obviously render this to a failure.
It also updates the test vectors to the constant ones because it moves
away from longclaw.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This commit updates the invalid cross-cert test case by copying the
cross-cert from the alternative cert into our test object, resulting in
a failure.
Of course this also updates the other test vectors to use the constants
declared above, as this moves away from longclaw.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This commit updates the inconsistent fingerprint test case that tests
whether the fingerprint matches with the identity RSA key. For this, we
load the alternative authority cert and move its identity key into the
identity key of the canonical cert.
Of course, this also replaces the other test vectors that are now
required for this change because it moves away from longclaw.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This commit adds a new constant to the parse2 authcert unit tests,
ALTERNATIVE_AUTHCERT_RAW, with the idea being to be different than
AUTHCERT_RAW, which we will utilize in order to mix up cross-cert
objects from one authcert with the one of another one in order to see it
fail.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This commit updates the "trivial" test cases in the dir_auth_signature
unit tests, namely the ones concerning the outer signature as well as
the timestamp tolerance. A follow-up commit will also update the more
tricky ones, such as the ones testing inconsistent cross-certificates,
etc.
|