mirror of
https://github.com/SagerNet/sing-shadowsocks.git
synced 2025-04-05 04:47:41 +03:00
Fix buffered aead tcp
This commit is contained in:
parent
85de9615c7
commit
a4a11dea4c
1 changed files with 2 additions and 2 deletions
|
@ -118,15 +118,15 @@ type clientConn struct {
|
||||||
|
|
||||||
func (c *clientConn) writeRequest(payload []byte) error {
|
func (c *clientConn) writeRequest(payload []byte) error {
|
||||||
_salt := buf.StackNewSize(c.keySaltLength)
|
_salt := buf.StackNewSize(c.keySaltLength)
|
||||||
|
defer common.KeepAlive(_salt)
|
||||||
salt := common.Dup(_salt)
|
salt := common.Dup(_salt)
|
||||||
|
defer salt.Release()
|
||||||
salt.WriteRandom(c.keySaltLength)
|
salt.WriteRandom(c.keySaltLength)
|
||||||
|
|
||||||
_key := buf.StackNewSize(c.keySaltLength)
|
_key := buf.StackNewSize(c.keySaltLength)
|
||||||
key := common.Dup(_key)
|
key := common.Dup(_key)
|
||||||
|
|
||||||
Kdf(c.key, salt.Bytes(), key)
|
Kdf(c.key, salt.Bytes(), key)
|
||||||
salt.Release()
|
|
||||||
common.KeepAlive(_salt)
|
|
||||||
writeCipher, err := c.constructor(key.Bytes())
|
writeCipher, err := c.constructor(key.Bytes())
|
||||||
key.Release()
|
key.Release()
|
||||||
common.KeepAlive(_key)
|
common.KeepAlive(_key)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue