diff options
author | Neel Chauhan <neel@neelc.org> | 2017-11-08 18:33:30 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-11-12 17:05:25 -0500 |
commit | 0ee50a414cb970a4ce192075c6414dbfbdb0b0db (patch) | |
tree | 893531eb521032322d6b4c2800bc1c3fd85217a2 /src/or/nodelist.c | |
parent | 23820a39439637f401b24085dfe7a703dee88c43 (diff) | |
download | tor-0ee50a414cb970a4ce192075c6414dbfbdb0b0db.tar.gz tor-0ee50a414cb970a4ce192075c6414dbfbdb0b0db.zip |
Introduce node_get_curve25519_onion_key()
Diffstat (limited to 'src/or/nodelist.c')
-rw-r--r-- | src/or/nodelist.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/or/nodelist.c b/src/or/nodelist.c index f2e979be8b..bcd5fa6b85 100644 --- a/src/or/nodelist.c +++ b/src/or/nodelist.c @@ -1633,6 +1633,18 @@ node_has_curve25519_onion_key(const node_t *node) return 0; } +/** Return the curve25519 key of <b>node</b>, or NULL if none. */ +curve25519_public_key_t * +node_get_curve25519_onion_key(const node_t *node) +{ + if (node->ri) + return node->ri->onion_curve25519_pkey; + else if (node->md) + return node->md->onion_curve25519_pkey; + else + return NULL; +} + /** Refresh the country code of <b>ri</b>. This function MUST be called on * each router when the GeoIP database is reloaded, and on all new routers. */ void |