diff options
author | Nick Mathewson <nickm@torproject.org> | 2016-09-14 16:00:23 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-11-11 15:29:13 -0500 |
commit | e054211237e88cace9f7d7ff403600c192df9a31 (patch) | |
tree | 3f1f21e932596c22e8132bff1ce8f2cda00a0052 /src/or/circuitbuild.c | |
parent | 1be671f505554e0c3e9577a60d7c94e45c9a2759 (diff) | |
download | tor-e054211237e88cace9f7d7ff403600c192df9a31.tar.gz tor-e054211237e88cace9f7d7ff403600c192df9a31.zip |
Migrate extend2/create2 cell encoding to Trunnel
(Not extended2/created2; that's too simple.)
Incidentally, add ed25519 identities to the mix when we have them.
Diffstat (limited to 'src/or/circuitbuild.c')
-rw-r--r-- | src/or/circuitbuild.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c index a767f40086..e578a94019 100644 --- a/src/or/circuitbuild.c +++ b/src/or/circuitbuild.c @@ -1041,6 +1041,10 @@ circuit_send_next_onion_skin(origin_circuit_t *circ) ec.orport_ipv4.port = hop->extend_info->port; tor_addr_make_unspec(&ec.orport_ipv6.addr); memcpy(ec.node_id, hop->extend_info->identity_digest, DIGEST_LEN); + /* 15056 Either here or in the onion.c encoding code, we should make an + * option to decide whether we declare the ED identity (if we know one) */ + memcpy(&ec.ed_pubkey, &hop->extend_info->ed_identity, + sizeof(ed25519_public_key_t)); len = onion_skin_create(ec.create_cell.handshake_type, hop->extend_info, @@ -1181,7 +1185,7 @@ circuit_extend(cell_t *cell, circuit_t *circ) } n_chan = channel_get_for_extend((const char*)ec.node_id, - /* ed25519 ID: put it here. 15056 */ + /*&ec.ed25519_id 15056 */ &ec.orport_ipv4.addr, &msg, &should_launch); @@ -1193,7 +1197,7 @@ circuit_extend(cell_t *cell, circuit_t *circ) circ->n_hop = extend_info_new(NULL /*nickname*/, (const char*)ec.node_id, - NULL, /*ed25519 ID: get from ec. 15056*/ + &ec.ed_pubkey, NULL, /*onion_key*/ NULL, /*curve25519_key*/ &ec.orport_ipv4.addr, @@ -2367,7 +2371,7 @@ extend_info_new(const char *nickname, { extend_info_t *info = tor_malloc_zero(sizeof(extend_info_t)); memcpy(info->identity_digest, rsa_id_digest, DIGEST_LEN); - if (ed_id) + if (ed_id && !ed25519_public_key_is_zero(ed_id)) memcpy(&info->ed_identity, ed_id, sizeof(ed25519_public_key_t)); if (nickname) strlcpy(info->nickname, nickname, sizeof(info->nickname)); |