mirror of
https://github.com/logos-messaging/noise.git
synced 2026-01-05 15:43:13 +00:00
Fix potential DoS in Decrypt
This commit is contained in:
parent
927fa1b4bb
commit
2499bf1bad
5
state.go
5
state.go
@ -62,8 +62,11 @@ func (s *CipherState) Decrypt(out, ad, ciphertext []byte) ([]byte, error) {
|
||||
return nil, ErrMaxNonce
|
||||
}
|
||||
out, err := s.c.Decrypt(out, s.n, ad, ciphertext)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
s.n++
|
||||
return out, err
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// Cipher returns the low-level symmetric encryption primitive. It should only
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user