looksLikeUnexpectedTLS returns true if the size passed in resemble the TLS alert message that is returned to a client which sends an invalid ClientHello message.
(size int32)
| 146 | // the TLS alert message that is returned to a client which sends |
| 147 | // an invalid ClientHello message. |
| 148 | func looksLikeUnexpectedTLS(size int32) bool { |
| 149 | var sizeBytes [4]byte |
| 150 | binary.BigEndian.PutUint32(sizeBytes[:], uint32(size)) |
| 151 | |
| 152 | if sizeBytes[0] != tlsAlertByte { |
| 153 | return false |
| 154 | } |
| 155 | version := int(sizeBytes[1])<<8 | int(sizeBytes[2]) |
| 156 | return version <= tls.VersionTLS13 && version >= tls.VersionTLS10 |
| 157 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…