mirror of
https://github.com/slackhq/nebula.git
synced 2026-10-07 03:57:54 +02:00
Enforce outbound message counter limits to prevent nonce reuse (#1841)
This commit is contained in:
@@ -24,6 +24,9 @@ func (s *CipherStateChaChaPoly) EncryptDanger(out, ad, plaintext []byte, n uint6
|
||||
if s == nil {
|
||||
return nil, errors.New("no cipher state available to encrypt")
|
||||
}
|
||||
if n >= RejectAfterMessages {
|
||||
return nil, ErrMessageCounterExhausted
|
||||
}
|
||||
nb[0] = 0
|
||||
nb[1] = 0
|
||||
nb[2] = 0
|
||||
|
||||
Reference in New Issue
Block a user