aboutsummaryrefslogtreecommitdiffstats
path: root/dirmngr
diff options
context:
space:
mode:
Diffstat (limited to 'dirmngr')
-rw-r--r--dirmngr/dirmngr.c12
-rw-r--r--dirmngr/server.c4
2 files changed, 13 insertions, 3 deletions
diff --git a/dirmngr/dirmngr.c b/dirmngr/dirmngr.c
index 1ddc568a0..0d133c61b 100644
--- a/dirmngr/dirmngr.c
+++ b/dirmngr/dirmngr.c
@@ -532,7 +532,17 @@ dirmngr_use_tor (void)
{
if (tor_mode == TOR_MODE_AUTO)
{
- /* FIXME: Figure out whether Tor is running. */
+ /* Figure out whether Tor is running. */
+ assuan_fd_t sock;
+
+ sock = assuan_sock_connect_byname (NULL, 0, 0, NULL, ASSUAN_SOCK_TOR);
+ if (sock == ASSUAN_INVALID_FD)
+ tor_mode = TOR_MODE_NO;
+ else
+ {
+ tor_mode = TOR_MODE_YES;
+ assuan_sock_close (sock);
+ }
}
if (tor_mode == TOR_MODE_FORCE)
diff --git a/dirmngr/server.c b/dirmngr/server.c
index 4f5a3b218..7ed6cde15 100644
--- a/dirmngr/server.c
+++ b/dirmngr/server.c
@@ -308,8 +308,8 @@ strcpy_escaped_plus (char *d, const unsigned char *s)
}
-/* This function returns true if a Tor server is running. The sattus
- is cached for the current connection. */
+/* This function returns true if a Tor server is running. The status
+ * is cached for the current connection. */
static int
is_tor_running (ctrl_t ctrl)
{