rendparse.h File Reference

Header file for rendparse.c. More...

Go to the source code of this file.


int rend_parse_v2_service_descriptor (rend_service_descriptor_t **parsed_out, char *desc_id_out, char **intro_points_encrypted_out, size_t *intro_points_encrypted_size_out, size_t *encoded_size_out, const char **next_out, const char *desc, int as_hsdir)
int rend_decrypt_introduction_points (char **ipos_decrypted, size_t *ipos_decrypted_size, const char *descriptor_cookie, const char *ipos_encrypted, size_t ipos_encrypted_size)
int rend_parse_introduction_points (rend_service_descriptor_t *parsed, const char *intro_points_encoded, size_t intro_points_encoded_size)
int rend_parse_client_keys (strmap_t *parsed_clients, const char *str)

Detailed Description

Header file for rendparse.c.

Definition in file rendparse.h.

Function Documentation

◆ rend_decrypt_introduction_points()

int rend_decrypt_introduction_points ( char **  ipos_decrypted,
size_t *  ipos_decrypted_size,
const char *  descriptor_cookie,
const char *  ipos_encrypted,
size_t  ipos_encrypted_size 

Decrypt the encrypted introduction points in ipos_encrypted of length ipos_encrypted_size using descriptor_cookie and write the result to a newly allocated string that is pointed to by ipos_decrypted and its length to ipos_decrypted_size. Return 0 if decryption was successful and -1 otherwise.

Definition at line 268 of file rendparse.c.

◆ rend_parse_client_keys()

int rend_parse_client_keys ( strmap_t *  parsed_clients,
const char *  ckstr 

Parse the content of a client_key file in ckstr and add rend_authorized_client_t's for each parsed client to parsed_clients. Return the number of parsed clients as result or -1 for failure.

Definition at line 523 of file rendparse.c.

◆ rend_parse_introduction_points()

int rend_parse_introduction_points ( rend_service_descriptor_t parsed,
const char *  intro_points_encoded,
size_t  intro_points_encoded_size 

Parse the encoded introduction points in intro_points_encoded of length intro_points_encoded_size and write the result to the descriptor in parsed; return the number of successfully parsed introduction points or -1 in case of a failure.

Function may only be invoked once.

Definition at line 379 of file rendparse.c.

◆ rend_parse_v2_service_descriptor()

int rend_parse_v2_service_descriptor ( rend_service_descriptor_t **  parsed_out,
char *  desc_id_out,
char **  intro_points_encrypted_out,
size_t *  intro_points_encrypted_size_out,
size_t *  encoded_size_out,
const char **  next_out,
const char *  desc,
int  as_hsdir 

Parse and validate the ASCII-encoded v2 descriptor in desc, write the parsed descriptor to the newly allocated *parsed_out, the binary descriptor ID of length DIGEST_LEN to desc_id_out, the encrypted introduction points to the newly allocated *intro_points_encrypted_out, their encrypted size to *intro_points_encrypted_size_out, the size of the encoded descriptor to *encoded_size_out, and a pointer to the possibly next descriptor to *next_out; return 0 for success (including validation) and -1 for failure.

If as_hsdir is 1, we're parsing this as an HSDir, and we should be strict about time formats.

Definition at line 73 of file rendparse.c.

Referenced by rend_cache_store_v2_desc_as_dir(), rend_cache_store_v2_desc_as_service(), and rend_desc_v2_is_parsable().