Documentation ¶
Index ¶
Constants ¶
View Source
const ( // RandomLen defines a size of the random digest in TLS Hellos. RandomLen = 32 // ClientHelloRandomOffset is an offset in ClientHello record where // random digest is started. ClientHelloRandomOffset = 6 // ClientHelloSessionIDOffset is an offset in ClientHello record where // SessionID is started. ClientHelloSessionIDOffset = ClientHelloRandomOffset + RandomLen // ClientHelloMinLen is a minimal possible length of // ClientHello record. ClientHelloMinLen = 4 // WelcomePacketRandomOffset is an offset of random in ServerHello // packet (including record envelope). WelcomePacketRandomOffset = 11 // HandshakeTypeClient is a value representing a client handshake. HandshakeTypeClient = 0x01 // HandshakeTypeServer is a value representing a server handshake. HandshakeTypeServer = 0x02 // ChangeCipherValue is a value representing a change cipher // specification record. ChangeCipherValue = 0x01 // ExtensionSNI is a value for TLS extension 'SNI'. ExtensionSNI = 0x00 )
Variables ¶
View Source
var ( // ErrBadDigest is returned if given TLS Client Hello mismatches with a // derived one. ErrBadDigest = errors.New("bad digest") )
Functions ¶
func SendWelcomePacket ¶
func SendWelcomePacket(writer io.Writer, secret []byte, clientHello ClientHello) error
Types ¶
type ClientHello ¶
type ClientHello struct { Time time.Time Random [RandomLen]byte SessionID []byte Host string CipherSuite uint16 }
func ParseClientHello ¶
func ParseClientHello(secret, handshake []byte) (ClientHello, error)
Click to show internal directories.
Click to hide internal directories.