Browse Source

paypro: fix root cert check.

patch-2
Christopher Jeffrey 11 years ago
parent
commit
4e325c3fa9
  1. 3
      lib/PayPro.js
  2. 3
      lib/browser/PayPro.js

3
lib/PayPro.js

@ -80,6 +80,9 @@ PayPro.prototype.x509Verify = function() {
var ncert = chain[i + 1]; var ncert = chain[i + 1];
// The root cert, check if it's trusted: // The root cert, check if it's trusted:
if (!ncert || name) { if (!ncert || name) {
if (!ncert && !name) {
return false;
}
chain.length = 0; chain.length = 0;
return true; return true;
} }

3
lib/browser/PayPro.js

@ -90,6 +90,9 @@ PayPro.prototype.x509Verify = function(key) {
var ncert = chain[i + 1]; var ncert = chain[i + 1];
// The root cert, check if it's trusted: // The root cert, check if it's trusted:
if (!ncert || name) { if (!ncert || name) {
if (!ncert && !name) {
return false;
}
chain.length = 0; chain.length = 0;
return true; return true;
} }

Loading…
Cancel
Save