summaryrefslogtreecommitdiff
path: root/src/feature/hs/hs_circuit.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2020-01-16 19:10:26 -0500
committerNick Mathewson <nickm@torproject.org>2020-01-21 10:31:36 -0500
commitb6250236a2427b116c819be3305727fcbefdb424 (patch)
treeba963b9bec1245626d8c45bbdc4e0ce9c902f9ae /src/feature/hs/hs_circuit.c
parent46e6a4819aefb09b26924026833ead3eda533328 (diff)
downloadtor-b6250236a2427b116c819be3305727fcbefdb424.tar.gz
tor-b6250236a2427b116c819be3305727fcbefdb424.zip
Pass multiple subcredentials all the way down to hs_ntor.
This approach saves us a pair of curve25519 operations for every subcredential but the first. It is not yet constant-time. I've noted a few places where IMO we should refactor the code so that the complete list of subcredentials is passed in earlier.
Diffstat (limited to 'src/feature/hs/hs_circuit.c')
-rw-r--r--src/feature/hs/hs_circuit.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/feature/hs/hs_circuit.c b/src/feature/hs/hs_circuit.c
index fb3694b2d4..48a92962f4 100644
--- a/src/feature/hs/hs_circuit.c
+++ b/src/feature/hs/hs_circuit.c
@@ -983,7 +983,10 @@ hs_circ_handle_introduce2(const hs_service_t *service,
* parsed, decrypted and key material computed correctly. */
data.auth_pk = &ip->auth_key_kp.pubkey;
data.enc_kp = &ip->enc_key_kp;
- data.subcredential = subcredential;
+ // XXXX We should replace these elements with something precomputed for
+ // XXXX the onionbalance case.
+ data.n_subcredentials = 1;
+ data.subcredentials = subcredential;
data.payload = payload;
data.payload_len = payload_len;
data.link_specifiers = smartlist_new();