diff options
author | George Kadianakis <desnacked@riseup.net> | 2019-05-30 15:58:20 +0300 |
---|---|---|
committer | George Kadianakis <desnacked@riseup.net> | 2019-11-18 19:16:01 +0200 |
commit | 00fdaaee1e3cdfe40230a866c497d3648c43940c (patch) | |
tree | 684128731393d2cd563098e9290d286313d0b0ed /src/feature/hs/hs_client.h | |
parent | d28b6792cb99f25d42607eb46985ac4553013dd8 (diff) | |
download | tor-00fdaaee1e3cdfe40230a866c497d3648c43940c.tar.gz tor-00fdaaee1e3cdfe40230a866c497d3648c43940c.zip |
control-port: Implement ONION_CLIENT_AUTH_ADD.
Diffstat (limited to 'src/feature/hs/hs_client.h')
-rw-r--r-- | src/feature/hs/hs_client.h | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/src/feature/hs/hs_client.h b/src/feature/hs/hs_client.h index 699ce60510..ea726e2370 100644 --- a/src/feature/hs/hs_client.h +++ b/src/feature/hs/hs_client.h @@ -31,7 +31,20 @@ typedef enum { HS_CLIENT_FETCH_PENDING = 5, } hs_client_fetch_status_t; -/** Client-side configuration of authorization for a service. */ +/* Status code of client auth credential registration */ +typedef enum { + /* We successfuly registered these credentials */ + REGISTER_SUCCESS, + /* We failed to register these credentials, because they already exist. */ + REGISTER_FAIL_ALREADY_EXISTS, + /* We failed to register these credentials, because of a bad HS address. */ + REGISTER_FAIL_BAD_ADDRESS, +} hs_client_register_auth_status_t; + +/** Flag to set when a client auth is permanent (saved on disk). */ +#define CLIENT_AUTH_FLAG_IS_PERMANENT (1<<0) + +/** Client-side configuration of client authorization */ typedef struct hs_client_service_authorization_t { /** An curve25519 secret key used to compute decryption keys that * allow the client to decrypt the hidden service descriptor. */ @@ -39,8 +52,24 @@ typedef struct hs_client_service_authorization_t { /** An onion address that is used to connect to the onion service. */ char onion_address[HS_SERVICE_ADDR_LEN_BASE32+1]; + + /* An optional nickname for this client */ + char *nickname; + + /* Optional flags for this client. */ + int flags; } hs_client_service_authorization_t; +hs_client_register_auth_status_t +hs_client_register_auth_credentials(hs_client_service_authorization_t *creds); + +#define client_service_authorization_free(auth) \ + FREE_AND_NULL(hs_client_service_authorization_t, \ + client_service_authorization_free_, (auth)) + +void +client_service_authorization_free_(hs_client_service_authorization_t *auth); + void hs_client_note_connection_attempt_succeeded( const edge_connection_t *conn); |