[tbb-commits] [tor-browser/tor-browser-91.7.0esr-11.5-1] fixup! Bug 30237: Add v3 onion services client authentication prompt

richard at torproject.org richard at torproject.org
Tue Mar 8 19:34:01 UTC 2022


commit 499d1f5b9a6c0247cb723ed478f00629dcd66725
Author: Pier Angelo Vendrame <pierov at torproject.org>
Date:   Mon Mar 7 19:40:10 2022 +0100

    fixup! Bug 30237: Add v3 onion services client authentication prompt
    
    Fixes a problem with an async function not awaited, that caused #40802.
---
 browser/components/onionservices/content/authPrompt.js | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/browser/components/onionservices/content/authPrompt.js b/browser/components/onionservices/content/authPrompt.js
index d4a59ac46487..df609df44e49 100644
--- a/browser/components/onionservices/content/authPrompt.js
+++ b/browser/components/onionservices/content/authPrompt.js
@@ -154,7 +154,7 @@ const OnionAuthPrompt = (function() {
       this._showWarning(undefined); // Remove the warning.
     },
 
-    _onDone() {
+    async _onDone() {
       let keyElem = this._getKeyElement();
       if (!keyElem)
         return;
@@ -173,7 +173,8 @@ const OnionAuthPrompt = (function() {
       try {
         let { controller } =
             Cu.import("resource://torbutton/modules/tor-control-port.js", {});
-        let torController = controller(aError => {
+        let torController = await controller(aError => {
+          console.error(controllerFailureMsg, aError);
           this.show(controllerFailureMsg);
         });
         let onionAddr = this._onionName.toLowerCase().replace(/\.onion$/, "");
@@ -189,12 +190,15 @@ const OnionAuthPrompt = (function() {
           );
         })
         .catch(aError => {
-          if (aError.torMessage)
+          if (aError.torMessage) {
             this.show(aError.torMessage);
-          else
+          } else {
+            console.error(controllerFailureMsg, aError);
             this.show(controllerFailureMsg);
+          }
         });
       } catch (e) {
+        console.error(controllerFailureMsg, e);
         this.show(controllerFailureMsg);
       }
     },


More information about the tbb-commits mailing list