summaryrefslogtreecommitdiff
path: root/src/or/dirvote.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-12-04 15:58:18 -0500
committerNick Mathewson <nickm@torproject.org>2013-01-02 14:11:14 -0500
commit5b3dd1610cf2147509167332bf298fc821e6a102 (patch)
tree081d16b883ba26f1b606656687470184676fb090 /src/or/dirvote.c
parent6c883bc6384b3260d791e407b42ffcabb8276beb (diff)
downloadtor-5b3dd1610cf2147509167332bf298fc821e6a102.tar.gz
tor-5b3dd1610cf2147509167332bf298fc821e6a102.zip
Wrangle curve25519 onion keys: generate, store, load, publish, republish
Here we try to handle curve25519 onion keys from generating them, loading and storing them, publishing them in our descriptors, putting them in microdescriptors, and so on. This commit is untested and probably buggy like whoa
Diffstat (limited to 'src/or/dirvote.c')
-rw-r--r--src/or/dirvote.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/or/dirvote.c b/src/or/dirvote.c
index 836349375c..6236d2a026 100644
--- a/src/or/dirvote.c
+++ b/src/or/dirvote.c
@@ -3554,6 +3554,15 @@ dirvote_create_microdescriptor(const routerinfo_t *ri, int consensus_method)
smartlist_add_asprintf(chunks, "onion-key\n%s", key);
+ if (consensus_method >= MIN_METHOD_FOR_NTOR_KEY &&
+ ri->onion_curve25519_pkey) {
+ char kbuf[128];
+ base64_encode(kbuf, sizeof(kbuf),
+ (const char*)ri->onion_curve25519_pkey->public_key,
+ CURVE25519_PUBKEY_LEN);
+ smartlist_add_asprintf(chunks, "ntor-onion-key %s", kbuf);
+ }
+
if (consensus_method >= MIN_METHOD_FOR_A_LINES &&
!tor_addr_is_null(&ri->ipv6_addr) && ri->ipv6_orport)
smartlist_add_asprintf(chunks, "a %s\n",