aboutsummaryrefslogtreecommitdiff
path: root/src/or/rendservice.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2014-05-22 20:39:10 -0400
committerNick Mathewson <nickm@torproject.org>2014-05-22 20:39:10 -0400
commitcfd0ee514c279bc6c7b7c299e001693a5aeb1f5f (patch)
tree7d0c0b49612a79875133fbf509410875d5d3427b /src/or/rendservice.c
parent85f49abfbe50d29e4314ed0a3b436f3b14162d00 (diff)
downloadtor-cfd0ee514c279bc6c7b7c299e001693a5aeb1f5f.tar.gz
tor-cfd0ee514c279bc6c7b7c299e001693a5aeb1f5f.zip
sandbox: allow reading of hidden service configuration files.
fixes part of 12064
Diffstat (limited to 'src/or/rendservice.c')
-rw-r--r--src/or/rendservice.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/or/rendservice.c b/src/or/rendservice.c
index 5a81d07856..631e2a0f2e 100644
--- a/src/or/rendservice.c
+++ b/src/or/rendservice.c
@@ -656,6 +656,31 @@ rend_service_load_all_keys(void)
return 0;
}
+/** Add to <b>lst</b> every filename used by <b>s</b>. */
+static void
+rend_service_add_filenames_to_list(smartlist_t *lst, const rend_service_t *s)
+{
+ tor_assert(lst);
+ tor_assert(s);
+ smartlist_add_asprintf(lst, "%s"PATH_SEPARATOR"private_key",
+ s->directory);
+ smartlist_add_asprintf(lst, "%s"PATH_SEPARATOR"hostname",
+ s->directory);
+ smartlist_add_asprintf(lst, "%s"PATH_SEPARATOR"client_keys",
+ s->directory);
+}
+
+/** Add to <b>lst</b> every filename used by a configured hidden service */
+void
+rend_services_add_filenames_to_list(smartlist_t *lst)
+{
+ if (!rend_service_list)
+ return;
+ SMARTLIST_FOREACH_BEGIN(rend_service_list, rend_service_t *, s) {
+ rend_service_add_filenames_to_list(lst, s);
+ } SMARTLIST_FOREACH_END(s);
+}
+
/** Load and/or generate private keys for the hidden service <b>s</b>,
* possibly including keys for client authorization. Return 0 on success, -1
* on failure. */