|
@@ -1362,7 +1362,9 @@ router_get_trusteddirserver_by_digest(const char *digest)
|
|
|
}
|
|
|
|
|
|
|
|
|
- * key hashes to <b>digest</b>, or NULL if no such authority is known.
|
|
|
+ * key hashes to <b>digest</b>, or NULL if no such fallback is in the list of
|
|
|
+ * fallback_dir_servers. (fallback_dir_servers is affected by the FallbackDir
|
|
|
+ * and UseDefaultFallbackDirs torrc options.)
|
|
|
*/
|
|
|
dir_server_t *
|
|
|
router_get_fallback_dirserver_by_digest(const char *digest)
|
|
@@ -1370,6 +1372,9 @@ router_get_fallback_dirserver_by_digest(const char *digest)
|
|
|
if (!fallback_dir_servers)
|
|
|
return NULL;
|
|
|
|
|
|
+ if (!digest)
|
|
|
+ return NULL;
|
|
|
+
|
|
|
SMARTLIST_FOREACH(fallback_dir_servers, dir_server_t *, ds,
|
|
|
{
|
|
|
if (tor_memeq(ds->digest, digest, DIGEST_LEN))
|
|
@@ -1379,6 +1384,17 @@ router_get_fallback_dirserver_by_digest(const char *digest)
|
|
|
return NULL;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ * or 0 if no such fallback is in the list of fallback_dir_servers.
|
|
|
+ * (fallback_dir_servers is affected by the FallbackDir and
|
|
|
+ * UseDefaultFallbackDirs torrc options.)
|
|
|
+ */
|
|
|
+int
|
|
|
+router_digest_is_fallback_dir(const char *digest)
|
|
|
+{
|
|
|
+ return (router_get_fallback_dirserver_by_digest(digest) != NULL);
|
|
|
+}
|
|
|
+
|
|
|
|
|
|
* v3 identity key hashes to <b>digest</b>, or NULL if no such authority
|
|
|
* is known.
|