mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-09-01 10:14:01 +03:00
Fix lint errors
This commit is contained in:
@@ -8,6 +8,8 @@ import (
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
// StreamCipher is a wrapper which encrypts/decrypts stream with AES-CTR
|
||||
// (as a part of obfuscated2 protocol).
|
||||
type StreamCipher struct {
|
||||
encryptor cipher.Stream
|
||||
decryptor cipher.Stream
|
||||
@@ -32,22 +34,27 @@ func (s *StreamCipher) Write(p []byte) (int, error) {
|
||||
return s.conn.Write(encrypted)
|
||||
}
|
||||
|
||||
// Logger returns an instance of the logger for this wrapper.
|
||||
func (s *StreamCipher) Logger() *zap.SugaredLogger {
|
||||
return s.logger
|
||||
}
|
||||
|
||||
// LocalAddr returns local address of the underlying net.Conn.
|
||||
func (s *StreamCipher) LocalAddr() *net.TCPAddr {
|
||||
return s.conn.LocalAddr()
|
||||
}
|
||||
|
||||
// RemoteAddr returns remote address of the underlying net.Conn.
|
||||
func (s *StreamCipher) RemoteAddr() *net.TCPAddr {
|
||||
return s.conn.RemoteAddr()
|
||||
}
|
||||
|
||||
// Close closes underlying net.Conn instance.
|
||||
func (s *StreamCipher) Close() error {
|
||||
return s.conn.Close()
|
||||
}
|
||||
|
||||
// NewStreamCipher creates new stream cipher wrapper.
|
||||
func NewStreamCipher(conn StreamReadWriteCloser, encryptor, decryptor cipher.Stream) StreamReadWriteCloser {
|
||||
return &StreamCipher{
|
||||
conn: conn,
|
||||
|
||||
Reference in New Issue
Block a user