vinothair / openinfocard

Automatically exported from code.google.com/p/openinfocard
0 stars 0 forks source link

Trying to use managed card results in TokenIssuanceException being thrown #16

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. get a managed card (I am using ones I have created myself
https://www.ctindustries.net/icard/index.php for a demo). Other sites
issuing managed that I have tested did not work either.
2. try to use the card (using the other side of the demo
https://www.cdatazone.org/demostore/index.php)
3. I get a TokenIssuanceException thrown that chainLength doesn't exist

What is the expected output? What do you see instead?
card to be successfully submitted.

What version of the product are you using? On what operating system?
0.9.2 (both windows and linux - FC6)

Please provide any additional information below.
I had to make a minor change to infocards.js to initialize the chainLength
property of the policy. See attached diff

Original issue reported on code.google.com by rricha...@ctindustries.net on 9 Jul 2007 at 7:47

Attachments:

GoogleCodeExporter commented 8 years ago
The fix needs to be made in processInfocardObjects.js

$ diff -u processInfocardObjects.js processInfocardObjects.js-342
--- processInfocardObjects.js   2007-10-01 10:22:03.192669900 +0200
+++ processInfocardObjects.js-342       2007-10-01 10:10:56.898816400 +0200
@@ -139,10 +139,16 @@
         policy["tokenType"] = params[i].getAttribute("Value");
        } else if ( name == "issuer") {
         policy["issuer"] = params[i].getAttribute("Value");
+       } else if ( name == "issuerPolicy") {
+        policy["issuerPolicy"] = params[i].getAttribute("Value");
        } else if ( name == "requiredClaims") {
         policy["requiredClaims"] = params[i].getAttribute("Value");
        } else if ( name == "optionalClaims") {
         policy["optionalClaims"] = params[i].getAttribute("Value");
+       } else if ( name == "privacyUrl") {
+        policy["privacyUrl"] = params[i].getAttribute("Value");
+       } else if ( name == "privacyVersion") {
+        policy["privacyVersion"] = params[i].getAttribute("Value");
        } else {
         debug("Unhandled attribute: " + name);
        }
@@ -201,6 +207,17 @@
     var doc = form.ownerDocument;
     var win = doc.defaultView;

+    var chain = serverCert.getChain();
+       debug('chain: ' + chain);
+       debug('chainLength: ' + chain.length);
+       debug('chain[0]: ' + chain.queryElementAt(0, nsIX509Cert));
+
+       policy["chainLength"] = ""+chain.length;
+       for (var i = 0; i < chain.length; ++i) {
+                var currCert = chain.queryElementAt(i, nsIX509Cert);
+                policy["certChain"+i] = getDer(currCert,win);
+       }
+
     var callEvent = doc.createEvent("Events");
     callEvent.initEvent("CallIdentitySelector", true, true);
     win.dispatchEvent(callEvent);

This adds support for issuerPolicy and privacyUrl too.

Original comment by ignisvul...@gmail.com on 1 Oct 2007 at 8:24