]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Add implementation and version metadata to bridge extra-info.
authorAlexander Færøy <ahf@torproject.org>
Fri, 21 Jul 2023 00:11:16 +0000 (02:11 +0200)
committerDavid Goulet <dgoulet@torproject.org>
Tue, 18 Jun 2024 19:15:20 +0000 (15:15 -0400)
This patch adds two new keys to bridges' extra-info document:
"transport-version" and "transport-implementation".

These two new values always appear together (if one is missing, the
other one will be missing too) and is parsed from PT's STATUS
TYPE=version messages.

See: tpo/core/tor#11101.

src/feature/client/transports.c

index 416e538efc94ef27f22d1d1749473c3d6e41e357..77cee25c545b5e0dc57c22b6211d3693334459fc 100644 (file)
@@ -1786,9 +1786,21 @@ pt_get_extra_info_descriptor_string(void)
                              "transport %s %s%s",
                              t->name, addrport,
                              transport_args ? transport_args : "");
+
       tor_free(transport_args);
     } SMARTLIST_FOREACH_END(t);
 
+    if (mp->version != NULL) {
+      smartlist_add_asprintf(string_chunks,
+                             "transport-version %s",
+                             mp->version);
+    }
+
+    if (mp->implementation != NULL) {
+      smartlist_add_asprintf(string_chunks,
+                             "transport-implementation %s",
+                             mp->implementation);
+    }
   } SMARTLIST_FOREACH_END(mp);
 
   if (smartlist_len(string_chunks) == 0) {