commit 6ceda2e5565702f13933b83653c1951789fc0252
Author: Kathy Brade <brade(a)pearlcrescent.com>
Date: Wed Dec 4 09:48:08 2019 -0500
Bug 19757: Support on-disk storage of v3 client auth keys
Create a client-auth directory within the Tor data directory and use it.
---
src/components/tl-process.js | 7 ++++++-
src/modules/tl-util.jsm | 13 ++++++++++++-
2 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/src/components/tl-process.js b/src/components/tl-process.js
index 49abc0a..1cad103 100644
--- a/src/components/tl-process.js
+++ b/src/components/tl-process.js
@@ -1,4 +1,4 @@
-// Copyright (c) 2018, The Tor Project, Inc.
+// Copyright (c) 2020, The Tor Project, Inc.
// See LICENSE for licensing information.
//
// vim: set sw=2 sts=2 ts=8 et syntax=javascript:
@@ -372,6 +372,7 @@ TorProcessService.prototype =
// Get the Tor data directory first so it is created before we try to
// construct paths to files that will be inside it.
var dataDir = TorLauncherUtil.getTorFile("tordatadir", true);
+ var onionAuthDir = TorLauncherUtil.getTorFile("toronionauthdir", true);
var exeFile = TorLauncherUtil.getTorFile("tor", false);
var torrcFile = TorLauncherUtil.getTorFile("torrc", true);
var torrcDefaultsFile =
@@ -388,6 +389,8 @@ TorProcessService.prototype =
detailsKey = "torrc_missing";
else if (!dataDir)
detailsKey = "datadir_missing";
+ else if (!onionAuthDir)
+ detailsKey = "onionauthdir_missing";
else if (!hashedPassword)
detailsKey = "password_hash_missing";
@@ -418,6 +421,8 @@ TorProcessService.prototype =
args.push(torrcFile.path);
args.push("DataDirectory");
args.push(dataDir.path);
+ args.push("ClientOnionAuthDir");
+ args.push(onionAuthDir.path);
args.push("GeoIPFile");
args.push(geoipFile.path);
args.push("GeoIPv6File");
diff --git a/src/modules/tl-util.jsm b/src/modules/tl-util.jsm
index c54acb9..b721372 100644
--- a/src/modules/tl-util.jsm
+++ b/src/modules/tl-util.jsm
@@ -1,4 +1,4 @@
-// Copyright (c) 2019, The Tor Project, Inc.
+// Copyright (c) 2020, The Tor Project, Inc.
// See LICENSE for licensing information.
//
// vim: set sw=2 sts=2 ts=8 et syntax=javascript:
@@ -571,6 +571,8 @@ let TorLauncherUtil = // Public
path = "Tor\\torrc";
else if ("tordatadir" == aTorFileType)
path = "Tor";
+ else if ("toronionauthdir" == aTorFileType)
+ path = "Tor\\onion-auth";
else if ("pt-profiles-dir" == aTorFileType)
path = "Tor\\PluggableTransports";
}
@@ -586,6 +588,8 @@ let TorLauncherUtil = // Public
path = "Tor/torrc";
else if ("tordatadir" == aTorFileType)
path = "Tor";
+ else if ("toronionauthdir" == aTorFileType)
+ path = "Tor/onion-auth";
else if ("pt-profiles-dir" == aTorFileType)
path = "Tor/PluggableTransports";
else if (isIPC)
@@ -603,6 +607,8 @@ let TorLauncherUtil = // Public
path = "Tor/torrc";
else if ("tordatadir" == aTorFileType)
path = "Tor";
+ else if ("toronionauthdir" == aTorFileType)
+ path = "Tor/onion-auth";
else if ("pt-profiles-dir" == aTorFileType)
path = "Tor/PluggableTransports";
else if (isIPC)
@@ -622,6 +628,8 @@ let TorLauncherUtil = // Public
path = "Data\\Tor\\torrc";
else if ("tordatadir" == aTorFileType)
path = "Data\\Tor";
+ else if ("toronionauthdir" == aTorFileType)
+ path = "Data\\Tor\\onion-auth";
else if ("pt-profiles-dir" == aTorFileType)
path = "Data\\Browser";
}
@@ -638,6 +646,8 @@ let TorLauncherUtil = // Public
path = "Data/Tor/torrc";
else if ("tordatadir" == aTorFileType)
path = "Data/Tor";
+ else if ("toronionauthdir" == aTorFileType)
+ path = "Data/Tor/onion-auth";
else if ("pt-profiles-dir" == aTorFileType)
path = "Data/Browser";
else if (isIPC)
@@ -683,6 +693,7 @@ let TorLauncherUtil = // Public
try
{
if (("tordatadir" == aTorFileType) ||
+ ("toronionauthdir" == aTorFileType) ||
("pt-profiles-dir" == aTorFileType))
{
torFile.create(torFile.DIRECTORY_TYPE, 0o700);