summaryrefslogtreecommitdiff
path: root/src/feature/hs/hs_cell.h
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_cell.h
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_cell.h')
-rw-r--r--src/feature/hs/hs_cell.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/feature/hs/hs_cell.h b/src/feature/hs/hs_cell.h
index 58cc401cc0..cc2e7b5817 100644
--- a/src/feature/hs/hs_cell.h
+++ b/src/feature/hs/hs_cell.h
@@ -57,9 +57,14 @@ typedef struct hs_cell_introduce2_data_t {
owned by the introduction point object through which we received the
INTRO2 cell*/
const curve25519_keypair_t *enc_kp;
- /** Subcredentials of the service. Pointer owned by the descriptor that owns
- the introduction point through which we received the INTRO2 cell. */
- const struct hs_subcredential_t *subcredential;
+ /**
+ * Length of the subcredentials array below.
+ **/
+ int n_subcredentials;
+ /** Array of <b>n_subcredentials</b> subcredentials for the service. Pointer
+ * owned by the descriptor that owns the introduction point through which we
+ * received the INTRO2 cell. */
+ const struct hs_subcredential_t *subcredentials;
/** Payload of the received encoded cell. */
const uint8_t *payload;
/** Size of the payload of the received encoded cell. */