update README.md
This commit is contained in:
@ -17,8 +17,12 @@ const (
|
||||
VersionTLS12 = 0x0303
|
||||
VersionTLS13 = 0x0304
|
||||
|
||||
ServerHello = 2
|
||||
ClientHello = 1
|
||||
ServerHello = 2
|
||||
ClientHello = 1
|
||||
Certificate = 11
|
||||
ServerKeyExchange = 12
|
||||
ServerHelloDone = 14
|
||||
EncryptedHandshake = 99
|
||||
)
|
||||
|
||||
type TLSHeader struct {
|
||||
@ -88,12 +92,14 @@ func ParseAndVerifyTLSHeader(data []byte) *TLSHeader {
|
||||
if header.Type == Handshake {
|
||||
header.HandshakeType = data[5]
|
||||
//Check Handshake type
|
||||
if header.HandshakeType != ServerHello && header.HandshakeType != ClientHello {
|
||||
return nil
|
||||
if header.HandshakeType != ServerHello && header.HandshakeType != ClientHello && header.HandshakeType != Certificate && header.HandshakeType != ServerKeyExchange && header.HandshakeType != ServerHelloDone {
|
||||
header.HandshakeType = EncryptedHandshake
|
||||
}
|
||||
}
|
||||
if header.Type == ChangeCipherSpec {
|
||||
header.ChangeCipherSpecNext = data[6]
|
||||
if len(data) > 6 {
|
||||
header.ChangeCipherSpecNext = data[6]
|
||||
}
|
||||
}
|
||||
return header
|
||||
}
|
||||
|
Reference in New Issue
Block a user