Move list of default directory authorities to file scope

This commit is contained in:
Andrea Shepard 2015-04-17 06:33:17 +00:00
parent e891deb021
commit 42cee727fa

View file

@ -841,15 +841,9 @@ escaped_safe_str(const char *address)
return escaped(address); return escaped(address);
} }
/** Add the default directory authorities directly into the trusted dir list, /** List of default directory authorities */
* but only add them insofar as they share bits with <b>type</b>.
* Each authority's bits are restricted to the bits shared with <b>type</b>. static const char *default_authorities[] = {
* If <b>type</b> is ALL_DIRINFO or NO_DIRINFO (zero), add all authorities. */
static void
add_default_trusted_dir_authorities(dirinfo_type_t type)
{
int i;
const char *authorities[] = {
"moria1 orport=9101 " "moria1 orport=9101 "
"v3ident=D586D18309DED4CD6D57C18FDB97EFA96D330566 " "v3ident=D586D18309DED4CD6D57C18FDB97EFA96D330566 "
"128.31.0.39:9131 9695 DFC3 5FFE B861 329B 9F1A B04C 4639 7020 CE31", "128.31.0.39:9131 9695 DFC3 5FFE B861 329B 9F1A B04C 4639 7020 CE31",
@ -880,11 +874,20 @@ add_default_trusted_dir_authorities(dirinfo_type_t type)
"v3ident=23D15D965BC35114467363C165C4F724B64B4F66 " "v3ident=23D15D965BC35114467363C165C4F724B64B4F66 "
"199.254.238.52:80 74A9 1064 6BCE EFBC D2E8 74FC 1DC9 9743 0F96 8145", "199.254.238.52:80 74A9 1064 6BCE EFBC D2E8 74FC 1DC9 9743 0F96 8145",
NULL NULL
}; };
for (i=0; authorities[i]; i++) {
if (parse_dir_authority_line(authorities[i], type, 0)<0) { /** Add the default directory authorities directly into the trusted dir list,
* but only add them insofar as they share bits with <b>type</b>.
* Each authority's bits are restricted to the bits shared with <b>type</b>.
* If <b>type</b> is ALL_DIRINFO or NO_DIRINFO (zero), add all authorities. */
static void
add_default_trusted_dir_authorities(dirinfo_type_t type)
{
int i;
for (i=0; default_authorities[i]; i++) {
if (parse_dir_authority_line(default_authorities[i], type, 0)<0) {
log_err(LD_BUG, "Couldn't parse internal DirAuthority line %s", log_err(LD_BUG, "Couldn't parse internal DirAuthority line %s",
authorities[i]); default_authorities[i]);
} }
} }
} }