diff options
Diffstat (limited to 'src/or/hs_service.c')
-rw-r--r-- | src/or/hs_service.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/or/hs_service.c b/src/or/hs_service.c index 6cb24a19af..4c0ec628cc 100644 --- a/src/or/hs_service.c +++ b/src/or/hs_service.c @@ -405,7 +405,7 @@ service_intro_point_new(const extend_info_t *ei, unsigned int is_legacy) } smartlist_add(ip->base.link_specifiers, ls); - /* ed25519 identity key is optional */ + /* ed25519 identity key is optional for intro points */ ls = hs_desc_link_specifier_new(ei, LS_ED25519_ID); if (ls) { smartlist_add(ip->base.link_specifiers, ls); @@ -1411,6 +1411,14 @@ pick_intro_point(unsigned int direct_conn, smartlist_t *exclude_nodes) if (BUG(info == NULL)) { goto err; } + + /* Let's do a basic sanity check here so that we don't end up advertising the + * ed25519 identity key of relays that don't actually support the link + * protocol */ + if (!node_supports_ed25519_link_authentication(node)) { + tor_assert_nonfatal(ed25519_public_key_is_zero(&info->ed_identity)); + } + /* Create our objects and populate them with the node information. */ ip = service_intro_point_new(info, !node_supports_ed25519_hs_intro(node)); if (ip == NULL) { |