Documentation ¶
Index ¶
- Constants
- Variables
- func DefaultCryptoSelector(provided uint32) uint32
- func InitiateHandshake(rw io.ReadWriter, skey []byte, initialPayload []byte, cryptoProvides uint32) (ret io.ReadWriter, err error)
- func ReceiveHandshake(rw io.ReadWriter, skeys SecretKeyIter, selectCrypto func(uint32) uint32) (ret io.ReadWriter, err error)
- type CryptoSelector
- type SecretKeyIter
Constants ¶
View Source
const ( CryptoMethodPlaintext = 1 CryptoMethodRC4 = 2 AllSupportedCrypto = CryptoMethodPlaintext | CryptoMethodRC4 )
Variables ¶
View Source
var ErrNoSecretKeyMatch = errors.New("no skey matched")
Functions ¶
func DefaultCryptoSelector ¶
func InitiateHandshake ¶
func InitiateHandshake(rw io.ReadWriter, skey []byte, initialPayload []byte, cryptoProvides uint32) (ret io.ReadWriter, err error)
func ReceiveHandshake ¶
func ReceiveHandshake(rw io.ReadWriter, skeys SecretKeyIter, selectCrypto func(uint32) uint32) (ret io.ReadWriter, err error)
Types ¶
type CryptoSelector ¶
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.