dnscrypt

package
v1.2.17 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2022 License: LGPL-3.0 Imports: 16 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, 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 *atomic.Value //[]*ServiceInfo
	V2_Services *atomic.Value //[]*ServiceInfo
	VN_Services *atomic.Value //[]*ServiceInfo
}

func (*Resolver) GetDefaultExpiration added in v1.2.0

func (r *Resolver) GetDefaultExpiration() time.Time

func (*Resolver) GetDefaultService added in v1.2.0

func (r *Resolver) GetDefaultService() (s *ServiceInfo)

func (*Resolver) GetDefaultServices added in v1.2.12

func (r *Resolver) GetDefaultServices() []*ServiceInfo

func (*Resolver) GetRandomService added in v1.2.12

func (r *Resolver) GetRandomService() *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
	Regular uint16 //A.K.A period of key rotation in hours if exists
	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