]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Make rend_authorized_client_free public
authorJohn Brooks <john.brooks@dereferenced.net>
Tue, 14 Apr 2015 03:35:40 +0000 (21:35 -0600)
committerJohn Brooks <special@torproject.org>
Mon, 9 May 2016 17:53:24 +0000 (13:53 -0400)
This is needed by control.c.

Also, check whether client_name is set before doing memwipe.

src/or/rendservice.c
src/or/rendservice.h

index 22a01c9d32dd19af6de82bd7fce72435bf3bea24..fbc228ae3c3b11385b2298dad83ad7d85f2ae6a8 100644 (file)
@@ -183,14 +183,15 @@ num_rend_services(void)
 }
 
 /** Helper: free storage held by a single service authorized client entry. */
-static void
+void
 rend_authorized_client_free(rend_authorized_client_t *client)
 {
   if (!client)
     return;
   if (client->client_key)
     crypto_pk_free(client->client_key);
-  memwipe(client->client_name, 0, strlen(client->client_name));
+  if (client->client_name)
+    memwipe(client->client_name, 0, strlen(client->client_name));
   tor_free(client->client_name);
   memwipe(client->descriptor_cookie, 0, sizeof(client->descriptor_cookie));
   tor_free(client);
index a16a99cf88f2fa37288e9c72eef3fc6655767ba0..2bb0c6aa886c6fa78346b96b34bbdd12d1543289 100644 (file)
@@ -106,6 +106,8 @@ rend_service_port_config_t *rend_service_parse_port_config(const char *string,
                                                            char **err_msg_out);
 void rend_service_port_config_free(rend_service_port_config_t *p);
 
+void rend_authorized_client_free(rend_authorized_client_t *client);
+
 /** Return value from rend_service_add_ephemeral. */
 typedef enum {
   RSAE_BADVIRTPORT = -4, /**< Invalid VIRTPORT/TARGET(s) */