aboutsummaryrefslogtreecommitdiff
path: root/src/feature/hs/hs_descriptor.h
diff options
context:
space:
mode:
authorSuphanat Chunhapanya <haxx.pop@gmail.com>2018-04-14 04:04:31 +0700
committerDavid Goulet <dgoulet@torproject.org>2018-09-07 13:59:22 -0400
commitfa50aee3663b6f6dca61e330df59af6d8c035fe4 (patch)
tree98dc3f788f4f9a591cc1020ac3ad1af4acf940c9 /src/feature/hs/hs_descriptor.h
parent10f4c46e50478e7620f3c23413ddd292d883e8ca (diff)
downloadtor-fa50aee3663b6f6dca61e330df59af6d8c035fe4.tar.gz
tor-fa50aee3663b6f6dca61e330df59af6d8c035fe4.zip
hs-v3: Encrypt the descriptor using a cookie
Previously, we encrypted the descriptor without the descriptor cookie. This commit, when the client auth is enabled, the descriptor cookie is always used. I also removed the code that is used to generate fake auth clients because it will not be used anymore. Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/feature/hs/hs_descriptor.h')
-rw-r--r--src/feature/hs/hs_descriptor.h7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/feature/hs/hs_descriptor.h b/src/feature/hs/hs_descriptor.h
index 3e7dcc457d..8700164323 100644
--- a/src/feature/hs/hs_descriptor.h
+++ b/src/feature/hs/hs_descriptor.h
@@ -37,12 +37,6 @@ struct link_specifier_t;
#define HS_DESC_CERT_LIFETIME (54 * 60 * 60)
/* Length of the salt needed for the encrypted section of a descriptor. */
#define HS_DESC_ENCRYPTED_SALT_LEN 16
-/* Length of the secret input needed for the KDF construction which derives
- * the encryption key for the encrypted data section of the descriptor. This
- * adds up to 68 bytes being the blinded key, hashed subcredential and
- * revision counter. */
-#define HS_DESC_ENCRYPTED_SECRET_INPUT_LEN \
- ED25519_PUBKEY_LEN + DIGEST256_LEN + sizeof(uint64_t)
/* Length of the KDF output value which is the length of the secret key,
* the secret IV and MAC key length which is the length of H() output. */
#define HS_DESC_ENCRYPTED_KDF_OUTPUT_LEN \
@@ -278,6 +272,7 @@ void hs_descriptor_clear_intro_points(hs_descriptor_t *desc);
MOCK_DECL(int,
hs_desc_encode_descriptor,(const hs_descriptor_t *desc,
const ed25519_keypair_t *signing_kp,
+ const uint8_t *descriptor_cookie,
char **encoded_out));
int hs_desc_decode_descriptor(const char *encoded,