Skip to content

Commit 0e0e1ce

Browse files
committed
fix: enforce quorum hash while validation platform ban p2p message
1 parent 8ec5e20 commit 0e0e1ce

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/net_processing.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3596,9 +3596,10 @@ MessageProcessingResult PeerManagerImpl::ProcessPlatformBanMessage(NodeId node,
35963596
const uint256 request_id = ::SerializeHash(std::make_pair(PLATFORM_BAN_REQUESTID_PREFIX, data));
35973597
const uint256 msg_hash = ::SerializeHash(data);
35983598

3599-
auto recsig_status = llmq::VerifyRecoveredSig(llmq_type, m_chainman.ActiveChainstate().m_chain, *m_llmq_ctx->qman, ban_msg.m_requested_height, request_id, msg_hash, ban_msg.m_signature);
3600-
if (recsig_status != llmq::VerifyRecSigStatus::Valid) {
3601-
LogPrintf("PLATFORMBAN -- hash: %s protx_hash: %s request_id: %s msg_hash: %s sig validation failed: %d\n", hash.ToString(), ban_msg.m_protx_hash.ToString(), request_id.ToString(), msg_hash.ToString(), ToUnderlying(recsig_status));
3599+
uint256 signHash = llmq::BuildSignHash(llmq_type, quorum->qc->quorumHash, request_id, msg_hash);
3600+
3601+
if (!ban_msg.m_signature.VerifyInsecure(quorum->qc->quorumPublicKey, signHash)) {
3602+
LogPrintf("PLATFORMBAN -- hash: %s protx_hash: %s request_id: %s msg_hash: %s sig validation failed\n", hash.ToString(), ban_msg.m_protx_hash.ToString(), request_id.ToString(), msg_hash.ToString());
36023603
ret.m_error = MisbehavingError{100};
36033604
return ret;
36043605
}

0 commit comments

Comments
 (0)