From 60603306a9bf7222a994329dbef418cc510213e7 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Tue, 5 Aug 2014 11:10:31 -0700 Subject: [PATCH] paypro: comments. --- js/models/core/Wallet.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/js/models/core/Wallet.js b/js/models/core/Wallet.js index f8793e623..d727b6889 100644 --- a/js/models/core/Wallet.js +++ b/js/models/core/Wallet.js @@ -719,6 +719,8 @@ Wallet.prototype.sign = function(ntxid, cb) { // } // + // If this is a payment protocol request, + // ensure it hasn't been tampered with. if (!self.verifyPaymentRequest(ntxid)) { if (cb) cb(false); return; @@ -1206,6 +1208,10 @@ Wallet.prototype.createPaymentTxSync = function(options, merchantData, unspent) return ntxid; }; +// This essentially ensures that a copayer hasn't tampered with a +// PaymentRequest message from a payment server. It verifies the signature +// based on the cert, and checks to ensure the desired outputs are the same as +// the ones on the tx proposal. Wallet.prototype.verifyPaymentRequest = function(ntxid) { if (!txp) return false;