1 /* Copyright (c) 2016-2021, The Tor Project, Inc. */
2 /* See LICENSE for licensing information */
6 * \brief Versioning information for different pieces of the Tor protocol.
8 * Starting in version 0.2.9.3-alpha, Tor places separate version numbers on
9 * each of the different components of its protocol. Relays use these numbers
10 * to advertise what versions of the protocols they can support, and clients
11 * use them to find what they can ask a given relay to do. Authorities vote
12 * on the supported protocol versions for each relay, and also vote on the
13 * which protocols you should have to support in order to be on the Tor
14 * network. All Tor instances use these required/recommended protocol versions
15 * to tell what level of support for recent protocols each relay has, and
16 * to decide whether they should be running given their current protocols.
18 * The main advantage of these protocol versions numbers over using Tor
19 * version numbers is that they allow different implementations of the Tor
20 * protocols to develop independently, without having to claim compatibility
21 * with specific versions of Tor.
24 #define PROTOVER_PRIVATE
26 #include "core/or/or.h"
27 #include "core/or/protover.h"
28 #include "core/or/versions.h"
29 #include "lib/tls/tortls.h"
33 static const smartlist_t
*get_supported_protocol_list(void);
34 static int protocol_list_contains(const smartlist_t
*protos
,
35 protocol_type_t pr
, uint32_t ver
);
36 static const proto_entry_t
*find_entry_by_name(const smartlist_t
*protos
,
39 /** Mapping between protocol type string and protocol type. */
40 /// C_RUST_COUPLED: src/rust/protover/protover.rs `PROTOCOL_NAMES`
42 protocol_type_t protover_type
;
44 /* If you add a new protocol here, you probably also want to add
45 * parsing for it in summarize_protover_flags(), so that it has a
46 * summary flag in routerstatus_t */
47 } PROTOCOL_NAMES
[] = {
49 { PRT_LINKAUTH
, "LinkAuth" },
50 { PRT_RELAY
, "Relay" },
51 { PRT_DIRCACHE
, "DirCache" },
52 { PRT_HSDIR
, "HSDir" },
53 { PRT_HSINTRO
, "HSIntro" },
54 { PRT_HSREND
, "HSRend" },
56 { PRT_MICRODESC
, "Microdesc"},
57 { PRT_PADDING
, "Padding"},
59 { PRT_FLOWCTRL
, "FlowCtrl"},
62 #define N_PROTOCOL_NAMES ARRAY_LENGTH(PROTOCOL_NAMES)
64 /* Maximum allowed length of any single subprotocol name. */
65 // C_RUST_COUPLED: src/rust/protover/protover.rs
66 // `MAX_PROTOCOL_NAME_LENGTH`
67 static const unsigned MAX_PROTOCOL_NAME_LENGTH
= 100;
70 * Given a protocol_type_t, return the corresponding string used in
74 protocol_type_to_str(protocol_type_t pr
)
77 for (i
=0; i
< N_PROTOCOL_NAMES
; ++i
) {
78 if (PROTOCOL_NAMES
[i
].protover_type
== pr
)
79 return PROTOCOL_NAMES
[i
].name
;
82 tor_assert_nonfatal_unreached_once();
88 * Release all space held by a single proto_entry_t structure
91 proto_entry_free_(proto_entry_t
*entry
)
95 tor_free(entry
->name
);
99 /** The largest possible protocol version. */
100 #define MAX_PROTOCOL_VERSION (63)
103 * Given a string <b>s</b> and optional end-of-string pointer
104 * <b>end_of_range</b>, parse the protocol range and store it in
105 * <b>low_out</b> and <b>high_out</b>. A protocol range has the format U, or
106 * U-U, where U is an unsigned integer between 0 and 63 inclusive.
109 parse_version_range(const char *s
, const char *end_of_range
,
110 uint32_t *low_out
, uint32_t *high_out
)
116 tor_assert(high_out
);
119 if (BUG(!end_of_range
))
120 end_of_range
= s
+ strlen(s
); // LCOV_EXCL_LINE
122 /* A range must start with a digit. */
123 if (!TOR_ISDIGIT(*s
)) {
127 /* Note that this wouldn't be safe if we didn't know that eventually,
129 low
= (uint32_t) tor_parse_ulong(s
, 10, 0, MAX_PROTOCOL_VERSION
, &ok
, &next
);
132 if (next
> end_of_range
)
134 if (next
== end_of_range
) {
144 if (!TOR_ISDIGIT(*s
)) {
147 high
= (uint32_t) tor_parse_ulong(s
, 10, 0,
148 MAX_PROTOCOL_VERSION
, &ok
, &next
);
151 if (next
!= end_of_range
)
167 is_valid_keyword(const char *s
, size_t n
)
169 for (size_t i
= 0; i
< n
; i
++) {
170 if (!TOR_ISALNUM(s
[i
]) && s
[i
] != '-')
176 /** The x'th bit in a bitmask. */
177 #define BIT(x) (UINT64_C(1)<<(x))
180 * Return a bitmask so that bits 'low' through 'high' inclusive are set,
181 * and all other bits are cleared.
184 bitmask_for_range(uint32_t low
, uint32_t high
)
186 uint64_t mask
= ~(uint64_t)0;
188 mask
>>= 63 - high
+ low
;
193 /** Parse a single protocol entry from <b>s</b> up to an optional
194 * <b>end_of_entry</b> pointer, and return that protocol entry. Return NULL
197 * A protocol entry has a keyword, an = sign, and zero or more ranges. */
198 static proto_entry_t
*
199 parse_single_entry(const char *s
, const char *end_of_entry
)
201 proto_entry_t
*out
= tor_malloc_zero(sizeof(proto_entry_t
));
204 if (BUG (!end_of_entry
))
205 end_of_entry
= s
+ strlen(s
); // LCOV_EXCL_LINE
207 /* There must be an =. */
208 equals
= memchr(s
, '=', end_of_entry
- s
);
212 /* The name must be nonempty */
216 /* The name must not be longer than MAX_PROTOCOL_NAME_LENGTH. */
217 if (equals
- s
> (int)MAX_PROTOCOL_NAME_LENGTH
) {
218 log_warn(LD_NET
, "When parsing a protocol entry, I got a very large "
219 "protocol name. This is possibly an attack or a bug, unless "
220 "the Tor network truly supports protocol names larger than "
221 "%ud characters. The offending string was: %s",
222 MAX_PROTOCOL_NAME_LENGTH
, escaped(out
->name
));
226 /* The name must contain only alphanumeric characters and hyphens. */
227 if (!is_valid_keyword(s
, equals
-s
))
230 out
->name
= tor_strndup(s
, equals
-s
);
232 tor_assert(equals
< end_of_entry
);
235 while (s
< end_of_entry
) {
236 const char *comma
= memchr(s
, ',', end_of_entry
-s
);
238 comma
= end_of_entry
;
240 uint32_t low
=0, high
=0;
241 if (parse_version_range(s
, comma
, &low
, &high
) < 0) {
245 out
->bitmask
|= bitmask_for_range(low
,high
);
248 // Skip the comma separator between ranges. Don't ignore a trailing comma.
249 if (s
< (end_of_entry
- 1))
256 proto_entry_free(out
);
261 * Parse the protocol list from <b>s</b> and return it as a smartlist of
265 parse_protocol_list(const char *s
)
267 smartlist_t
*entries
= smartlist_new();
270 /* Find the next space or the NUL. */
271 const char *end_of_entry
= strchr(s
, ' ');
272 proto_entry_t
*entry
;
274 end_of_entry
= s
+ strlen(s
);
276 entry
= parse_single_entry(s
, end_of_entry
);
281 smartlist_add(entries
, entry
);
291 SMARTLIST_FOREACH(entries
, proto_entry_t
*, ent
, proto_entry_free(ent
));
292 smartlist_free(entries
);
297 * Return true if the unparsed protover list in <b>s</b> contains a
298 * parsing error, such as extra commas, a bad number, or an over-long
302 protover_list_is_invalid(const char *s
)
304 smartlist_t
*list
= parse_protocol_list(s
);
306 return true; /* yes, has a dangerous name */
307 SMARTLIST_FOREACH(list
, proto_entry_t
*, ent
, proto_entry_free(ent
));
308 smartlist_free(list
);
309 return false; /* no, looks fine */
313 * Given a protocol type and version number, return true iff we know
314 * how to speak that protocol.
317 protover_is_supported_here(protocol_type_t pr
, uint32_t ver
)
319 const smartlist_t
*ours
= get_supported_protocol_list();
320 return protocol_list_contains(ours
, pr
, ver
);
324 * Return true iff "list" encodes a protocol list that includes support for
325 * the indicated protocol and version.
327 * If the protocol list is unparseable, treat it as if it defines no
328 * protocols, and return 0.
331 protocol_list_supports_protocol(const char *list
, protocol_type_t tp
,
334 /* NOTE: This is a pretty inefficient implementation. If it ever shows
335 * up in profiles, we should memoize it.
337 smartlist_t
*protocols
= parse_protocol_list(list
);
341 int contains
= protocol_list_contains(protocols
, tp
, version
);
343 SMARTLIST_FOREACH(protocols
, proto_entry_t
*, ent
, proto_entry_free(ent
));
344 smartlist_free(protocols
);
349 * Return true iff "list" encodes a protocol list that includes support for
350 * the indicated protocol and version, or some later version.
352 * If the protocol list is unparseable, treat it as if it defines no
353 * protocols, and return 0.
356 protocol_list_supports_protocol_or_later(const char *list
,
360 /* NOTE: This is a pretty inefficient implementation. If it ever shows
361 * up in profiles, we should memoize it.
363 smartlist_t
*protocols
= parse_protocol_list(list
);
367 const char *pr_name
= protocol_type_to_str(tp
);
370 const uint64_t mask
= bitmask_for_range(version
, 63);
372 SMARTLIST_FOREACH_BEGIN(protocols
, proto_entry_t
*, proto
) {
373 if (strcasecmp(proto
->name
, pr_name
))
375 if (0 != (proto
->bitmask
& mask
)) {
379 } SMARTLIST_FOREACH_END(proto
);
382 SMARTLIST_FOREACH(protocols
, proto_entry_t
*, ent
, proto_entry_free(ent
));
383 smartlist_free(protocols
);
388 * XXX START OF HAZARDOUS ZONE XXX
391 /** Return the canonical string containing the list of protocols
394 /// C_RUST_COUPLED: src/rust/protover/protover.rs `SUPPORTED_PROTOCOLS`
396 protover_get_supported_protocols(void)
400 * Remember to edit the SUPPORTED_PROTOCOLS list in protover.rs if you
401 * are editing this list.
407 * Be EXTREMELY CAREFUL when *removing* versions from this list. If you
408 * remove an entry while it still appears as "recommended" in the consensus,
409 * you'll cause all the instances without it to warn.
411 * If you remove an entry while it still appears as "required" in the
412 * consensus, you'll cause all the instances without it to refuse to connect
413 * to the network, and shut down.
415 * If you need to remove a version from this list, you need to make sure that
416 * it is not listed in the _current consensuses_: just removing it from the
417 * required list below is NOT ENOUGH. You need to remove it from the
418 * required list, and THEN let the authorities upgrade and vote on new
419 * consensuses without it. Only once those consensuses are out is it safe to
420 * remove from this list.
422 * One concrete example of a very dangerous race that could occur:
424 * Suppose that the client supports protocols "HsDir=1-2" and the consensus
425 * requires protocols "HsDir=1-2. If the client supported protocol list is
426 * then changed to "HSDir=2", while the consensus stills lists "HSDir=1-2",
427 * then these clients, even very recent ones, will shut down because they
428 * don't support "HSDir=1".
430 * And so, changes need to be done in strict sequence as described above.
444 #ifdef HAVE_WORKING_TOR_TLS_GET_TLSSECRETS
457 * The recommended and required values are hardwired, to avoid disaster. Voting
458 * on the wrong subprotocols here has the potential to take down the network.
460 * In particular, you need to be EXTREMELY CAREFUL before adding new versions
461 * to the required protocol list. Doing so will cause every relay or client
462 * that doesn't support those versions to refuse to connect to the network and
465 * Note that this applies to versions, not just protocols! If you say that
466 * Foobar=8-9 is required, and the client only has Foobar=9, it will shut down.
468 * It is okay to do this only for SUPER OLD relays that are not supported on
469 * the network anyway. For clients, we really shouldn't kick them off the
470 * network unless their presence is causing serious active harm.
472 * The following required and recommended lists MUST be changed BEFORE the
473 * supported list above is changed, so that these lists appear in the
474 * consensus BEFORE clients need them.
476 * Please, see the warning in protocol_get_supported_versions().
481 /** Return the recommended client protocols list that directory authorities
482 * put in the consensus. */
484 protover_get_recommended_client_protocols(void)
486 return "Cons=2 Desc=2 DirCache=2 HSDir=2 HSIntro=4 HSRend=2 "
487 "Link=4-5 Microdesc=2 Relay=2";
490 /** Return the recommended relay protocols list that directory authorities
491 * put in the consensus. */
493 protover_get_recommended_relay_protocols(void)
495 return "Cons=2 Desc=2 DirCache=2 HSDir=2 HSIntro=4 HSRend=2 "
496 "Link=4-5 LinkAuth=3 Microdesc=2 Relay=2";
499 /** Return the required client protocols list that directory authorities
500 * put in the consensus. */
502 protover_get_required_client_protocols(void)
504 return "Cons=2 Desc=2 Link=4 Microdesc=2 Relay=2";
507 /** Return the required relay protocols list that directory authorities
508 * put in the consensus. */
510 protover_get_required_relay_protocols(void)
512 return "Cons=2 Desc=2 DirCache=2 HSDir=2 HSIntro=4 HSRend=2 "
513 "Link=4-5 LinkAuth=3 Microdesc=2 Relay=2";
517 * XXX END OF HAZARDOUS ZONE XXX
520 /** The protocols from protover_get_supported_protocols(), as parsed into a
521 * list of proto_entry_t values. Access this via
522 * get_supported_protocol_list. */
523 static smartlist_t
*supported_protocol_list
= NULL
;
525 /** Return a pointer to a smartlist of proto_entry_t for the protocols
527 static const smartlist_t
*
528 get_supported_protocol_list(void)
530 if (PREDICT_UNLIKELY(supported_protocol_list
== NULL
)) {
531 supported_protocol_list
=
532 parse_protocol_list(protover_get_supported_protocols());
534 return supported_protocol_list
;
537 /** Return the number of trailing zeros in x. Undefined if x is 0. */
539 trailing_zeros(uint64_t x
)
542 return __builtin_ctzll((unsigned long long)x
);
545 for (i
= 0; i
<= 64; ++i
) {
551 #endif /* defined(__GNUC__) */
555 * Given a protocol entry, encode it at the end of the smartlist <b>chunks</b>
556 * as one or more newly allocated strings.
559 proto_entry_encode_into(smartlist_t
*chunks
, const proto_entry_t
*entry
)
561 smartlist_add_asprintf(chunks
, "%s=", entry
->name
);
563 uint64_t mask
= entry
->bitmask
;
564 int shift
= 0; // how much have we shifted by so far?
567 const char *comma
= first
? "" : ",";
571 int zeros
= trailing_zeros(mask
);
574 int ones
= !mask
? 64 : trailing_zeros(~mask
);
576 smartlist_add_asprintf(chunks
, "%s%d", comma
, shift
);
578 smartlist_add_asprintf(chunks
, "%s%d-%d", comma
,
579 shift
, shift
+ ones
- 1);
582 break; // avoid undefined behavior; can't shift by 64.
589 /** Given a list of space-separated proto_entry_t items,
590 * encode it into a newly allocated space-separated string. */
592 encode_protocol_list(const smartlist_t
*sl
)
594 const char *separator
= "";
595 smartlist_t
*chunks
= smartlist_new();
596 SMARTLIST_FOREACH_BEGIN(sl
, const proto_entry_t
*, ent
) {
597 smartlist_add_strdup(chunks
, separator
);
599 proto_entry_encode_into(chunks
, ent
);
602 } SMARTLIST_FOREACH_END(ent
);
604 char *result
= smartlist_join_strings(chunks
, "", 0, NULL
);
606 SMARTLIST_FOREACH(chunks
, char *, cp
, tor_free(cp
));
607 smartlist_free(chunks
);
613 * Protocol voting implementation.
615 * Given a list of strings describing protocol versions, return a newly
616 * allocated string encoding all of the protocols that are listed by at
617 * least <b>threshold</b> of the inputs.
619 * The string is minimal and sorted according to the rules of
620 * contract_protocol_list above.
623 protover_compute_vote(const smartlist_t
*list_of_proto_strings
,
626 // we use u8 counters below.
627 tor_assert(smartlist_len(list_of_proto_strings
) < 256);
629 if (smartlist_len(list_of_proto_strings
) == 0) {
630 return tor_strdup("");
633 smartlist_t
*parsed
= smartlist_new(); // smartlist of smartlist of entries
634 smartlist_t
*proto_names
= smartlist_new(); // smartlist of strings
635 smartlist_t
*result
= smartlist_new(); // smartlist of entries
637 // First, parse the inputs, and accumulate a list of protocol names.
638 SMARTLIST_FOREACH_BEGIN(list_of_proto_strings
, const char *, vote
) {
639 smartlist_t
*unexpanded
= parse_protocol_list(vote
);
641 log_warn(LD_NET
, "I failed with parsing a protocol list from "
642 "an authority. The offending string was: %s",
646 SMARTLIST_FOREACH_BEGIN(unexpanded
, const proto_entry_t
*, ent
) {
647 if (!smartlist_contains_string(proto_names
,ent
->name
)) {
648 smartlist_add(proto_names
, ent
->name
);
650 } SMARTLIST_FOREACH_END(ent
);
651 smartlist_add(parsed
, unexpanded
);
652 } SMARTLIST_FOREACH_END(vote
);
654 // Sort the list of names.
655 smartlist_sort_strings(proto_names
);
657 // For each named protocol, compute the consensus.
659 // This is not super-efficient, but it's not critical path.
660 SMARTLIST_FOREACH_BEGIN(proto_names
, const char *, name
) {
662 memset(counts
, 0, sizeof(counts
));
663 // Count how many votes we got for each bit.
664 SMARTLIST_FOREACH_BEGIN(parsed
, const smartlist_t
*, vote
) {
665 const proto_entry_t
*ent
= find_entry_by_name(vote
, name
);
669 for (int i
= 0; i
< 64; ++i
) {
670 if ((ent
->bitmask
& BIT(i
)) != 0) {
674 } SMARTLIST_FOREACH_END(vote
);
676 uint64_t result_bitmask
= 0;
677 for (int i
= 0; i
< 64; ++i
) {
678 if (counts
[i
] >= threshold
) {
679 result_bitmask
|= BIT(i
);
682 if (result_bitmask
!= 0) {
683 proto_entry_t
*newent
= tor_malloc_zero(sizeof(proto_entry_t
));
684 newent
->name
= tor_strdup(name
);
685 newent
->bitmask
= result_bitmask
;
686 smartlist_add(result
, newent
);
688 } SMARTLIST_FOREACH_END(name
);
690 char *consensus
= encode_protocol_list(result
);
692 SMARTLIST_FOREACH(result
, proto_entry_t
*, ent
, proto_entry_free(ent
));
693 smartlist_free(result
);
694 smartlist_free(proto_names
); // no need to free members; they are aliases.
695 SMARTLIST_FOREACH_BEGIN(parsed
, smartlist_t
*, v
) {
696 SMARTLIST_FOREACH(v
, proto_entry_t
*, ent
, proto_entry_free(ent
));
698 } SMARTLIST_FOREACH_END(v
);
699 smartlist_free(parsed
);
704 /** Return true if every protocol version described in the string <b>s</b> is
705 * one that we support, and false otherwise. If <b>missing_out</b> is
706 * provided, set it to the list of protocols we do not support.
708 * If the protocol version string is unparseable, treat it as if it defines no
709 * protocols, and return 1.
712 protover_all_supported(const char *s
, char **missing_out
)
718 smartlist_t
*entries
= parse_protocol_list(s
);
719 if (BUG(entries
== NULL
)) {
720 log_warn(LD_NET
, "Received an unparseable protocol list %s"
721 " from the consensus", escaped(s
));
724 const smartlist_t
*supported
= get_supported_protocol_list();
725 smartlist_t
*missing
= smartlist_new();
727 SMARTLIST_FOREACH_BEGIN(entries
, const proto_entry_t
*, ent
) {
728 const proto_entry_t
*mine
= find_entry_by_name(supported
, ent
->name
);
730 if (ent
->bitmask
!= 0) {
731 proto_entry_t
*m
= tor_malloc_zero(sizeof(proto_entry_t
));
732 m
->name
= tor_strdup(ent
->name
);
733 m
->bitmask
= ent
->bitmask
;
734 smartlist_add(missing
, m
);
739 uint64_t missing_mask
= ent
->bitmask
& ~mine
->bitmask
;
740 if (missing_mask
!= 0) {
741 proto_entry_t
*m
= tor_malloc_zero(sizeof(proto_entry_t
));
742 m
->name
= tor_strdup(ent
->name
);
743 m
->bitmask
= missing_mask
;
744 smartlist_add(missing
, m
);
746 } SMARTLIST_FOREACH_END(ent
);
748 const int all_supported
= (smartlist_len(missing
) == 0);
749 if (!all_supported
&& missing_out
) {
750 *missing_out
= encode_protocol_list(missing
);
753 SMARTLIST_FOREACH(missing
, proto_entry_t
*, ent
, proto_entry_free(ent
));
754 smartlist_free(missing
);
756 SMARTLIST_FOREACH(entries
, proto_entry_t
*, ent
, proto_entry_free(ent
));
757 smartlist_free(entries
);
759 return all_supported
;
762 /** Helper: return the member of 'protos' whose name is
763 * 'name', or NULL if there is no such member. */
764 static const proto_entry_t
*
765 find_entry_by_name(const smartlist_t
*protos
, const char *name
)
770 SMARTLIST_FOREACH_BEGIN(protos
, const proto_entry_t
*, ent
) {
771 if (!strcmp(ent
->name
, name
)) {
774 } SMARTLIST_FOREACH_END(ent
);
779 /** Helper: Given a list of proto_entry_t, return true iff
780 * <b>pr</b>=<b>ver</b> is included in that list. */
782 protocol_list_contains(const smartlist_t
*protos
,
783 protocol_type_t pr
, uint32_t ver
)
785 if (BUG(protos
== NULL
)) {
786 return 0; // LCOV_EXCL_LINE
788 const char *pr_name
= protocol_type_to_str(pr
);
789 if (BUG(pr_name
== NULL
)) {
790 return 0; // LCOV_EXCL_LINE
792 if (ver
> MAX_PROTOCOL_VERSION
) {
796 const proto_entry_t
*ent
= find_entry_by_name(protos
, pr_name
);
798 return (ent
->bitmask
& BIT(ver
)) != 0;
803 /** Return a string describing the protocols supported by tor version
804 * <b>version</b>, or an empty string if we cannot tell.
806 * Note that this is only used to infer protocols for Tor versions that
807 * can't declare their own.
809 /// C_RUST_COUPLED: src/rust/protover/protover.rs `compute_for_old_tor`
811 protover_compute_for_old_tor(const char *version
)
813 if (version
== NULL
) {
814 /* No known version; guess the oldest series that is still supported. */
815 version
= "0.2.5.15";
818 if (tor_version_as_new_as(version
,
819 FIRST_TOR_VERSION_TO_ADVERTISE_PROTOCOLS
)) {
821 } else if (tor_version_as_new_as(version
, "0.2.9.1-alpha")) {
822 /* 0.2.9.1-alpha HSRend=2 */
823 return "Cons=1-2 Desc=1-2 DirCache=1 HSDir=1 HSIntro=3 HSRend=1-2 "
824 "Link=1-4 LinkAuth=1 "
825 "Microdesc=1-2 Relay=1-2";
826 } else if (tor_version_as_new_as(version
, "0.2.7.5")) {
827 /* 0.2.7-stable added Desc=2, Microdesc=2, Cons=2, which indicate
828 * ed25519 support. We'll call them present only in "stable" 027,
830 return "Cons=1-2 Desc=1-2 DirCache=1 HSDir=1 HSIntro=3 HSRend=1 "
831 "Link=1-4 LinkAuth=1 "
832 "Microdesc=1-2 Relay=1-2";
833 } else if (tor_version_as_new_as(version
, "0.2.4.19")) {
834 /* No currently supported Tor server versions are older than this, or
835 * lack these protocols. */
836 return "Cons=1 Desc=1 DirCache=1 HSDir=1 HSIntro=3 HSRend=1 "
837 "Link=1-4 LinkAuth=1 "
838 "Microdesc=1 Relay=1-2";
840 /* Cannot infer protocols. */
846 * Release all storage held by static fields in protover.c
849 protover_free_all(void)
851 if (supported_protocol_list
) {
852 smartlist_t
*entries
= supported_protocol_list
;
853 SMARTLIST_FOREACH(entries
, proto_entry_t
*, ent
, proto_entry_free(ent
));
854 smartlist_free(entries
);
855 supported_protocol_list
= NULL
;
859 #endif /* !defined(HAVE_RUST) */