summaryrefslogtreecommitdiff
path: root/src/or/nodelist.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-07-05 09:49:12 -0400
committerNick Mathewson <nickm@torproject.org>2017-07-05 09:49:12 -0400
commit3402b140897ca22301c2f1d741453466d237222a (patch)
tree1ead67609d5a87cbe20745a3cf9274ac9a52a899 /src/or/nodelist.c
parentb6c8530fc3f5023920b5ca1c77e58785a46441e9 (diff)
parent551ad20c43b39c384cbab9eee5442d4fa9cfefb1 (diff)
downloadtor-3402b140897ca22301c2f1d741453466d237222a.tar.gz
tor-3402b140897ca22301c2f1d741453466d237222a.zip
Merge remote-tracking branch 'asn/ticket22727_032_02'
Diffstat (limited to 'src/or/nodelist.c')
-rw-r--r--src/or/nodelist.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/or/nodelist.c b/src/or/nodelist.c
index 3ac5c3e302..6ec7da798f 100644
--- a/src/or/nodelist.c
+++ b/src/or/nodelist.c
@@ -707,6 +707,48 @@ node_supports_ed25519_link_authentication(const node_t *node)
return 0;
}
+/** Return true iff <b>node</b> supports the hidden service directory version
+ * 3 protocol (proposal 224). */
+int
+node_supports_v3_hsdir(const node_t *node)
+{
+ tor_assert(node);
+
+ if (node->rs) {
+ return node->rs->supports_v3_hsdir;
+ }
+ if (node->ri) {
+ if (node->ri->protocol_list == NULL) {
+ return 0;
+ }
+ return protocol_list_supports_protocol(node->ri->protocol_list,
+ PRT_HSDIR, PROTOVER_HSDIR_V3);
+ }
+ tor_assert_nonfatal_unreached_once();
+ return 0;
+}
+
+/** Return true iff <b>node</b> supports ed25519 authentication as an hidden
+ * service introduction point.*/
+int
+node_supports_ed25519_hs_intro(const node_t *node)
+{
+ tor_assert(node);
+
+ if (node->rs) {
+ return node->rs->supports_ed25519_hs_intro;
+ }
+ if (node->ri) {
+ if (node->ri->protocol_list == NULL) {
+ return 0;
+ }
+ return protocol_list_supports_protocol(node->ri->protocol_list,
+ PRT_HSINTRO, PROTOVER_HS_INTRO_V3);
+ }
+ tor_assert_nonfatal_unreached_once();
+ return 0;
+}
+
/** Return the RSA ID key's SHA1 digest for the provided node. */
const uint8_t *
node_get_rsa_id_digest(const node_t *node)