func GetSNBlock(data []byte) ([]byte, error) {
	index := 0

	if len(data) < 2 {
		return []byte{}, fmt.Errorf("Not enough bytes to be an SN block")
	}

	extensionLength := int((data[index] << 8) + data[index+1])
	if extensionLength+2 > len(data) {
		return []byte{}, fmt.Errorf("Extension looks bonkers")
	}
	data = data[2 : extensionLength+2]

	for {
		if index+3 >= len(data) {
			break
		}
		length := int((data[index+2] << 8) + data[index+3])
		endIndex := index + 4 + length
		if data[index] == 0x00 && data[index+1] == 0x00 {
			return data[index+4 : endIndex], nil
		}

		index = endIndex
	}

	return []byte{}, fmt.Errorf(
		"Finished parsing the Extension block without finding an SN block",
	)
}
/* Given a TLS Extensions data block, go ahead and find the SN block */
Given a TLS Extensions data block, go ahead and find the SN block
/ * Given a TLS Extensions data block go ahead and find the SN block * /
func GetSNBlock(data []byte) ([]byte, error) {
	index := 0
	if len(data) < 2 {
		return []byte{}, fmt.Errorf("Not enough bytes to be an SN block")
	}
	extensionLength := int((data[index] << 8) + data[index+1])
	if extensionLength+2 > len(data) {
		return []byte{}, fmt.Errorf("Extension looks bonkers")
	}
	data = data[2 : extensionLength+2]
	for {
		if index+3 >= len(data) {
			break
		}
		length := int((data[index+2] << 8) + data[index+3])
		endIndex := index + 4 + length
		if data[index] == 0x00 && data[index+1] == 0x00 {
			return data[index+4 : endIndex], nil
		}
		index = endIndex
	}
	return []byte{}, fmt.Errorf(
		"Finished parsing the Extension block without finding an SN block",
	)
}
func GetSNBlock ( data [ ] byte ) ( [ ] byte , error ) { index := 0 if len ( data ) < 2 { return [ ] byte { } , fmt . Errorf ( " " ) } extensionLength := int ( ( data [ index ] << 8 ) + data [ index + 1 ] ) if extensionLength + 2 > len ( data ) { return [ ] byte { } , fmt . Errorf ( " " ) } data = data [ 2 : extensionLength + 2 ] for { if index + 3 >= len ( data ) { break } length := int ( ( data [ index + 2 ] << 8 ) + data [ index + 3 ] ) endIndex := index + 4 + length if data [ index ] == 0x00 && data [ index + 1 ] == 0x00 { return data [ index + 4 : endIndex ] , nil } index = endIndex } return [ ] byte { } , fmt . Errorf ( " " , ) }
Given a TLS Extensions data block, go ahead and find the SN block
Given a TLS Extensions data block go ahead and find the SN block