mirror of
https://github.com/cbeuw/Cloak.git
synced 2024-11-11 13:11:03 +00:00
17 lines
455 B
Go
17 lines
455 B
Go
package server
|
|
|
|
import (
|
|
"crypto"
|
|
"errors"
|
|
"io"
|
|
"net"
|
|
)
|
|
|
|
type Responder = func(originalConn net.Conn, sessionKey [32]byte, randSource io.Reader) (preparedConn net.Conn, err error)
|
|
type Transport interface {
|
|
processFirstPacket(reqPacket []byte, privateKey crypto.PrivateKey) (authFragments, Responder, error)
|
|
}
|
|
|
|
var ErrInvalidPubKey = errors.New("public key has invalid format")
|
|
var ErrCiphertextLength = errors.New("ciphertext has the wrong length")
|