summaryrefslogtreecommitdiff
path: root/src/or/hs_descriptor.h
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2017-02-03 15:30:46 -0500
committerNick Mathewson <nickm@torproject.org>2017-08-08 20:29:33 -0400
commit00a02a3a59f6e44619e6caed150b001acae37231 (patch)
tree5b58a26b283d85688b8f4d524a0c67562c93b47a /src/or/hs_descriptor.h
parentc4ba4d4cc8a1d31f78d1dc54c7851bed32a25e5c (diff)
downloadtor-00a02a3a59f6e44619e6caed150b001acae37231.tar.gz
tor-00a02a3a59f6e44619e6caed150b001acae37231.zip
prop224: Service v3 descriptor creation and logic
This commit adds the functionality for a service to build its descriptor. Also, a global call to build all descriptors for all services is added to the service scheduled events. Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/or/hs_descriptor.h')
-rw-r--r--src/or/hs_descriptor.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/or/hs_descriptor.h b/src/or/hs_descriptor.h
index 80ddf8978a..2f1b0160ef 100644
--- a/src/or/hs_descriptor.h
+++ b/src/or/hs_descriptor.h
@@ -23,6 +23,9 @@
/* The latest descriptor format version we support. */
#define HS_DESC_SUPPORTED_FORMAT_VERSION_MAX 3
+/* Default lifetime of a descriptor in seconds. The valus is set at 3 hours
+ * which is 180 minutes or 10800 seconds. */
+#define HS_DESC_DEFAULT_LIFETIME (3 * 60 * 60)
/* Maximum lifetime of a descriptor in seconds. The value is set at 12 hours
* which is 720 minutes or 43200 seconds. */
#define HS_DESC_MAX_LIFETIME (12 * 60 * 60)
@@ -65,12 +68,14 @@ typedef struct hs_desc_link_specifier_t {
* specification. */
uint8_t type;
- /* It's either an address/port or a legacy identity fingerprint. */
+ /* It must be one of these types, can't be more than one. */
union {
/* IP address and port of the relay use to extend. */
tor_addr_port_t ap;
/* Legacy identity. A 20-byte SHA1 identity fingerprint. */
uint8_t legacy_id[DIGEST_LEN];
+ /* ed25519 identity. A 32-byte key. */
+ uint8_t ed25519_id[ED25519_PUBKEY_LEN];
} u;
} hs_desc_link_specifier_t;
@@ -201,6 +206,11 @@ void hs_descriptor_free(hs_descriptor_t *desc);
void hs_desc_plaintext_data_free(hs_desc_plaintext_data_t *desc);
void hs_desc_encrypted_data_free(hs_desc_encrypted_data_t *desc);
+void hs_desc_link_specifier_free(hs_desc_link_specifier_t *ls);
+hs_desc_link_specifier_t *hs_desc_link_specifier_new(
+ const extend_info_t *info, uint8_t type);
+void hs_descriptor_free_intro_points(hs_descriptor_t *desc);
+
int hs_desc_encode_descriptor(const hs_descriptor_t *desc,
const ed25519_keypair_t *signing_kp,
char **encoded_out);