tor  0.4.2.0-alpha-dev
Data Structures | Macros | Typedefs | Enumerations | Functions
hs_descriptor.h File Reference
#include <stdint.h>
#include "core/or/or.h"
#include "trunnel/ed25519_cert.h"
#include "feature/nodelist/torcert.h"

Go to the source code of this file.

Data Structures

struct  hs_desc_intro_point_t
 
struct  hs_desc_authorized_client_t
 
struct  hs_desc_encrypted_data_t
 
struct  hs_desc_superencrypted_data_t
 
struct  hs_desc_plaintext_data_t
 
struct  hs_descriptor_t
 

Macros

#define HS_DESC_SUPPORTED_FORMAT_VERSION_MIN   3
 
#define HS_DESC_SUPPORTED_FORMAT_VERSION_MAX   3
 
#define HS_DESC_DEFAULT_LIFETIME   (3 * 60 * 60)
 
#define HS_DESC_MAX_LIFETIME   (12 * 60 * 60)
 
#define HS_DESC_CERT_LIFETIME   (54 * 60 * 60)
 
#define HS_DESC_ENCRYPTED_SALT_LEN   16
 
#define HS_DESC_ENCRYPTED_KDF_OUTPUT_LEN   CIPHER256_KEY_LEN + CIPHER_IV_LEN + DIGEST256_LEN
 
#define HS_DESC_SUPERENC_PLAINTEXT_PAD_MULTIPLE   10000
 
#define HS_DESC_MAX_LEN   50000 /* 50kb max size */
 
#define HS_DESC_ENCRYPTED_KEY_LEN   CIPHER256_KEY_LEN
 
#define HS_DESC_ENCRYPTED_BIT_SIZE   (HS_DESC_ENCRYPTED_KEY_LEN * 8)
 
#define HS_DESC_CLIENT_ID_LEN   8
 
#define HS_DESC_DESCRIPTOR_COOKIE_LEN   16
 
#define HS_DESC_COOKIE_KEY_LEN   32
 
#define HS_DESC_COOKIE_KEY_BIT_SIZE   (HS_DESC_COOKIE_KEY_LEN * 8)
 
#define HS_DESC_ENCRYPED_COOKIE_LEN   HS_DESC_DESCRIPTOR_COOKIE_LEN
 
#define HS_DESC_AUTH_CLIENT_MULTIPLE   16
 
#define hs_descriptor_free(desc)   FREE_AND_NULL(hs_descriptor_t, hs_descriptor_free_, (desc))
 
#define hs_desc_plaintext_data_free(desc)   FREE_AND_NULL(hs_desc_plaintext_data_t, hs_desc_plaintext_data_free_, (desc))
 
#define hs_desc_superencrypted_data_free(desc)
 
#define hs_desc_encrypted_data_free(desc)   FREE_AND_NULL(hs_desc_encrypted_data_t, hs_desc_encrypted_data_free_, (desc))
 
#define hs_desc_intro_point_free(ip)   FREE_AND_NULL(hs_desc_intro_point_t, hs_desc_intro_point_free_, (ip))
 
#define hs_desc_authorized_client_free(client)
 

Typedefs

typedef struct hs_desc_intro_point_t hs_desc_intro_point_t
 
typedef struct hs_desc_authorized_client_t hs_desc_authorized_client_t
 
typedef struct hs_desc_encrypted_data_t hs_desc_encrypted_data_t
 
typedef struct hs_desc_superencrypted_data_t hs_desc_superencrypted_data_t
 
typedef struct hs_desc_plaintext_data_t hs_desc_plaintext_data_t
 
typedef struct hs_descriptor_t hs_descriptor_t
 

Enumerations

enum  hs_desc_auth_type_t { HS_DESC_AUTH_ED25519 = 1 }
 

Functions

static int hs_desc_is_supported_version (uint32_t version)
 
void hs_descriptor_free_ (hs_descriptor_t *desc)
 
void hs_desc_plaintext_data_free_ (hs_desc_plaintext_data_t *desc)
 
void hs_desc_superencrypted_data_free_ (hs_desc_superencrypted_data_t *desc)
 
void hs_desc_encrypted_data_free_ (hs_desc_encrypted_data_t *desc)
 
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, const uint8_t *subcredential, const curve25519_secret_key_t *client_auth_sk, hs_descriptor_t **desc_out)
 
int hs_desc_decode_plaintext (const char *encoded, hs_desc_plaintext_data_t *plaintext)
 
int hs_desc_decode_superencrypted (const hs_descriptor_t *desc, hs_desc_superencrypted_data_t *desc_out)
 
int hs_desc_decode_encrypted (const hs_descriptor_t *desc, const curve25519_secret_key_t *client_auth_sk, hs_desc_encrypted_data_t *desc_out)
 
size_t hs_desc_obj_size (const hs_descriptor_t *data)
 
size_t hs_desc_plaintext_obj_size (const hs_desc_plaintext_data_t *data)
 
hs_desc_intro_point_ths_desc_intro_point_new (void)
 
void hs_desc_intro_point_free_ (hs_desc_intro_point_t *ip)
 
void hs_desc_authorized_client_free_ (hs_desc_authorized_client_t *client)
 
hs_desc_authorized_client_ths_desc_build_fake_authorized_client (void)
 
void hs_desc_build_authorized_client (const uint8_t *subcredential, const curve25519_public_key_t *client_auth_pk, const curve25519_secret_key_t *auth_ephemeral_sk, const uint8_t *descriptor_cookie, hs_desc_authorized_client_t *client_out)
 
void hs_desc_plaintext_data_free_contents (hs_desc_plaintext_data_t *desc)
 
void hs_desc_superencrypted_data_free_contents (hs_desc_superencrypted_data_t *desc)
 
void hs_desc_encrypted_data_free_contents (hs_desc_encrypted_data_t *desc)
 

Detailed Description

Header file for hs_descriptor.c.

Definition in file hs_descriptor.h.

Macro Definition Documentation

◆ hs_desc_authorized_client_free

#define hs_desc_authorized_client_free (   client)
Value:
hs_desc_authorized_client_free_, (client))

Definition at line 274 of file hs_descriptor.h.

◆ hs_desc_superencrypted_data_free

#define hs_desc_superencrypted_data_free (   desc)
Value:
hs_desc_superencrypted_data_free_, (desc))

Definition at line 239 of file hs_descriptor.h.