paypro: update root certs and fix tests.

This commit is contained in:
Christopher Jeffrey 2014-07-17 18:34:58 -07:00
parent 948d6cd93a
commit 0db74604db
2 changed files with 10 additions and 3 deletions

View File

@ -1,4 +1,4 @@
module.exports = [
var RootCerts = [
/* tools/../src/node_root_certs.h -- Bundle of CA Root Certificates
*
* Certificate data from Mozilla as of: Sat Nov 9 22:37:55 2013
@ -3559,3 +3559,10 @@ module.exports = [
+ "dcGWxZ0=\n"
+ "-----END CERTIFICATE-----\n"
];
// Use hash table for efficiency:
RootCerts = RootCerts.reduce(function(trusted, cert) {
cert = cert.replace(/\s+/g, '');
trusted[cert] = true;
return trusted;
}, {});
module.exports = RootCerts;

View File

@ -339,7 +339,7 @@ describe('PayPro', function() {
paypro.set('serialized_payment_details', pdbuf);
paypro.set('pki_type', 'x509+sha256');
paypro.set('pki_data', [x509.crt]);
paypro.set('pki_data', x509.crt);
paypro.sign(x509.priv);
@ -362,7 +362,7 @@ describe('PayPro', function() {
paypro.set('pki_type', 'x509+sha256');
paypro.set('signature', x509.sig); // sig buffer
paypro.set('pki_data', [x509.crt]); // contains one or more x509 certs
paypro.set('pki_data', x509.crt); // contains one or more x509 certs
var verify = paypro.verify();
verify.should.equal(true);