Commit Graph

6422 Commits

Author SHA1 Message Date
Gabriela Moldovan 37493b6bd3
dev docs: Add namespacing for client/hs/relay/.. keys.
Signed-off-by: Gabriela Moldovan <gabi@torproject.org>
2023-04-25 18:53:56 +01:00
Gabriela Moldovan 0be6e0a4ca
dev docs: Remove KeyIdentityResult.
Signed-off-by: Gabriela Moldovan <gabi@torproject.org>
2023-04-25 18:53:47 +01:00
Gabriela Moldovan 9af07e91a2
dev docs: Remove HSM APIs.
Signed-off-by: Gabriela Moldovan <gabi@torproject.org>
2023-04-25 18:53:42 +01:00
Gabriela Moldovan 49ff17901b
dev docs: clarify what a "key identity" is.
Signed-off-by: Gabriela Moldovan <gabi@torproject.org>
2023-04-25 18:53:38 +01:00
Gabriela Moldovan 28bac87d96
dev docs: Allow multiple key stores to be in use at the same time.
The key manager needs to be flexible enough to support loading keys from
one of several key stores. This is because when we add support for smart
cards, users will want to be able to store some keys on the smart card,
and others in one of the disk key stores (for example).

Signed-off-by: Gabriela Moldovan <gabi@torproject.org>
2023-04-25 18:53:31 +01:00
Gabriela Moldovan fb6d5dc0d9
dev docs: Add some impls for `LocalUserIdentity`.
Signed-off-by: Gabriela Moldovan <gabi@torproject.org>
2023-04-25 18:53:22 +01:00
Gabriela Moldovan dc616d9e07
dev docs: Add key manager API sketch.
This is the first draft of the key manager API.

I don't expect this to be the final version of the API, and I'm sure
there are plenty of improvements to be made. This is mostly a request
for comments.

Closes #834

Signed-off-by: Gabriela Moldovan <gabi@torproject.org>
2023-04-25 18:53:05 +01:00
Gabriela Moldovan b967749325
netdoc: Document how to extract an `HsDesc` out of an `UncheckedEncryptedHsDesc`.
This adds an example to the `HsDesc::parse` docs. The constants from the
example are lifted from the `parse_desc_good` test.

Signed-off-by: Gabriela Moldovan <gabi@torproject.org>
2023-04-25 18:15:56 +01:00
Gabriela Moldovan 8f4e876924
netdoc: Add a convenience method for HS descriptor parsing.
This adds the `HsDesc::parse_decrypt_validate` method, which parses,
decrypts, and validates HS descriptors.

Closes #809

Signed-off-by: Gabriela Moldovan <gabi@torproject.org>
2023-04-25 18:15:53 +01:00
Nick Mathewson 829122ba2d Merge branch 'memchr_upgrade' into 'main'
Bump our own memchr dependency to 2.5

See merge request tpo/core/arti!1151
2023-04-23 15:01:15 +00:00
Nick Mathewson dc187c8fb8 Bump our own memchr dependency to 2.5
This appears to be necessary for getting "minimal-versions" to be
happy with memchr dependencies between reges and async-compression.
2023-04-22 09:41:47 -04:00
Nick Mathewson 74e5c29951 Merge branch 'rpc_method_syntax' into 'main'
RPC: update method declaration syntax and implementation

Closes #835 and #821

See merge request tpo/core/arti!1148
2023-04-19 18:27:50 +00:00
Nick Mathewson 7c1f45a514 RPC: Log all internal errors. 2023-04-19 12:38:26 -04:00
Nick Mathewson ffcbd8fe88 rpc: Simplify and clarify SendUpdateError. 2023-04-19 12:38:26 -04:00
Nick Mathewson accd3d858f Arti: Add ability to remember the list of methods names.
Right now, this lets us say whether the method was unrecognized or
whether the parameter type was incorrect.

We'll use this to enforce correct method names later on.

(I have to add another `inventory` here, since the `typetag`
maintainer does not want to expose this functionality: see
https://github.com/dtolnay/typetag/issues/57#issuecomment-1506106290
)
2023-04-19 12:38:26 -04:00
Nick Mathewson e6092e99ea rpc: New syntax for method declaration
Now you just declare your function `my_func` with the right types,
and invoke `rpc_invoke_fn!{ my_func(ObjType, MethodType); }`
2023-04-19 12:38:26 -04:00
Nick Mathewson a415b0e2d2 rpc: impl From<SendUpdateError> for RpcError. 2023-04-19 12:38:26 -04:00
Nick Mathewson f33aefd76c rpcserver: Use with_fn. 2023-04-19 12:38:26 -04:00
Nick Mathewson 6f6a4d073e rpcbase: Use with_fn. 2023-04-19 12:38:26 -04:00
Nick Mathewson 8a8c800c99 async-utils: Add a SinkExt with a with_fn
(This function behaves as `futures::sink::SinkExt::with`, except
that the function that it takes does not return a future.)
2023-04-19 12:38:26 -04:00
Nick Mathewson d54154e520 async-utils: rename sinkext to prepare_send 2023-04-19 12:38:26 -04:00
Nick Mathewson 5cd5e6a3f8 async-utils: rename SinkExt to SinkPrepareExt 2023-04-19 12:38:26 -04:00
Nick Mathewson 80a13ff898 rpc: Minor tweaks to get a sink to compile. 2023-04-19 12:38:26 -04:00
Nick Mathewson 0503f7bd4b rpc: Use Method types to determine type of method outputs, updates.
This lets us do much less in our rpc_invoke_fn functions.
2023-04-19 12:38:26 -04:00
Nick Mathewson 7dcfb02c22 rpc: Split Method into DynMethod and Method
Now `Method` has an Output and Update associated type, and
`decl_method` can do a little more.
2023-04-19 12:38:26 -04:00
Alexander Færøy 1faa97c645 Merge branch 'post_1145' into 'main'
Followups from !1145

