2010-07-21 17:52:54 +02:00
|
|
|
/* Copyright (c) 2001 Matej Pfajfar.
|
|
|
|
* Copyright (c) 2001-2004, Roger Dingledine.
|
|
|
|
* Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
|
2017-03-15 21:13:17 +01:00
|
|
|
* Copyright (c) 2007-2017, The Tor Project, Inc. */
|
2010-07-21 17:52:54 +02:00
|
|
|
/* See LICENSE for licensing information */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \file rendcommon.h
|
2010-07-28 17:42:33 +02:00
|
|
|
* \brief Header file for rendcommon.c.
|
2010-07-21 17:52:54 +02:00
|
|
|
**/
|
|
|
|
|
2012-10-12 18:13:10 +02:00
|
|
|
#ifndef TOR_RENDCOMMON_H
|
|
|
|
#define TOR_RENDCOMMON_H
|
2010-07-21 17:52:54 +02:00
|
|
|
|
2015-06-25 22:13:15 +02:00
|
|
|
typedef enum rend_intro_point_failure_t {
|
|
|
|
INTRO_POINT_FAILURE_GENERIC = 0,
|
|
|
|
INTRO_POINT_FAILURE_TIMEOUT = 1,
|
|
|
|
INTRO_POINT_FAILURE_UNREACHABLE = 2,
|
|
|
|
} rend_intro_point_failure_t;
|
|
|
|
|
2010-07-21 17:52:54 +02:00
|
|
|
int rend_cmp_service_ids(const char *one, const char *two);
|
|
|
|
|
|
|
|
void rend_process_relay_cell(circuit_t *circ, const crypt_path_t *layer_hint,
|
2010-12-16 04:47:28 +01:00
|
|
|
int command, size_t length,
|
|
|
|
const uint8_t *payload);
|
2010-07-21 17:52:54 +02:00
|
|
|
|
|
|
|
void rend_service_descriptor_free(rend_service_descriptor_t *desc);
|
2012-01-18 21:53:30 +01:00
|
|
|
int rend_get_service_id(crypto_pk_t *pk, char *out);
|
2010-07-21 17:52:54 +02:00
|
|
|
void rend_encoded_v2_service_descriptor_free(
|
|
|
|
rend_encoded_v2_service_descriptor_t *desc);
|
|
|
|
void rend_intro_point_free(rend_intro_point_t *intro);
|
|
|
|
|
|
|
|
int rend_valid_service_id(const char *query);
|
2015-04-21 20:04:39 +02:00
|
|
|
int rend_valid_descriptor_id(const char *query);
|
2016-02-20 00:32:25 +01:00
|
|
|
int rend_valid_client_name(const char *client_name);
|
2010-07-21 17:52:54 +02:00
|
|
|
int rend_encode_v2_descriptors(smartlist_t *descs_out,
|
|
|
|
rend_service_descriptor_t *desc, time_t now,
|
|
|
|
uint8_t period, rend_auth_type_t auth_type,
|
2012-01-18 21:53:30 +01:00
|
|
|
crypto_pk_t *client_key,
|
2010-07-21 17:52:54 +02:00
|
|
|
smartlist_t *client_cookies);
|
|
|
|
int rend_compute_v2_desc_id(char *desc_id_out, const char *service_id,
|
|
|
|
const char *descriptor_cookie,
|
|
|
|
time_t now, uint8_t replica);
|
|
|
|
void rend_get_descriptor_id_bytes(char *descriptor_id_out,
|
|
|
|
const char *service_id,
|
|
|
|
const char *secret_id_part);
|
2016-02-29 07:47:51 +01:00
|
|
|
int hid_serv_get_responsible_directories(smartlist_t *responsible_dirs,
|
2016-03-15 14:21:29 +01:00
|
|
|
const char *id);
|
2010-07-21 17:52:54 +02:00
|
|
|
|
2016-05-31 20:51:30 +02:00
|
|
|
int rend_circuit_pk_digest_eq(const origin_circuit_t *ocirc,
|
|
|
|
const uint8_t *digest);
|
2015-04-14 05:35:06 +02:00
|
|
|
|
|
|
|
char *rend_auth_encode_cookie(const uint8_t *cookie_in,
|
|
|
|
rend_auth_type_t auth_type);
|
|
|
|
int rend_auth_decode_cookie(const char *cookie_in,
|
|
|
|
uint8_t *cookie_out,
|
|
|
|
rend_auth_type_t *auth_type_out,
|
|
|
|
char **err_msg_out);
|
|
|
|
|
2016-07-14 06:04:02 +02:00
|
|
|
int rend_allow_non_anonymous_connection(const or_options_t* options);
|
|
|
|
int rend_non_anonymous_mode_enabled(const or_options_t *options);
|
|
|
|
|
|
|
|
void assert_circ_anonymity_ok(origin_circuit_t *circ,
|
|
|
|
const or_options_t *options);
|
|
|
|
|
2017-06-20 16:29:20 +02:00
|
|
|
#ifdef RENDCOMMON_PRIVATE
|
|
|
|
|
|
|
|
STATIC int
|
|
|
|
rend_desc_v2_is_parsable(rend_encoded_v2_service_descriptor_t *desc);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2010-07-21 17:52:54 +02:00
|
|
|
#endif
|
|
|
|
|