|
|
@ -66,7 +66,7 @@ WalletService.getInstance = function() { |
|
|
|
* @param {Object} opts |
|
|
|
* @param {string} opts.copayerId - The copayer id making the request. |
|
|
|
* @param {string} opts.message - The contents of the request to be signed. |
|
|
|
* @param {string} opts.signature - Signature of message to be verified using the copayer's rwPubKey |
|
|
|
* @param {string} opts.signature - Signature of message to be verified using the copayer's requestPubKey |
|
|
|
*/ |
|
|
|
WalletService.getInstanceWithAuth = function(opts, cb) { |
|
|
|
|
|
|
@ -78,7 +78,7 @@ WalletService.getInstanceWithAuth = function(opts, cb) { |
|
|
|
if (err) return cb(err); |
|
|
|
if (!copayer) return cb(new ClientError('NOTAUTHORIZED', 'Copayer not found')); |
|
|
|
|
|
|
|
var isValid = server._verifySignature(opts.message, opts.signature, copayer.rwPubKey); |
|
|
|
var isValid = server._verifySignature(opts.message, opts.signature, copayer.requestPubKey); |
|
|
|
|
|
|
|
if (!isValid) |
|
|
|
return cb(new ClientError('NOTAUTHORIZED', 'Invalid signature')); |
|
|
@ -312,7 +312,7 @@ WalletService.prototype.verifyMessageSignature = function(opts, cb) { |
|
|
|
|
|
|
|
var copayer = wallet.getCopayer(self.copayerId); |
|
|
|
|
|
|
|
var isValid = self._verifySignature(opts.message, opts.signature, copayer.rwPubKey); |
|
|
|
var isValid = self._verifySignature(opts.message, opts.signature, copayer.requestPubKey); |
|
|
|
return cb(null, isValid); |
|
|
|
}); |
|
|
|
}; |
|
|
@ -497,7 +497,7 @@ WalletService.prototype.createTx = function(opts, cb) { |
|
|
|
|
|
|
|
var copayer = wallet.getCopayer(self.copayerId); |
|
|
|
var hash = WalletUtils.getProposalHash(opts.toAddress, opts.amount, opts.message); |
|
|
|
if (!self._verifySignature(hash, opts.proposalSignature, copayer.rwPubKey)) |
|
|
|
if (!self._verifySignature(hash, opts.proposalSignature, copayer.requestPubKey)) |
|
|
|
return cb(new ClientError('Invalid proposal signature')); |
|
|
|
|
|
|
|
var toAddress; |
|
|
|