Commit b713c619 authored by Kathleen Brade's avatar Kathleen Brade Committed by Pier Angelo Vendrame
Browse files

Bug 30237: Add v3 onion services client authentication prompt

When Tor informs the browser that client authentication is needed,
temporarily load about:blank instead of about:neterror and prompt
for the user's key.

If a correctly formatted key is entered, use Tor's ONION_CLIENT_AUTH_ADD
control port command to add the key (via Torbutton's control port
module) and reload the page.

If the user cancels the prompt, display the standard about:neterror
"Unable to connect" page. This requires a small change to
browser/actors/NetErrorChild.jsm to account for the fact that the
docShell no longer has the failedChannel information. The failedChannel
is used to extract TLS-related error info, which is not applicable
in the case of a canceled .onion authentication prompt.

Add a leaveOpen option to PopupNotifications.show so we can display
error messages within the popup notification doorhanger without
closing the prompt.

Add support for onion services strings to the TorStrings module.

Add support for Tor extended SOCKS errors (Tor proposal 304) to the
socket transport and SOCKS layers. Improved display of all of these
errors will be implemented as part of bug 30025.

Also fixes bug 19757:
 Add a "Remember this key" checkbox to the client auth prompt.

 Add an "Onion Services Authentication" section within the
 about:preferences "Privacy & Security section" to allow
 viewing and removal of v3 onion client auth keys that have
 been stored on disk.

Also fixes bug 19251: use enhanced error pages for onion service errors.
parent 5f6febc4
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -250,6 +250,11 @@ XPCOMUtils.defineLazyScriptGetter(
  ["NewIdentityButton"],
  "chrome://browser/content/newidentity.js"
);
XPCOMUtils.defineLazyScriptGetter(
  this,
  ["OnionAuthPrompt"],
  "chrome://browser/content/onionservices/authPrompt.js"
);
XPCOMUtils.defineLazyScriptGetter(
  this,
  "gEditItemOverlay",
@@ -1750,6 +1755,9 @@ var gBrowserInit = {
    gTorConnectUrlbarButton.init();
    gTorConnectTitlebarStatus.init();

    // Init the OnionAuthPrompt
    OnionAuthPrompt.init();

    gTorCircuitPanel.init();

    // Certain kinds of automigration rely on this notification to complete
@@ -2544,6 +2552,8 @@ var gBrowserInit = {
    gTorConnectUrlbarButton.uninit();
    gTorConnectTitlebarStatus.uninit();

    OnionAuthPrompt.uninit();

    gTorCircuitPanel.uninit();

    if (gToolbarKeyNavEnabled) {
+1 −0
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@
<?xml-stylesheet href="chrome://browser/skin/translations/panel.css" type="text/css"?>
<?xml-stylesheet href="chrome://browser/skin/places/tree-icons.css" type="text/css"?>
<?xml-stylesheet href="chrome://browser/skin/places/editBookmark.css" type="text/css"?>
<?xml-stylesheet href="chrome://browser/content/onionservices/onionservices.css" type="text/css"?>
<?xml-stylesheet href="chrome://browser/content/torCircuitPanel.css" type="text/css"?>
<?xml-stylesheet href="chrome://browser/content/torconnect/torConnectTitlebarStatus.css" type="text/css"?>

+1 −0
Original line number Diff line number Diff line
@@ -529,6 +529,7 @@
#include ../../../devtools/startup/enableDevToolsPopup.inc.xhtml
#include ../../components/torcircuit/content/torCircuitPanel.inc.xhtml
#include ../../components/securitylevel/content/securityLevelPanel.inc.xhtml
#include ../../components/onionservices/content/authPopup.inc.xhtml
#include browser-allTabsMenu.inc.xhtml

  <tooltip id="dynamic-shortcut-tooltip"
+1 −0
Original line number Diff line number Diff line
@@ -296,6 +296,7 @@
                       data-l10n-id="urlbar-indexed-db-notification-anchor"/>
                <image id="password-notification-icon" class="notification-anchor-icon" role="button"
                       data-l10n-id="urlbar-password-notification-anchor"/>
#include ../../components/onionservices/content/authNotificationIcon.inc.xhtml
                <stack id="plugins-notification-icon" class="notification-anchor-icon" role="button" align="center" data-l10n-id="urlbar-plugins-notification-anchor">
                  <image class="plugin-icon" />
                  <image id="plugin-icon-badge" />
+1 −0
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@ DIRS += [
    "migration",
    "newidentity",
    "newtab",
    "onionservices",
    "originattributes",
    "pagedata",
    "places",
Loading