From 37f20f3268b28560d3f61669f62e592331212eb3 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Wed, 16 Jul 2014 17:22:35 -0700 Subject: [PATCH] paypro: fix browser paypro. TODO: fix parsing DER certs. --- lib/browser/PayPro.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/browser/PayPro.js b/lib/browser/PayPro.js index 2bb1625..866068c 100644 --- a/lib/browser/PayPro.js +++ b/lib/browser/PayPro.js @@ -4,7 +4,7 @@ var Key = require('./Key'); var KJUR = require('./x509'); var assert = require('assert'); var PayPro = require('../PayPro'); -var Trusted = require('./Trusted'); +var Trusted = require('../RootCerts'); // Use hash table for efficiency: Trusted = Trusted.reduce(function(out, cert) { @@ -30,17 +30,17 @@ PayPro.sign = function(key) { var buf = this.serializeForSig(); // TODO: parse all certs - var cert = pki_data.split(/-----BEGIN[^\n]*KEY-----/)[0].replace(/\s+/g, ''); - if (!Trusted[cert])) { - ; // untrusted cert - } + // var cert = pki_data.split(/-----BEGIN[^\n]*KEY-----/)[0].replace(/\s+/g, ''); + // if (!Trusted[cert])) { + // ; // untrusted cert + // } var jsrsaSig = new KJUR.crypto.Signature({ alg: type + 'withRSA', prov: 'cryptojs/jsrsa' }); - jsrsaSig.initSign(pki_data); + jsrsaSig.initSign(key); jsrsaSig.updateHex(buf.toString('hex'));