Use a lookup table of implemented GSS method names for easier checking logic
authorMark Donnelly <mark@painless-security.com>
Tue, 21 Oct 2014 02:38:51 +0000 (22:38 -0400)
committerMark Donnelly <mark@painless-security.com>
Tue, 21 Oct 2014 02:38:51 +0000 (22:38 -0400)
chrome/app/navigator.gss.js

index f5f5815..268fa99 100644 (file)
@@ -10,6 +10,7 @@ var GSSEap = (function ()
     {
         // Public attributes
         this.version = "0.0.1";
+        this.implemented_methods = ["gss_import_name"];
         this.callbacks = {};
         this.methods = {};
         this.errors = {};
@@ -44,7 +45,7 @@ var GSSEap = (function ()
         */
         method = event.data.method;
         if (
-             (method != "gss_import_name") ||
+             ( -1 == this.implemented_methods.indexOf(method) ) ||
              ("undefined" == typeof (event.data.return_values)) ||
              ("undefined" == typeof (event.data.cookies)))
         {