dnscrypt

package
v1.1.15 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 27, 2021 License: LGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClientMagicLen     = 8
	ServerMagicLen     = 8
	AnonymizedOverhead = 28
	PublicKeySize      = 32
	SharedKeySize      = PublicKeySize
	NonceSize          = unclassified.NonceSize
	HalfNonceSize      = unclassified.NonceSize / 2
	TagSize            = unclassified.TagSize
	QueryOverhead      = ClientMagicLen + PublicKeySize + HalfNonceSize + TagSize
	ResponseHeaderLen  = ServerMagicLen + NonceSize
	ResponseOverhead   = ResponseHeaderLen + TagSize
	IdentifierPrefix   = "2.dnscrypt-cert."
	DNSRoot            = "."
)

Variables

This section is empty.

Functions

func AnonymizedDNSHeader

func AnonymizedDNSHeader() []byte

func CertMagic

func CertMagic() []byte

these are the fingerprint of the dnscrypt protocols, keep in mind

func Query

func Query(dialFn common.DialFn, proto string, service *Service, bin []byte, upstreamAddr, relayAddr *common.Endpoint) ([]byte, time.Duration, error)

looks like a standard dns query via user-defined port, nevertheless it's fixed with fingerprints

func RetrieveServicesInfo

func RetrieveServicesInfo(useSk bool, resolver *Resolver, dialFn common.DialFn, proto string, upstreamAddr *common.Endpoint, relays *[]*common.Endpoint) (time.Duration, error)

func ServerMagic

func ServerMagic() []byte

Types

type CryptoConstruction

type CryptoConstruction uint8
const (
	UndefinedConstruction CryptoConstruction = iota
	XSalsa20Poly1305
	XChacha20Poly1305
)

type Resolver

type Resolver struct {
	Name        *string
	Identifiers []string
	PublicKey   ed25519.PublicKey
	V1_Services []*ServiceInfo
	V2_Services []*ServiceInfo
	VN_Services []*ServiceInfo
}

type ServerKey

type ServerKey struct {
	MagicQuery [ClientMagicLen]byte
	ServerPk   [PublicKeySize]byte
}

type Service

type Service struct {
	*ServerKey
	Name    *string
	Version CryptoConstruction
}

type ServiceInfo

type ServiceInfo struct {
	*Service
	Minor  uint16
	Serial uint32
	DtFrom uint32
	DtTo   uint32
	Ext    []byte
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL