tor  master
Data Structures | Macros | Typedefs | Enumerations | Functions
hs_descriptor.h File Reference

Header file for hs_descriptor.c. More...

#include <stdint.h>
#include "or.h"
#include "address.h"
#include "container.h"
#include "crypto.h"
#include "crypto_ed25519.h"
#include "ed25519_cert.h"
#include "torcert.h"
Include dependency graph for hs_descriptor.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  hs_desc_link_specifier_t
 
struct  hs_desc_intro_point_t
 
struct  hs_desc_encrypted_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_SECRET_INPUT_LEN   ED25519_PUBKEY_LEN + DIGEST256_LEN + sizeof(uint64_t)
 
#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_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_encrypted_data_free(desc)   FREE_AND_NULL(hs_desc_encrypted_data_t, hs_desc_encrypted_data_free_, (desc))
 
#define hs_desc_link_specifier_free(ls)   FREE_AND_NULL(hs_desc_link_specifier_t, hs_desc_link_specifier_free_, (ls))
 
#define hs_desc_intro_point_free(ip)   FREE_AND_NULL(hs_desc_intro_point_t, hs_desc_intro_point_free_, (ip))
 

Typedefs

typedef struct hs_desc_link_specifier_t hs_desc_link_specifier_t
 
typedef struct hs_desc_intro_point_t hs_desc_intro_point_t
 
typedef struct hs_desc_encrypted_data_t hs_desc_encrypted_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

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_ths_desc_link_specifier_new (const extend_info_t *info, uint8_t type)
 
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, char **encoded_out))
 
int hs_desc_decode_descriptor (const char *encoded, const uint8_t *subcredential, hs_descriptor_t **desc_out)
 
int hs_desc_decode_plaintext (const char *encoded, hs_desc_plaintext_data_t *plaintext)
 
int hs_desc_decode_encrypted (const hs_descriptor_t *desc, 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)
 
link_specifier_ths_desc_lspec_to_trunnel (const hs_desc_link_specifier_t *spec)
 

Detailed Description

Header file for hs_descriptor.c.