summaryrefslogtreecommitdiff
path: root/other
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2014-01-20 12:48:26 -0500
committerirungentoo <irungentoo@gmail.com>2014-01-20 12:48:26 -0500
commitaff6b112c00a9bed01c1e030ede91ef9bc7753d6 (patch)
treef42dc26ac5544797562746002cbe149270a468b0 /other
parent66f0a7eaf0b538bc117715678c97358da605c023 (diff)
parent9aa94bfe1d86dc8e960a57b6eb0402be75ff77f1 (diff)
Merge branch 'onion'
Diffstat (limited to 'other')
-rw-r--r--other/DHT_bootstrap.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/other/DHT_bootstrap.c b/other/DHT_bootstrap.c
index 6561fe70..479e97a6 100644
--- a/other/DHT_bootstrap.c
+++ b/other/DHT_bootstrap.c
@@ -102,9 +102,19 @@ int main(int argc, char *argv[])
102 ip_init(&ip, ipv6enabled); 102 ip_init(&ip, ipv6enabled);
103 103
104 DHT *dht = new_DHT(new_net_crypto(new_networking(ip, PORT))); 104 DHT *dht = new_DHT(new_net_crypto(new_networking(ip, PORT)));
105 Onion *onion = new_onion(dht);
106 Onion_Announce *onion_a = new_onion_announce(dht);
107
108 if (!(onion && onion_a)) {
109 printf("Something failed to initialize.\n");
110 exit(1);
111 }
105 perror("Initialization"); 112 perror("Initialization");
106 113
107 manage_keys(dht); 114 manage_keys(dht);
115 /* We want our DHT public key to be the same as our internal one since this is a bootstrap server */
116 memcpy(dht->self_public_key, dht->c->self_public_key, crypto_box_PUBLICKEYBYTES);
117 memcpy(dht->self_secret_key, dht->c->self_secret_key, crypto_box_SECRETKEYBYTES);
108 printf("Public key: "); 118 printf("Public key: ");
109 uint32_t i; 119 uint32_t i;
110 120
@@ -152,7 +162,7 @@ int main(int argc, char *argv[])
152 do_DHT(dht); 162 do_DHT(dht);
153 163
154 if (is_timeout(last_LANdiscovery, is_waiting_for_dht_connection ? 5 : LAN_DISCOVERY_INTERVAL)) { 164 if (is_timeout(last_LANdiscovery, is_waiting_for_dht_connection ? 5 : LAN_DISCOVERY_INTERVAL)) {
155 send_LANdiscovery(htons(PORT), dht->c); 165 send_LANdiscovery(htons(PORT), dht);
156 last_LANdiscovery = unix_time(); 166 last_LANdiscovery = unix_time();
157 } 167 }
158 168