mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-08-31 18:34:02 +03:00
Update golanci-lint
This commit is contained in:
@@ -16,8 +16,8 @@ func (c *clientHandhakeFrame) decryptor(secret []byte) cipher.Stream {
|
||||
hasher := acquireSha256Hasher()
|
||||
defer releaseSha256Hasher(hasher)
|
||||
|
||||
hasher.Write(c.key()) // nolint: errcheck
|
||||
hasher.Write(secret) // nolint: errcheck
|
||||
hasher.Write(c.key())
|
||||
hasher.Write(secret)
|
||||
|
||||
return makeAesCtr(hasher.Sum(nil), c.iv())
|
||||
}
|
||||
@@ -28,8 +28,8 @@ func (c *clientHandhakeFrame) encryptor(secret []byte) cipher.Stream {
|
||||
hasher := acquireSha256Hasher()
|
||||
defer releaseSha256Hasher(hasher)
|
||||
|
||||
hasher.Write(invertedHandshake.key()) // nolint: errcheck
|
||||
hasher.Write(secret) // nolint: errcheck
|
||||
hasher.Write(invertedHandshake.key())
|
||||
hasher.Write(secret)
|
||||
|
||||
return makeAesCtr(hasher.Sum(nil), invertedHandshake.iv())
|
||||
}
|
||||
|
||||
@@ -47,14 +47,18 @@ func (suite *ClientHandshakeTestSuite) TestOk() {
|
||||
Once().
|
||||
Return(len(snapshot.Decrypted.Text.data), nil).
|
||||
Run(func(args mock.Arguments) {
|
||||
arr := args.Get(0).([]byte)
|
||||
arr, ok := args.Get(0).([]byte)
|
||||
|
||||
suite.True(ok)
|
||||
copy(arr, snapshot.Decrypted.Cipher.data)
|
||||
})
|
||||
connMock.On("Write", mock.Anything).
|
||||
Once().
|
||||
Return(len(snapshot.Encrypted.Text.data), nil).
|
||||
Run(func(args mock.Arguments) {
|
||||
arr := args.Get(0).([]byte)
|
||||
arr, ok := args.Get(0).([]byte)
|
||||
|
||||
suite.True(ok)
|
||||
copy(writeData, arr)
|
||||
})
|
||||
|
||||
|
||||
@@ -32,5 +32,5 @@ func (c Conn) Write(p []byte) (int, error) {
|
||||
payload := buf.Bytes()
|
||||
c.Encryptor.XORKeyStream(payload, payload)
|
||||
|
||||
return c.Conn.Write(payload)
|
||||
return c.Conn.Write(payload) // nolint: wrapcheck
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user