Commit Graph

6199 Commits

Author SHA1 Message Date
Ian Jackson 5da60ff72d hsclient keys: Fix non-equal keys test to provide a (dummy) key (fmt) 2023-03-01 16:27:19 +00:00
Ian Jackson ff55d7b133 hsclient keys: Fix non-equal keys test to provide a (dummy) key
We're about to fix the comparison to treat all empty key sets as
equal.
2023-03-01 16:27:19 +00:00
Ian Jackson e3e66793c4 hsclient keys: Provide :none() and Default and .is_empty() 2023-03-01 16:27:19 +00:00
Ian Jackson 896ea10b7f hsclient keys: Fix a missing full stop 2023-03-01 16:27:19 +00:00
Ian Jackson ab163cf81a hsclient state: Test most important code paths 2023-03-01 16:27:19 +00:00
Ian Jackson 8e088d72d5 hsclient: Provide some missing debug impls and trace messages 2023-03-01 16:27:19 +00:00
Ian Jackson 83b8eb7349 tor-hscrypto: Provide manual Debug impl for HsId
This is still not great, but it at least makes the output plausible to
read by eye.
2023-03-01 16:27:19 +00:00
Ian Jackson 288b7b6ad1 Apply rustfmt 2023-03-01 16:27:19 +00:00
Ian Jackson d384c3b475 hsclient state: Provide one test 2023-03-01 16:27:17 +00:00
Nick Mathewson 5131703c22 Introduce a constant for the length of the output of hs_mac() 2023-03-01 11:26:35 -05:00
Nick Mathewson b36082255b tor-bytes: Clarify that Cursor is not a good thing, and could be neater. 2023-03-01 11:21:52 -05:00
Ian Jackson d7602c5be4 hsclient: Use a generic to provide a mock for connect()
This will allow us to test state.rs.
2023-03-01 16:20:16 +00:00
Ian Jackson feab6faa9e tor-circmgr: Provide testing feature and TestConfig
Like the similar thing in tor-guardmgr.
2023-03-01 16:20:16 +00:00
Ian Jackson 9ebe22756e hsclient: Apply standard lint block 2023-03-01 16:20:16 +00:00
Ian Jackson ff1be04012 hsclient: Move dead code allows to specific locations 2023-03-01 16:20:16 +00:00
Ian Jackson b430c65ddb hsclient: Add vacuous comments as demanded by clippy 2023-03-01 16:20:16 +00:00
Ian Jackson bac3c4a9a4 hsclient state: Bind a variable to stop rustfmt doing a terrible thing 2023-03-01 16:20:16 +00:00
Ian Jackson 76a160d5a7 hsclient: Provide a constructor for HsClientConnector 2023-03-01 16:20:16 +00:00
Ian Jackson e8b5195281 hsclient: Implement connection attempt tracking state machine
This compiles, but it cannot work yet.  Nor can it conveniently be tested.
2023-03-01 16:20:16 +00:00
Ian Jackson 4ec9ec92bc HS secret keys: Move aggregate/config to tor-hsclient
Provide a more cookied "secret keys for use to connecting to a
particular HS" type, with a builder.

This wants to use config stuff, so oughtn't to be in tor-*crypto.
The individual types remain there.
2023-03-01 16:19:31 +00:00
Nick Mathewson 03df452f7b tor-cell: Rename EstablishIntro{Body => Details} 2023-03-01 11:18:50 -05:00
Ian Jackson 891782122d hsclient API: Remove notion of ambient keys fromk this layer 2023-03-01 16:18:09 +00:00
Ian Jackson a45acb3905 HS API: Remove HS client keys from circmgr API
*If* we're going to retain any HS knowledge in circmgr, it definitely
doesn't need to know about per-operation client secrets.

