swarm/pss: fix data race on HandshakeController.symKeyIndex (#19162)
* swarm/pss: fix data race on HandshakeController.symKeyIndex The HandshakeController.symKeyIndex map was accessed concurrently. Since insufficient test coverage the race is not detected every time. However, running TestClientHandshake a 100 times seems to be enough to reproduce the race. Note: I've chosen HandshakeController.lock to protect HandshakeController.symKeyIndex as that was already protected in a few functions by that lock. Additionally: - removed unused testStore - enabled tests in handshake_test.go as they pass - removed code duplication by adding getSymKey() * swarm/pss: fix a data race on HandshakeController.keyC * swarm/pss: fix data races with on Pss.symKeyPool
Showing
- swarm/pss/client/client_test.go 0 additions, 16 deletionsswarm/pss/client/client_test.go
- swarm/pss/handshake.go 52 additions, 26 deletionsswarm/pss/handshake.go
- swarm/pss/handshake_test.go 1 addition, 4 deletionsswarm/pss/handshake_test.go
- swarm/pss/keystore.go 2 additions, 2 deletionsswarm/pss/keystore.go
Loading
Please register or sign in to comment