diff options
author | David Goulet <dgoulet@torproject.org> | 2022-06-29 12:00:41 -0400 |
---|---|---|
committer | Micah Elizabeth Scott <beth@torproject.org> | 2023-05-10 07:37:11 -0700 |
commit | 35227a7a15dd1ff2e993c21b2a5da8d6498c0a3e (patch) | |
tree | b1235193545a0efa2756dcc6f31e4899e7f933e2 | |
parent | 4eb783e97b20c830a1a4dff91cef13bcfd4f713f (diff) | |
download | tor-35227a7a15dd1ff2e993c21b2a5da8d6498c0a3e.tar.gz tor-35227a7a15dd1ff2e993c21b2a5da8d6498c0a3e.zip |
trunnel: Centralize the INTRO1 extension type
Signed-off-by: David Goulet <dgoulet@torproject.org>
-rw-r--r-- | src/feature/hs/hs_cell.c | 4 | ||||
-rw-r--r-- | src/trunnel/hs/cell_introduce1.h | 1 | ||||
-rw-r--r-- | src/trunnel/hs/cell_introduce1.trunnel | 2 |
3 files changed, 5 insertions, 2 deletions
diff --git a/src/feature/hs/hs_cell.c b/src/feature/hs/hs_cell.c index 004a7fcbe1..ab9283dc1b 100644 --- a/src/feature/hs/hs_cell.c +++ b/src/feature/hs/hs_cell.c @@ -457,7 +457,7 @@ build_introduce_cc_extension(trn_extension_t *extensions) /* Build CC request extension. */ field = trn_extension_field_new(); trn_extension_field_set_field_type(field, - TRUNNEL_EXT_TYPE_CC_FIELD_REQUEST); + TRUNNEL_EXT_TYPE_CC_REQUEST); /* No payload indicating a request to use congestion control. */ trn_extension_field_set_field_len(field, 0); @@ -933,7 +933,7 @@ parse_introduce_cell_extension(const hs_service_t *service, tor_assert(field); switch (trn_extension_field_get_field_type(field)) { - case TRUNNEL_EXT_TYPE_CC_FIELD_REQUEST: + case TRUNNEL_EXT_TYPE_CC_REQUEST: /* CC requests, enable it. */ data->rdv_data.cc_enabled = 1; data->pv.protocols_known = 1; diff --git a/src/trunnel/hs/cell_introduce1.h b/src/trunnel/hs/cell_introduce1.h index 90d34f37f2..827c107b6b 100644 --- a/src/trunnel/hs/cell_introduce1.h +++ b/src/trunnel/hs/cell_introduce1.h @@ -19,6 +19,7 @@ struct link_specifier_st; #define TRUNNEL_HS_INTRO_AUTH_KEY_TYPE_LEGACY1 1 #define TRUNNEL_HS_INTRO_AUTH_KEY_TYPE_ED25519 2 #define TRUNNEL_HS_INTRO_ONION_KEY_TYPE_NTOR 1 +#define TRUNNEL_EXT_TYPE_CC_REQUEST 1 #define TRUNNEL_EXT_TYPE_POW 2 #define TRUNNEL_POW_NONCE_LEN 16 #define TRUNNEL_POW_SOLUTION_LEN 16 diff --git a/src/trunnel/hs/cell_introduce1.trunnel b/src/trunnel/hs/cell_introduce1.trunnel index 35e00bed94..a92fc76ab5 100644 --- a/src/trunnel/hs/cell_introduce1.trunnel +++ b/src/trunnel/hs/cell_introduce1.trunnel @@ -78,6 +78,8 @@ struct trn_cell_introduce_encrypted { * INTRODUCE1 cell (encrypted section) extensions. */ +/* Cell extenstion type Congestion Control Request. */ +const TRUNNEL_EXT_TYPE_CC_REQUEST = 0x01; /* Cell extension type PoW. */ const TRUNNEL_EXT_TYPE_POW = 0x02; |