Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pier Angelo Vendrame
Tor
Commits
6c8b9353
Commit
6c8b9353
authored
8 months ago
by
Nick Mathewson
Browse files
Options
Downloads
Patches
Plain Diff
Do not publish TAP key when publish-dummy-tap-key is 0.
parent
9466cc9f
No related branches found
Branches containing commit
Tags
arti-v1.1.5
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/feature/relay/router.c
+32
-5
32 additions, 5 deletions
src/feature/relay/router.c
with
32 additions
and
5 deletions
src/feature/relay/router.c
+
32
−
5
View file @
6c8b9353
...
@@ -211,8 +211,13 @@ set_onion_key(crypto_pk_t *k)
...
@@ -211,8 +211,13 @@ set_onion_key(crypto_pk_t *k)
mark_my_descriptor_dirty
(
"set onion key"
);
mark_my_descriptor_dirty
(
"set onion key"
);
}
}
/** Return the current onion key. Requires that the onion key has been
/** Return the current TAP onion key. Requires that the onion key has been
* loaded or generated. */
* loaded or generated.
*
* Note that this key is no longer used for anything; we only keep it around
* because (as of June 2024) other Tor instances all expect to find it in
* our routerdescs.
**/
MOCK_IMPL
(
crypto_pk_t
*
,
MOCK_IMPL
(
crypto_pk_t
*
,
get_onion_key
,(
void
))
get_onion_key
,(
void
))
{
{
...
@@ -220,6 +225,25 @@ get_onion_key,(void))
...
@@ -220,6 +225,25 @@ get_onion_key,(void))
return
onionkey
;
return
onionkey
;
}
}
/**
* Return true iff we should include our TAP onion key in our router
* descriptor.
*/
static
int
should_publish_tap_onion_key
(
void
)
{
#define SHOULD_PUBLISH_TAP_MIN 0
#define SHOULD_PUBLISH_TAP_MAX 1
/* Note that we err on the side of publishing. */
#define SHOULD_PUBLISH_TAP_DFLT 1
return
networkstatus_get_param
(
NULL
,
"publish-dummy-tap-key"
,
SHOULD_PUBLISH_TAP_DFLT
,
SHOULD_PUBLISH_TAP_MIN
,
SHOULD_PUBLISH_TAP_MAX
);
}
/** Store a full copy of the current onion key into *<b>key</b>, and a full
/** Store a full copy of the current onion key into *<b>key</b>, and a full
* copy of the most recent onion key into *<b>last</b>. Store NULL into
* copy of the most recent onion key into *<b>last</b>. Store NULL into
* a pointer if the corresponding key does not exist.
* a pointer if the corresponding key does not exist.
...
@@ -2138,9 +2162,12 @@ router_build_fresh_unsigned_routerinfo,(routerinfo_t **ri_out))
...
@@ -2138,9 +2162,12 @@ router_build_fresh_unsigned_routerinfo,(routerinfo_t **ri_out))
ri
->
supports_tunnelled_dir_requests
=
ri
->
supports_tunnelled_dir_requests
=
directory_permits_begindir_requests
(
options
);
directory_permits_begindir_requests
(
options
);
ri
->
cache_info
.
published_on
=
time
(
NULL
);
ri
->
cache_info
.
published_on
=
time
(
NULL
);
/* get_onion_key() must invoke from main thread */
router_set_rsa_onion_pkey
(
get_onion_key
(),
&
ri
->
tap_onion_pkey
,
if
(
should_publish_tap_onion_key
())
{
&
ri
->
tap_onion_pkey_len
);
/* get_onion_key() must invoke from main thread */
router_set_rsa_onion_pkey
(
get_onion_key
(),
&
ri
->
tap_onion_pkey
,
&
ri
->
tap_onion_pkey_len
);
}
ri
->
onion_curve25519_pkey
=
ri
->
onion_curve25519_pkey
=
tor_memdup
(
&
get_current_curve25519_keypair
()
->
pubkey
,
tor_memdup
(
&
get_current_curve25519_keypair
()
->
pubkey
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment