Add tests for bug #40084

This commit is contained in:
Neel Chauhan
2020-11-19 12:00:56 -08:00
parent af48afe667
commit 157fe4597e
5 changed files with 95 additions and 6 deletions
+1 -2
View File
@@ -1649,7 +1649,7 @@ handle_control_hspost(control_connection_t *conn,
* On success (RSAE_OKAY), the address_out points to a newly allocated string
* containing the onion address without the .onion part. On error, address_out
* is untouched. */
static hs_service_add_ephemeral_status_t
STATIC hs_service_add_ephemeral_status_t
add_onion_helper_add_service(int hs_version,
add_onion_secret_key_t *pk,
smartlist_t *port_cfgs, int max_streams,
@@ -2010,7 +2010,6 @@ handle_control_add_onion(control_connection_t *conn,
smartlist_free(auth_clients_v3_str);
}
if (auth_created_clients) {
// Do not free entries; they are the same as auth_clients
smartlist_free(auth_created_clients);
+11
View File
@@ -103,6 +103,17 @@ STATIC control_cmd_args_t *control_cmd_parse_args(
size_t body_len,
const char *body,
char **error_out);
#ifdef TOR_UNIT_TESTS
#include "feature/hs/hs_common.h"
STATIC hs_service_add_ephemeral_status_t
add_onion_helper_add_service(int hs_version,
add_onion_secret_key_t *pk,
smartlist_t *port_cfgs, int max_streams,
int max_streams_close_circuit, int auth_type,
smartlist_t *auth_clients,
smartlist_t *auth_clients_v3, char **address_out);
#endif /* defined(TOR_UNIT_TESTS) */
#endif /* defined(CONTROL_CMD_PRIVATE) */