Tor  0.4.7.0-alpha-dev
Functions | Variables
control_hs.c File Reference

Implement commands for Tor's control-socket interface that are related to onion services. More...

#include "core/or/or.h"
#include "feature/control/control_cmd.h"
#include "feature/control/control_hs.h"
#include "feature/control/control_proto.h"
#include "feature/hs/hs_client.h"
#include "lib/encoding/confline.h"
#include "feature/control/control_cmd_args_st.h"

Go to the source code of this file.

Functions

static int parse_private_key_from_control_port (const char *client_privkey_str, curve25519_secret_key_t *privkey, control_connection_t *conn)
 
int handle_control_onion_client_auth_add (control_connection_t *conn, const control_cmd_args_t *args)
 
int handle_control_onion_client_auth_remove (control_connection_t *conn, const control_cmd_args_t *args)
 
static char * encode_client_auth_cred_for_control_port (hs_client_service_authorization_t *cred)
 
int handle_control_onion_client_auth_view (control_connection_t *conn, const control_cmd_args_t *args)
 

Variables

const control_cmd_syntax_t onion_client_auth_add_syntax
 
const control_cmd_syntax_t onion_client_auth_remove_syntax
 
const control_cmd_syntax_t onion_client_auth_view_syntax
 

Detailed Description

Implement commands for Tor's control-socket interface that are related to onion services.

Header file for control_hs.c.

Definition in file control_hs.c.

Function Documentation

◆ encode_client_auth_cred_for_control_port()

static char* encode_client_auth_cred_for_control_port ( hs_client_service_authorization_t cred)
static

Helper: Return a newly allocated string with the encoding of client authorization credentials

Definition at line 240 of file control_hs.c.

◆ handle_control_onion_client_auth_add()

int handle_control_onion_client_auth_add ( control_connection_t conn,
const control_cmd_args_t args 
)

Called when we get an ONION_CLIENT_AUTH_ADD command; parse the body, and register the new client-side client auth credentials: "ONION_CLIENT_AUTH_ADD" SP HSAddress SP KeyType ":" PrivateKeyBlob [SP "Type=" TYPE] CRLF

Definition at line 86 of file control_hs.c.

◆ handle_control_onion_client_auth_remove()

int handle_control_onion_client_auth_remove ( control_connection_t conn,
const control_cmd_args_t args 
)

Called when we get an ONION_CLIENT_AUTH_REMOVE command; parse the body, and register the new client-side client auth credentials. "ONION_CLIENT_AUTH_REMOVE" SP HSAddress

Definition at line 194 of file control_hs.c.

◆ handle_control_onion_client_auth_view()

int handle_control_onion_client_auth_view ( control_connection_t conn,
const control_cmd_args_t args 
)

Called when we get an ONION_CLIENT_AUTH_VIEW command; parse the body, and register the new client-side client auth credentials. "ONION_CLIENT_AUTH_VIEW" [SP HSAddress] CRLF

Definition at line 290 of file control_hs.c.

◆ parse_private_key_from_control_port()

static int parse_private_key_from_control_port ( const char *  client_privkey_str,
curve25519_secret_key_t privkey,
control_connection_t conn 
)
static

Parse the 'KeyType ":" PrivateKey' from client_privkey_str and store it into privkey. Use conn to output any errors if needed.

Return 0 if all went well, -1 otherwise.

Definition at line 26 of file control_hs.c.

Variable Documentation

◆ onion_client_auth_add_syntax

const control_cmd_syntax_t onion_client_auth_add_syntax
Initial value:
= {
.max_args = 2,
.accept_keywords = true,
}

Syntax details for ONION_CLIENT_AUTH_ADD

Definition at line 74 of file control_hs.c.

◆ onion_client_auth_remove_syntax

const control_cmd_syntax_t onion_client_auth_remove_syntax
Initial value:
= {
.max_args = 1,
.accept_keywords = true,
}

Syntax details for ONION_CLIENT_AUTH_REMOVE

Definition at line 184 of file control_hs.c.

◆ onion_client_auth_view_syntax

const control_cmd_syntax_t onion_client_auth_view_syntax
Initial value:
= {
.max_args = 1,
.accept_keywords = true,
}

Syntax details for ONION_CLIENT_AUTH_VIEW

Definition at line 280 of file control_hs.c.