2017-03-15 21:13:17 +01:00
|
|
|
/* Copyright (c) 2016-2017, The Tor Project, Inc. */
|
2016-05-31 20:51:30 +02:00
|
|
|
/* See LICENSE for licensing information */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \file hs_common.h
|
2016-03-29 21:08:04 +02:00
|
|
|
* \brief Header file containing common data for the whole HS subsytem.
|
2016-05-31 20:51:30 +02:00
|
|
|
**/
|
|
|
|
|
|
|
|
#ifndef TOR_HS_COMMON_H
|
|
|
|
#define TOR_HS_COMMON_H
|
|
|
|
|
|
|
|
#include "or.h"
|
|
|
|
|
|
|
|
/* Protocol version 2. Use this instead of hardcoding "2" in the code base,
|
|
|
|
* this adds a clearer semantic to the value when used. */
|
|
|
|
#define HS_VERSION_TWO 2
|
2016-08-11 21:21:54 +02:00
|
|
|
/* Version 3 of the protocol (prop224). */
|
|
|
|
#define HS_VERSION_THREE 3
|
2016-05-31 20:51:30 +02:00
|
|
|
|
2016-09-05 17:58:19 +02:00
|
|
|
/* String prefix for the signature of ESTABLISH_INTRO */
|
|
|
|
#define ESTABLISH_INTRO_SIG_PREFIX "Tor establish-intro cell v1"
|
|
|
|
|
2016-12-22 22:40:21 +01:00
|
|
|
int hs_check_service_private_dir(const char *username, const char *path,
|
|
|
|
unsigned int dir_group_readable,
|
|
|
|
unsigned int create);
|
|
|
|
|
2016-05-31 20:51:30 +02:00
|
|
|
void rend_data_free(rend_data_t *data);
|
|
|
|
rend_data_t *rend_data_dup(const rend_data_t *data);
|
|
|
|
rend_data_t *rend_data_client_create(const char *onion_address,
|
|
|
|
const char *desc_id,
|
|
|
|
const char *cookie,
|
|
|
|
rend_auth_type_t auth_type);
|
|
|
|
rend_data_t *rend_data_service_create(const char *onion_address,
|
|
|
|
const char *pk_digest,
|
|
|
|
const uint8_t *cookie,
|
|
|
|
rend_auth_type_t auth_type);
|
|
|
|
const char *rend_data_get_address(const rend_data_t *rend_data);
|
|
|
|
const char *rend_data_get_desc_id(const rend_data_t *rend_data,
|
|
|
|
uint8_t replica, size_t *len_out);
|
|
|
|
const uint8_t *rend_data_get_pk_digest(const rend_data_t *rend_data,
|
|
|
|
size_t *len_out);
|
|
|
|
|
|
|
|
#endif /* TOR_HS_COMMON_H */
|
2016-12-14 21:41:08 +01:00
|
|
|
|