(Maybe there might be ambient secrets, used for .onion diversion, but
they don't need to be in this API.)
2023-03-01 16:18:09 +00:00
Ian Jackson feeb38c750 HS planning: Discuss whether to remove all HS code from circmgr 2023-03-01 16:18:09 +00:00
Ian Jackson 06e6e11886 HS planning: Intend for HS connector to do all lifecycle mgmt
Otherwise there has to be a state entry in the circmgr *and* a state
entry in the hs connector, for every HS.  This division of
responsibilit will be confusing.

The HS code will then be more completely just a layer on top of circmgr.
2023-03-01 16:17:47 +00:00
Ian Jackson bab32c6038 clarify results of misusing cursors 2023-03-01 15:57:14 +00:00
Nick Mathewson 1251796039 Merge branch 'more_hs_msgs' into 'main'
Implement most remaining HS cell types

See merge request tpo/core/arti!1038
2023-03-01 14:50:35 +00:00
Nick Mathewson 87d9dd6423 tor-netdoc: Clarify that we must indeed check cert expiration. 2023-03-01 09:49:17 -05:00
Nick Mathewson a4a305c1cf tor-netdoc: Validate inner certs in HsDesc
This makes our implementation behave the same as the C tor
implementation, by validating all of the expiration and signatures
on the certificates in the inner document.

(It is still not semantically necessary to check these certs: the
document in which they appear is already signed by the key with
which they are allegedly signed.)

Closes #744
2023-03-01 09:48:51 -05:00
Ian Jackson 333ce4118b Merge branch 'check_env' into 'main'
maint: add a full dependency check

See merge request tpo/core/arti!1030
2023-03-01 12:48:20 +00:00
Nick Mathewson 53e44b58f5 tor-cell: Fix compilation for fuzzers
(I also ran them a couple billion iterations, and didn't hit
any bugs.)
2023-03-01 07:39:17 -05:00
Nick Mathewson 8c9a1a6fad tor-cell: Make EstablishIntro do signatures
The old code parsed and encoded a signature and a mac... but there
was no way to actually set them properly.  Now EstablishIntro is
built around an EstablishIntroBody, and has the ability to check
signatures and macs.

Because there is no way to handle one of these messages if we can't
check the signature, we no longer accept unrecognized `auth_key` types
in this message.

I've added a test to make sure that we can validate a message from the
C tor implementation, and a test to make sure we can validate our
own cells.  I also had to modify the previous tests so that their
keys were well-formed.
2023-03-01 07:38:56 -05:00
Ian Jackson 22bb5bacc0 Merge branch 'main' into 'main'
Use humantime in tor-checkable and tor-guardmgr

Closes #663

See merge request tpo/core/arti!1037
2023-02-28 19:22:53 +00:00
Ian Jackson 7a1c4f54c9 Merge branch 'changes' into 'main'
Remove unnecessary warning from arti-hyper/README

See merge request tpo/core/arti!1042
2023-02-28 19:17:02 +00:00
Nick Mathewson 0f88c5131f tor-bytes: impl Readable and Writeable for CtByteArray. 2023-02-28 11:23:44 -05:00
Nick Mathewson d658fcfc52 Expose a little new functionality from tor-llcrypto.
Expose ED25519 signature length; make ValidatableEd25519Signature
implement Debug and Clone.
2023-02-28 11:23:44 -05:00
Nick Mathewson 0bf1ae70ba tor-bytes: Add cursor functionality to Reader
We'll use this to implement signature and MAC checking for
EstablishIntro cells.
2023-02-28 11:23:44 -05:00
Nick Mathewson 09d601d050 Change several cfgs to refer to new feature names. 2023-02-28 11:15:39 -05:00
Nick Mathewson 0c000a1713 Mark new tests as onion-service-only 2023-02-28 11:15:39 -05:00
Nick Mathewson ca055d4cb5 tor-cell: Support extensions in INTRODUCE{1,2} 2023-02-28 11:15:39 -05:00
Nick Mathewson 7af2efdb82 tor-cell: Implement IntroduceAck and IntroEstablished
These are fairly simple, since the bulk of them is just an extension
list with no supported extensions.
2023-02-28 11:15:39 -05:00
Nick Mathewson c302246e57 tor-cell: Implement rendezvous1 and rendezvous2. 2023-02-28 11:15:39 -05:00
Nick Mathewson 841905948f caret: work correctly when there are no defined variants. 2023-02-28 11:08:34 -05:00
Nick Mathewson d69ed3bc62 hscrypto: Make several types Readable+Writeable
Specifically, RendCookie, Subcredential, HsId, and HsBlindId.
2023-02-28 11:08:31 -05:00
Saksham Mittal e2c870ca1c
Remove unnecessary warning from arti-hyper/README
https://gitlab.torproject.org/tpo/core/arti/-/issues/715
has been fixed, so there is no need to display such a warning
2023-02-28 21:23:24 +05:30
Nick Mathewson 886faa96b3 Remove semver.md files now that 1.1.2 is out. 2023-02-28 10:06:41 -05:00
Nick Mathewson 2f0dedd8bb Merge branch 'bump_versions' into 'main'
Bump various versions in preparation for Arti 1.1.2 release.

See merge request tpo/core/arti!1041
2023-02-28 13:25:25 +00:00
Nick Mathewson e79f2f7803 Merge branch 'changelog' into 'main'
CHANGELOG: Fix typo

See merge request tpo/core/arti!1040
2023-02-28 12:25:15 +00:00
Nick Mathewson 2c9f8e3547 Follow-on patchlevel bumps for crates with changed dependencies
These crates didn't have any changes until now, when I bumped
the versions of some other crates they depend on:

tor-consdiff
arti-hyper
arti-bench
arti-testing
2023-02-28 07:18:37 -05:00
Nick Mathewson f41449d0bd Patchlevel bumps for remaining changed crates.
These crates have had small code changes, but no API additions:

tor-config
tor-socksproto
tor-cert
tor-chanmgr
tor-ptmgr
tor-guardmgr
tor-circmgr
tor-dirclient
tor-dirmgr
arti
tor-hsservice
tor-congestion

These crates have had API extensions:

fs-mistrust
tor-llcrypto
tor-bytes
tor-checkable
tor-linkspec
tor-netdoc
tor-persist
arti-client
2023-02-28 07:13:27 -05:00