Documentation
¶
Index ¶
- Variables
- func ConnContext(ctx context.Context, conn net.Conn) context.Context
- func JA3Fingerprint(ja3string string) string
- func JA3String(version ProtocolVersion, cipherSuites []CipherSuite, extensionList []Extension) string
- func NewListener(inner net.Listener) net.Listener
- type ALPNData
- type CipherSuite
- type ClientHelloInfo
- type CompressionMethod
- type Conn
- type ECPointFormatsData
- type EmptyExtensionData
- type Extension
- type ExtensionData
- func ParseALPNData(raw []byte) ExtensionData
- func ParseECPointFormatsData(rawData []byte) ExtensionData
- func ParseEmptyExtensionData(data []byte) ExtensionData
- func ParseServerNameData(raw []byte) ExtensionData
- func ParseSupportedGroupsData(rawData []byte) ExtensionData
- func ParseUnknownExtensionData(data []byte) ExtensionData
- type HandshakeReader
- type ProtocolVersion
- type ServerHelloInfo
- type ServerNameData
- type SupportedGroupsData
- type UnknownExtensionData
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidTLSMsgType = errors.New("invalid_tls_msg_type") ErrVersionReadFailed = errors.New("version_read_failed") ErrRandomReadFailed = errors.New("random_read_failed") ErrSessionIDReadFailed = errors.New("session_id_read_failed") ErrCipherSuitesReadFailed = errors.New("cipher_suites_read_failed") ErrCipherSuiteParseFailed = errors.New("cipher_suite_parse_failed") ErrCompressionMethodsReadFailed = errors.New("compression_methods_read_failed") ErrCompressionMethodParseFailed = errors.New("compression_method_parse_failed") ErrExtensionsReadFailed = errors.New("extensions_read_failed") ErrExtensionParseFailed = errors.New("extension_parse_failed") ErrServerHelloReadFailed = errors.New("server_hello_read_failed") ErrInvalidServerHello = errors.New("invalid_server_hello") ErrIncompleteServerHello = errors.New("incomplete_server_hello") ErrClientHelloReadFailed = errors.New("client_hello_read_failed") ErrInvalidClientHello = errors.New("invalid_client_hello") ErrIncompleteClientHello = errors.New("incomplete_client_hello") )
View Source
var CipherSuites = map[uint16]struct { Name string Grease bool }{}/* 366 elements not displayed */
View Source
var ClientHelloKey = contextKeyType(0)
Functions ¶
func JA3Fingerprint ¶
func JA3String ¶
func JA3String(version ProtocolVersion, cipherSuites []CipherSuite, extensionList []Extension) string
Types ¶
type CipherSuite ¶
type CipherSuite struct { Code [2]uint8 `json:"code"` Name string `json:"name,omitempty"` Grease bool `json:"grease,omitempty"` }
func MakeCipherSuite ¶
func MakeCipherSuite(code uint16) CipherSuite
func (CipherSuite) CodeUint16 ¶
func (c CipherSuite) CodeUint16() uint16
type ClientHelloInfo ¶
type ClientHelloInfo struct { Raw []byte `json:"raw"` Version ProtocolVersion `json:"version"` Random []byte `json:"random"` SessionID []byte `json:"session_id"` CipherSuites []CipherSuite `json:"cipher_suites"` CompressionMethods []CompressionMethod `json:"compression_methods"` Extensions []Extension `json:"extensions"` Info struct { ServerName *string `json:"server_name"` SCTs bool `json:"scts"` Protocols []string `json:"protocols"` JA3String string `json:"ja3_string"` JA3Fingerprint string `json:"ja3_fingerprint"` } `json:"info"` }
func UnmarshalClientHello ¶
func UnmarshalClientHello(handshakeBytes []byte) (*ClientHelloInfo, error)
type CompressionMethod ¶
type CompressionMethod uint8
func (CompressionMethod) MarshalJSON ¶
func (m CompressionMethod) MarshalJSON() ([]byte, error)
type ECPointFormatsData ¶
type EmptyExtensionData ¶
type Extension ¶
type Extension struct { Type uint16 `json:"type"` Name string `json:"name,omitempty"` Grease bool `json:"grease,omitempty"` Private bool `json:"private,omitempty"` Data ExtensionData `json:"data"` }
type ExtensionData ¶
type ExtensionData interface{}
func ParseALPNData ¶
func ParseALPNData(raw []byte) ExtensionData
func ParseECPointFormatsData ¶
func ParseECPointFormatsData(rawData []byte) ExtensionData
func ParseEmptyExtensionData ¶
func ParseEmptyExtensionData(data []byte) ExtensionData
func ParseServerNameData ¶
func ParseServerNameData(raw []byte) ExtensionData
func ParseSupportedGroupsData ¶
func ParseSupportedGroupsData(rawData []byte) ExtensionData
func ParseUnknownExtensionData ¶
func ParseUnknownExtensionData(data []byte) ExtensionData
type HandshakeReader ¶
type HandshakeReader struct {
// contains filtered or unexported fields
}
func NewHandshakeReader ¶
func NewHandshakeReader(reader io.Reader) *HandshakeReader
func (*HandshakeReader) ReadMessage ¶
func (reader *HandshakeReader) ReadMessage() ([]byte, error)
type ProtocolVersion ¶
type ProtocolVersion uint16
func (ProtocolVersion) Hi ¶
func (v ProtocolVersion) Hi() uint8
func (ProtocolVersion) Lo ¶
func (v ProtocolVersion) Lo() uint8
func (ProtocolVersion) MarshalJSON ¶
func (v ProtocolVersion) MarshalJSON() ([]byte, error)
type ServerHelloInfo ¶
type ServerHelloInfo struct { Raw []byte `json:"raw"` Version ProtocolVersion `json:"version"` Random []byte `json:"random"` SessionID []byte `json:"session_id"` CipherSuites []CipherSuite `json:"cipher_suites"` CompressionMethods []CompressionMethod `json:"compression_methods"` Extensions []Extension `json:"extensions"` Info struct { SCTs bool `json:"scts"` Protocols []string `json:"protocols"` JA3String string `json:"ja3_string"` JA3Fingerprint string `json:"ja3_fingerprint"` } `json:"info"` }
func UnmarshalServerHello ¶
func UnmarshalServerHello(handshakeBytes []byte) (*ServerHelloInfo, error)
type ServerNameData ¶
type ServerNameData struct { Raw []byte `json:"raw"` Valid bool `json:"valid"` HostName string `json:"host_name"` }
server_name - RFC 6066, Section 3
type SupportedGroupsData ¶
type SupportedGroupsData struct { Raw []byte `json:"raw"` Valid bool `json:"valid"` Groups []uint16 `json:"groups"` }
RFC 8422 TODO: provide info about groups beyond just the code (name, grease status, etc.)
type UnknownExtensionData ¶
type UnknownExtensionData struct {
Raw []byte `json:"raw"`
}
Click to show internal directories.
Click to hide internal directories.