Documentation ¶
Index ¶
- Variables
- type CryptoMethod
- func DefaultCryptoSelector(provided CryptoMethod) CryptoMethod
- func InitiateHandshake(rw io.ReadWriter, skey []byte, initialPayload []byte, ...) (ret io.ReadWriter, method CryptoMethod, err error)
- func ReceiveHandshake(rw io.ReadWriter, skeys SecretKeyIter, selectCrypto CryptoSelector) (ret io.ReadWriter, method CryptoMethod, err error)
- type CryptoSelector
- type SecretKeyIter
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoSecretKeyMatch = errors.New("no skey matched")
Functions ¶
This section is empty.
Types ¶
type CryptoMethod ¶
type CryptoMethod uint32
const ( CryptoMethodPlaintext CryptoMethod = 1 // After header obfuscation, drop into plaintext CryptoMethodRC4 CryptoMethod = 2 // After header obfuscation, use RC4 for the rest of the stream AllSupportedCrypto = CryptoMethodPlaintext | CryptoMethodRC4 )
func DefaultCryptoSelector ¶
func DefaultCryptoSelector(provided CryptoMethod) CryptoMethod
func InitiateHandshake ¶
func InitiateHandshake(rw io.ReadWriter, skey []byte, initialPayload []byte, cryptoProvides CryptoMethod) (ret io.ReadWriter, method CryptoMethod, err error)
func ReceiveHandshake ¶
func ReceiveHandshake(rw io.ReadWriter, skeys SecretKeyIter, selectCrypto CryptoSelector) (ret io.ReadWriter, method CryptoMethod, err error)
type CryptoSelector ¶
type CryptoSelector func(CryptoMethod) CryptoMethod
type SecretKeyIter ¶
A function that given a function, calls it with secret keys until it returns false or exhausted.
Click to show internal directories.
Click to hide internal directories.