[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor-launcher/master] Replace TorGetHashedPassword() with TorGetPassword() to allow access from Torbutton.



commit 360f7b25cd630ff05b742758ca673dd4b8b37562
Author: Kathy Brade <brade@xxxxxxxxxxxxxx>
Date:   Fri Apr 12 11:31:08 2013 -0400

    Replace TorGetHashedPassword() with TorGetPassword() to allow access from Torbutton.
---
 src/components/tl-process.js  |    2 +-
 src/components/tl-protocol.js |    7 ++++---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/components/tl-process.js b/src/components/tl-process.js
index 58ec1d1..740c7cf 100644
--- a/src/components/tl-process.js
+++ b/src/components/tl-process.js
@@ -206,7 +206,7 @@ TorProcessService.prototype =
       var exeFile = this._getTorFile("tor");
       var torrcFile = this._getTorFile("torrc");
       var dataDir = this._getTorFile("tordatadir");
-      var hashedPassword = this.mProtocolSvc.TorGetHashedPassword();
+      var hashedPassword = this.mProtocolSvc.TorGetPassword(true);
 
       var detailsKey;
       if (!exeFile)
diff --git a/src/components/tl-protocol.js b/src/components/tl-protocol.js
index 923d3f3..2dee37f 100644
--- a/src/components/tl-protocol.js
+++ b/src/components/tl-protocol.js
@@ -131,10 +131,11 @@ TorProtocolService.prototype =
   // Public Constants and Methods ////////////////////////////////////////////
   kCmdStatusOK: 250,
 
-  // Returns hashed Tor password string or null if an error occurs.
-  TorGetHashedPassword: function()
+  // Returns Tor password string or null if an error occurs.
+  TorGetPassword: function(aPleaseHash)
   {
-    return this._hashPassword(this.mControlPassword);
+    var pw = this.mControlPassword;
+    return (aPleaseHash) ? this._hashPassword(pw) : pw;
   },
 
   // NOTE: Many Tor protocol functions return a reply object, which is a

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits