[Pkg-privacy-commits] [xul-ext-monkeysphere] 200/296: move createAgentPostData function to module

Ximin Luo infinity0 at moszumanska.debian.org
Mon Aug 24 07:39:40 UTC 2015


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch debian
in repository xul-ext-monkeysphere.

commit 7df8bb25bb12a2e116bedd3e9e2215c5a1361561
Author: Jameson Rollins <jrollins at finestructure.net>
Date:   Sun Apr 25 14:01:54 2010 -0400

    move createAgentPostData function to module
---
 chrome/content/monkeysphere.js | 41 ++---------------------------------------
 modules/monkeysphere.jsm       | 42 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 44 insertions(+), 39 deletions(-)

diff --git a/chrome/content/monkeysphere.js b/chrome/content/monkeysphere.js
index 90a14e5..56d19a7 100644
--- a/chrome/content/monkeysphere.js
+++ b/chrome/content/monkeysphere.js
@@ -106,43 +106,6 @@ var monkeysphere = (function() {
 // AGENT QUERY FUNCTIONS
 ////////////////////////////////////////////////////////////
 
-  var createAgentPostData = function(uri, cert) {
-    // get certificate info
-    var cert_length = {};
-    var dummy = {};
-    var cert_data = cert.getRawDER(cert_length, dummy);
-
-    // "agent post data"
-    var apd = {
-      uri: uri,
-      cert: cert,
-      data: {
-        context: uri.scheme,
-        peer: uri.hostPort,
-        pkc: {
-          type: "x509der",
-          data: cert_data
-        }
-      },
-      toJSON: function() {
-        return JSON.stringify(this.data);
-      },
-      toOverrideLabel: function() {
-        return this.data.context + '|' + this.data.peer + '|' + this.data.pkc.type + '|' + this.data.pkc.data;
-      },
-      log: function() {
-        ms.log("agent post data:");
-        ms.log("  context: " + this.data.context);
-        ms.log("  peer: " + this.data.peer);
-        ms.log("  pkc.type: " + this.data.pkc.type);
-        //ms.log("  pkc.data: " + this.data.pkc.data); // this can be big
-        //ms.log("  JSON: " + this.toJSON());
-      }
-    };
-
-    return apd;
-  };
-
   //////////////////////////////////////////////////////////
   // query the validation agent
   var queryAgent = function(browser, cert) {
@@ -155,7 +118,7 @@ var monkeysphere = (function() {
     var client = new XMLHttpRequest();
 
     // make JSON query string
-    client.apd = createAgentPostData(uri, cert);
+    client.apd = ms.createAgentPostData(uri, cert);
     client.apd.log();
     var query = client.apd.toJSON();
 
@@ -364,7 +327,7 @@ var monkeysphere = (function() {
         ms.log("no valid cert found?");
         return;
       }
-      var apd = createAgentPostData(uri, cert);
+      var apd = ms.createAgentPostData(uri, cert);
       ms.overrides.clear(apd);
       // FIXME: why does the override seem to persist after a clear?
       if(!ms.overrides.certStatus(apd)) {
diff --git a/modules/monkeysphere.jsm b/modules/monkeysphere.jsm
index 1037736..cd3b22e 100644
--- a/modules/monkeysphere.jsm
+++ b/modules/monkeysphere.jsm
@@ -21,6 +21,7 @@ var EXPORTED_SYMBOLS = [
                         "agent_socket",
                         "log",
                         "isRelevantURI",
+                        "createAgentPostData",
                         "getInvalidCert",
                         "overrides"
                        ];
@@ -129,6 +130,47 @@ var EXPORTED_SYMBOLS = [
     return true;
   };
 
+////////////////////////////////////////////////////////////
+// AGENT POST DATA FUNCTION
+////////////////////////////////////////////////////////////
+
+  var createAgentPostData = function(uri, cert) {
+    // get certificate info
+    var cert_length = {};
+    var dummy = {};
+    var cert_data = cert.getRawDER(cert_length, dummy);
+
+    // "agent post data"
+    var apd = {
+      uri: uri,
+      cert: cert,
+      data: {
+        context: uri.scheme,
+        peer: uri.hostPort,
+        pkc: {
+          type: "x509der",
+          data: cert_data
+        }
+      },
+      toJSON: function() {
+        return JSON.stringify(this.data);
+      },
+      toOverrideLabel: function() {
+        return this.data.context + '|' + this.data.peer + '|' + this.data.pkc.type + '|' + this.data.pkc.data;
+      },
+      log: function() {
+        log("agent post data:");
+        log("  context: " + this.data.context);
+        log("  peer: " + this.data.peer);
+        log("  pkc.type: " + this.data.pkc.type);
+        //log("  pkc.data: " + this.data.pkc.data); // this can be big
+        //log("  JSON: " + this.toJSON());
+      }
+    };
+
+    return apd;
+  };
+
   ////////////////////////////////////////////////////////////
   // CERT FUNCTIONS
   ////////////////////////////////////////////////////////////

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/xul-ext-monkeysphere.git



More information about the Pkg-privacy-commits mailing list