Get the navigator.gss_eap object to appear on firefox
authorMark Donnelly <mark@painless-security.com>
Wed, 3 Dec 2014 17:24:01 +0000 (12:24 -0500)
committerMark Donnelly <mark@painless-security.com>
Wed, 3 Dec 2014 17:24:01 +0000 (12:24 -0500)
xpi/chrome.manifest
xpi/chrome/content/nav.gss.js [moved from xpi/data/nav.gss.js.1 with 90% similarity]
xpi/data/nav.gss.js [moved from xpi/lib/navigator.gss.js with 97% similarity]
xpi/data/navigator.gss.js
xpi/package.json

index 6d0efba..bb6a0c9 100644 (file)
@@ -1,2 +1,2 @@
-content       xtnd      chrome/content/
-
+content       gssweb      chrome/content/ contentaccessible=yes
+resource      gsseap     chrome/resource/
similarity index 90%
rename from xpi/data/nav.gss.js.1
rename to xpi/chrome/content/nav.gss.js
index 77f4902..dec4f1d 100644 (file)
@@ -1,3 +1,4 @@
+console.log('Loading nav.gss.js - #1');
 /*
  * Copyright (c) 2014, JANET(UK)
  * All rights reserved.
  *
  */
 
-console.log('Loading navigator.gss.js - #9');
+console.log('Loading navigator.gss.js - #1');
 
-/* 
 navigator.generateNonce = function() {
   // TODO: Make sure that we don't have a collision!
   // Random integer in the range [0..(2^32-1)]
   return Math.floor(Math.random() * ( 4294967295 )) ;
 }
-*/
 
 
 
@@ -309,33 +308,5 @@ var GSSEap = (function ()
     return GSSEap;
 })();
 
-function newGSSEap(config)
-{
-  return new GSSEap(config);
-}
-
-//var nav = createObjectIn(unsafeWindow, {defineAs: "navigator"});
-var bob = createObjectIn(unsafeWindow, {defineAs: "bob"});
-var gss_eap = createObjectIn(bob, {defineAs: "gss_eap"});
-var gss_eap_proto = createObjectIn(gss_eap, {defineAs: "prototype"});
-
-exportFunction(GSSEap.prototype.constructor, gss_eap_proto, {allowCallbacks: true, :defineAs: 'constructor'});
-
-/*
-exportFunction(, gss_eap, {allowCallbacks: true});
-exportFunction(, gss_eap, {allowCallbacks: true});
-exportFunction(, gss_eap, {allowCallbacks: true});
-exportFunction(, gss_eap, {allowCallbacks: true});
-exportFunction(, gss_eap, {allowCallbacks: true});
-*/
-
-/* exportFunction(GSSEap, nav, {defineAs: "gss_eap"});
-exportFunction(GSSEap, unsafeWindow.navigator, {defineAs: "gss_eap_2"})
-exportFunction(newGSSEap, nav, {defineAs: "gss_eap_3"})
-*/
-
-/*
-exportFunction(newGSSEap, bob, {defineAs: 'newbob'});
 
-exportFunction(doHello, bob, {defineAs: 'doHello'});
-*/
+navigator.gss_eap = GSSEap;
similarity index 97%
rename from xpi/lib/navigator.gss.js
rename to xpi/data/nav.gss.js
index a2ed28c..84a8aa1 100644 (file)
 
 console.log('Loading navigator.gss.js - #9');
 
+navigator.generateNonce = function() {
+  // TODO: Make sure that we don't have a collision!
+  // Random integer in the range [0..(2^32-1)]
+  return Math.floor(Math.random() * ( 4294967295 )) ;
+}
+
+
+
 /* This file gets injected into the web page verbatim */
 
 var GSSEap = (function () 
@@ -299,4 +307,4 @@ var GSSEap = (function ()
     return GSSEap;
 })();
 
-navigator.gss_eap = GSSEap;
+
index cea7bbd..5342e3e 100644 (file)
@@ -1,46 +1,12 @@
-console.log("Bob is here. #1");
+console.log("Bob is here. #2");
 
-var GSSEap = (function () 
-  {
-    function GSSEap(config)
-    {
-      console.log("BobBobBob");
-    };
-    
-    return GSSEap;
-  }
-)();
+function addScript(url) {
+  var elt = document.createElement("script");
+  elt.setAttribute("src",   url );
+  elt.setAttribute('type', 'text/javascript');
+  document.body.appendChild(elt);
+}
 
-
-
-unsafeWindow.navigator.GSSEap = 
-       cloneInto(GSSEap,
-                 unsafeWindow, 
-                 { cloneFunctions: true, 
-                   wrapReflectors: true});
-
-var mesaGSS = createObjectIn(unsafeWindow, {defineAs: "mesaGSS"});
-function sayHello(addressee) 
-{
-  console.log("Saying hello to " + addressee);
-  return("Hello, " + addressee);
-};
-exportFunction(sayHello, mesaGSS, { defineAs: "sayHello" });
-
-console.log("Bob is leaving. #1");
-
-/* 
- * Gives us navigator.gss_eap, but "new navigator.gss_eap()" returns "not a constructor"
-unsafeWindow.navigator.gss_eap = cloneInto(GSSEap, unsafeWindow, {cloneFunctions: true});
-*/
-
-
-// unsafeWindow.gss_eap = cloneInto(GSSEap, unsafeWindow);
-
-//var gss_eap = createObjectIn(unsafeWindow.navigator, {defineAs: 'gss_eap'});
-//var gss_eap_prototype = createObjectIn(gss_eap, {defineAs: 'prototype'});
-//exportFunction(GSSEap.prototype.constructor, gss_eap_prototype, {defineAs: 'constructor'});
-
-//exportFunction(GSSEap, unsafeWindow.navigator, {defineAs: 'gss_eap'});
+addScript('chrome://gssweb/content/nav.gss.js');
 
 
index 795e9da..27cb450 100644 (file)
@@ -4,8 +4,6 @@
   "id": "jid1-NfTB1x7j36TqCw",
   "description": "GSS-EAP and GSSWeb package provider",
 
-  "unsafe-content-script": true,
-
   "author": "mark@painless-security.com",
   "license": "Copyright (c) 2014, JANET(UK)\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions\nare met:\n\n1. Redistributions of source code must retain the above copyright\n   notice, this list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright\n   notice, this list of conditions and the following disclaimer in the\n   documentation and/or other materials provided with the distribution.\n\n3. Neither the name of JANET(UK) nor the names of its contributors\n   may be used to endorse or promote products derived from this software\n   without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS\nFOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\nCOPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,\nINDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\nHOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\nSTRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\nARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\nOF THE POSSIBILITY OF SUCH DAMAGE.",
   "version": "0.1"