dnsstamps

package module
Version: v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2020 License: Unlicense Imports: 7 Imported by: 5

README

Build Status Code Coverage Go Report Card Go Doc

DNS Stamps

Implementation of DNS stamps:

Server stamps encode all the parameters required to connect to a secure DNS server as a single string. Think about stamps as QR code, but for DNS.

Half of the code comes from the DNS stamps author: https://github.com/jedisct1/go-dnsstamps

This library was made for a single purpose - to add missing stamps implementations: plain DNS and DNS-over-TLS.

TODO: backport to https://github.com/jedisct1/go-dnsstamps

Documentation

Index

Constants

View Source
const (
	// ServerInformalPropertyDNSSEC means resolver does DNSSEC validation
	ServerInformalPropertyDNSSEC = ServerInformalProperties(1) << 0
	// ServerInformalPropertyNoLog means resolver does not record logs
	ServerInformalPropertyNoLog = ServerInformalProperties(1) << 1
	// ServerInformalPropertyNoFilter means resolver doesn't intentionally block domains
	ServerInformalPropertyNoFilter = ServerInformalProperties(1) << 2
)
View Source
const (
	// StampProtoTypePlain is plain DNS
	StampProtoTypePlain = StampProtoType(0x00)
	// StampProtoTypeDNSCrypt is DNSCrypt
	StampProtoTypeDNSCrypt = StampProtoType(0x01)
	// StampProtoTypeDoH is DNS-over-HTTPS
	StampProtoTypeDoH = StampProtoType(0x02)
	// StampProtoTypeTLS is DNS-over-TLS
	StampProtoTypeTLS = StampProtoType(0x03)
	// StampProtoTypeDoQ is DNS-over-QUIC
	StampProtoTypeDoQ = StampProtoType(0x04)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ServerInformalProperties

type ServerInformalProperties uint64

ServerInformalProperties represents informal properties about the resolver

type ServerStamp

type ServerStamp struct {
	ServerAddrStr string  // Server address with port
	ServerPk      []uint8 // the DNSCrypt provider’s Ed25519 public key, as 32 raw bytes. Empty for other types.

	// Hash is the SHA256 digest of one of the TBS certificate found in the validation chain,
	// typically the certificate used to sign the resolver’s certificate. Multiple hashes can
	// be provided for seamless rotations.
	Hashes [][]uint8

	// Provider means different things depending on the stamp type
	// DNSCrypt: the DNSCrypt provider name
	// DOH and DOT: server's hostname
	// Plain DNS: not specified
	ProviderName string

	Path  string                   // Path is the HTTP path, and it has a meaning for DoH stamps only
	Props ServerInformalProperties // Server properties (DNSSec, NoLog, NoFilter)
	Proto StampProtoType           // Stamp protocol
}

ServerStamp is the DNS stamp representation

func NewServerStampFromString

func NewServerStampFromString(stampStr string) (ServerStamp, error)

NewServerStampFromString creates a new DNS stamp from the stamp string

func (*ServerStamp) String

func (stamp *ServerStamp) String() string

type StampProtoType

type StampProtoType uint8

StampProtoType is a stamp protocol type

func (*StampProtoType) String

func (stampProtoType *StampProtoType) String() string

Source Files

Jump to

Keyboard shortcuts

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