Cloak/internal/server/transport.go

17 lines
441 B
Go
Raw Normal View History

2019-09-01 19:23:45 +00:00
package server
import (
2020-01-22 18:37:01 +00:00
"crypto"
"errors"
2019-09-01 19:23:45 +00:00
"net"
)
type Transport interface {
HasRecordLayer() bool
UnitReadFunc() func(net.Conn, []byte) (int, error)
2020-01-22 18:37:01 +00:00
handshake(reqPacket []byte, privateKey crypto.PrivateKey, originalConn net.Conn) (authenticationInfo, func([]byte) (net.Conn, error), error)
2019-09-01 19:23:45 +00:00
}
2020-01-22 18:37:01 +00:00
var ErrInvalidPubKey = errors.New("public key has invalid format")
var ErrCiphertextLength = errors.New("ciphertext has the wrong length")