See merge request tpo/core/arti!1146
2023-04-18 16:03:48 +00:00
Ian Jackson 219153a541 Merge branch 'rpc_refactoring_v2' into 'main'
A few RPC refactorings

Closes #817 and #824

See merge request tpo/core/arti!1144
2023-04-18 16:00:05 +00:00
Ian Jackson 89fd20e8ca Merge branch 'method_namespace' into 'main'
rpc spec: define method namespacing.

Closes #822

See merge request tpo/core/arti!1141
2023-04-18 15:53:58 +00:00
Ian Jackson 6c720962a8 Merge branch 'fix_802_core' into 'main'
DirMgr: Detect that directory state is ready if it begins with all MDs

Closes #802

See merge request tpo/core/arti!1126
2023-04-18 15:34:08 +00:00
Nick Mathewson 543e089b82 netdoc: Document that particular bit values for flags are not part of our API. 2023-04-17 17:09:58 -04:00
Nick Mathewson 11945e8b4e netstatus: re-number routerstatus flags to go in order.
Otherwise there is too much risk of accidentally adding in another
1<<12 when we meant to add a 1<<13.

(It would be neat to have an alternative to bitflags here that would
auto-number our bitflags for us.)
2023-04-17 16:50:08 -04:00
Nick Mathewson 3985700216 netdir: more documentation on MIDDLE_ONLY flag.
Clarify that it isn't anything that most users will need to check.
2023-04-17 16:48:15 -04:00
Nick Mathewson 7d23daf0dd Merge branch 'issue833_middleonly' into 'main'
netdoc: Add MiddleOnly flag to RelayFlags

Closes #833

See merge request tpo/core/arti!1145
2023-04-17 20:40:57 +00:00
juga eee1dbee7a netdoc: Add MiddleOnly flag to RelayFlags
Closes #833
2023-04-17 09:53:04 +00:00
Nick Mathewson f5542d847f Merge branch 'rustdoc-fix' into 'main'
rpcserver: Fix a couple of broken rustdoc links

See merge request tpo/core/arti!1143
2023-04-17 01:21:05 +00:00
Nick Mathewson 5a2c38a134 rpc: simplify API by always providing a sink.
Previously we have two places where we had to do "make a `Drain` sink
if updates aren't wanted"; now there's only one.
2023-04-16 08:46:42 -04:00
Nick Mathewson 83f5dc4888 rpc: Ensure well-ordering of responses.
Previously the main loop received updates via a `mpsc::channel`, and
final responses via a `futures::unordered`.  This could lead to
final responses being transmitted to the user before the updates
were all flushed.

Now all of the responses are sent to the main loop via the same channel,
and they can't get out-of-sequence.

Closes #817 and (IMO) simplifies the code a bit.
2023-04-16 08:46:42 -04:00
Nick Mathewson 58ad91cbf5 rpc: Wire updates into rpc invoke functions again.
Now that the sink is not part of the context, RPC functions that are
able to send an update have to declare an `impl Sink` as their
fourth argument.  This syntax is not final.

Part of #824.
2023-04-16 08:46:42 -04:00
Nick Mathewson 3b9fc60763 rpc: Move update sink out of context.
Now the update sink is its own boxed object.  It is not yet passed
to the invoke functions that want it.
2023-04-16 08:46:41 -04:00
Nick Mathewson c51f44aa0b rpcserver: Fix a couple of broken rustdoc links 2023-04-16 08:39:52 -04:00
Nick Mathewson 12a52e51a8 Merge branch 'fix-macos-repro' into 'main'
fix macos reproducible builds

Closes #832

See merge request tpo/core/arti!1142
2023-04-16 12:35:03 +00:00
trinity-1686a 1b348f5613 fix macos reproducible builds 2023-04-16 13:22:18 +02:00
Nick Mathewson 8bcf037c9d Merge branch 'fix' into 'main'
Run cargo update

See merge request tpo/core/arti!1140
2023-04-13 15:13:33 +00:00
Nick Mathewson e524f05aa9 rpc spec: define method namespacing.
Closes #822
2023-04-13 10:50:30 -04:00
Ian Jackson 6cdd7cc884 Run cargo update
The lockfile on main seems to be broken.  I skim-eyeballed the diff,
which is entirely autogenerated.
2023-04-13 15:46:00 +01:00
gabi-250 31b6c9243d Merge branch 'use_secmem_proc_03' into 'main'
Update our secmem_proc dependency to 0.3.0

Closes #664

See merge request tpo/core/arti!1138
2023-04-13 14:26:06 +00:00
gabi-250 da790e4b78 Merge branch 'misc_upgrades' into 'main'
Upgrade a couple more dependencies

See merge request tpo/core/arti!1139
2023-04-13 14:25:13 +00:00
Nick Mathewson cf00fd8e8a Merge branch 'rpc_conformance' into 'main'
RPC: Terminology and error-handling conformance

Closes #826 and #825

See merge request tpo/core/arti!1136
2023-04-13 13:45:40 +00:00
Nick Mathewson 8dd65dcd5f rpc, spec: Document current ObjectError, RequestError behavior as correct. 2023-04-13 09:03:52 -04:00
Nick Mathewson ea77f959fb rpc: Change `id=<SYNTAX>` to "no id".
Now instead of hoping that buggy clients will detect a magic `id`,
we can simply tell them that they will get no `id` at all.  If they
can't handle that case, no major harm is done: the connection will
get closed anyway.
2023-04-13 09:03:52 -04:00