Skip to content

Commit

Permalink
reset hmac on Get
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoPolo committed Dec 18, 2024
1 parent c55d27a commit 1763907
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions p2p/http/auth/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@ func newHmacPool(key []byte) *hmacPool {
}

func (p *hmacPool) Get() hash.Hash {
return p.p.Get().(hash.Hash)
h := p.p.Get().(hash.Hash)
h.Reset()
return h
}

func (p *hmacPool) Put(h hash.Hash) {
h.Reset()
p.p.Put(h)
}

Expand Down

0 comments on commit 1763907

Please sign in to comment.