2018-01-09 00:24:51 +01:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
|
|
|
type CryptoConstruction uint16
|
|
|
|
|
|
|
|
const (
|
|
|
|
UndefinedConstruction CryptoConstruction = iota
|
|
|
|
XSalsa20Poly1305
|
|
|
|
XChacha20Poly1305
|
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
|
|
|
CertMagic = [4]byte{0x44, 0x4e, 0x53, 0x43}
|
|
|
|
ServerMagic = [8]byte{0x72, 0x36, 0x66, 0x6e, 0x76, 0x57, 0x6a, 0x38}
|
2018-01-09 13:27:03 +01:00
|
|
|
MinDNSPacketSize = 12
|
|
|
|
MaxDNSPacketSize = 4096
|
|
|
|
InitialMinQuestionSize = 128
|
2018-01-09 00:24:51 +01:00
|
|
|
TimeoutMin = 1 * time.Second
|
|
|
|
TimeoutMax = 5 * time.Second
|
|
|
|
)
|
|
|
|
|
|
|
|
func HasTCFlag(packet []byte) bool {
|
|
|
|
return packet[2]&2 == 2
|
|
|
|
}
|