Skip to content

Commit

Permalink
Merge #1206: [BUG][RPC] fix signature check (against old format) in m…
Browse files Browse the repository at this point in the history
…nbudgetrawvote

ae063d0 [BUG][RPC] fix signature check (against old format) in mnbudgetrawvote (random-zebra)

Pull request description:

  `CBudgetVote` object in `mnbudgetrawvote` is initialized with default nMessVersion (`MessageVersion::MESS_VER_HASH`). Thus the signature validation fails when the user provides an external signature performed over the old message format.

ACKs for top commit:
  Fuzzbawls:
    utACK ae063d0
  furszy:
    utACK ae063d0

Tree-SHA512: 16281277c001521ace380eada664138fa88f8a4fc93533427893ca6ab9ed56221962264859ea1b5c4d2aa751931dbfb90bfc46523beb705e8801e739fa2f1f97
  • Loading branch information
furszy authored and Liquid369 committed Jan 2, 2020
1 parent 33fd328 commit 4a9a04e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/rpc/budget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,9 @@ UniValue mnbudgetrawvote(const UniValue& params, bool fHelp)
vote.SetVchSig(vchSig);

if (!vote.CheckSignature(true)) {
return "Failure to verify signature.";
// try old message version
vote.nMessVersion = MessageVersion::MESS_VER_STRMESS;
if (!vote.CheckSignature(true)) return "Failure to verify signature.";
}

std::string strError = "";
Expand Down

0 comments on commit 4a9a04e

Please sign in to comment.