security/p2p: prevent peers who errored being added to the peer_set (backport #9500) (#9516)

* security/p2p: prevent peers who errored being added to the peer_set (#9500)

* Mark failed removal of peer to address security bug

Co-authored-by: Callum Waters <cmwaters19@gmail.com>
(cherry picked from commit c0bdb2423a)

* Changelong entry and added missing functions for implementations of Peer

Co-authored-by: Jasmina Malicevic <jasmina.dustinac@gmail.com>
This commit is contained in:
mergify[bot]
2022-10-07 14:27:33 +02:00
committed by GitHub
parent df5ba80914
commit 430afb23e7
11 changed files with 82 additions and 1 deletions

View File

@@ -84,3 +84,5 @@ func (fp *fuzzPeer) Send(byte, []byte) bool { return true }
func (fp *fuzzPeer) TrySend(byte, []byte) bool { return true }
func (fp *fuzzPeer) Set(key string, value interface{}) { fp.m[key] = value }
func (fp *fuzzPeer) Get(key string) interface{} { return fp.m[key] }
func (fp *fuzzPeer) SetRemovalFailed() {}
func (fp *fuzzPeer) GetRemovalFailed() bool { return false }