Documentation ¶
Index ¶
- func HashPublicKey(pub interface{}) ([]byte, error)
- func ParseCertification(r io.Reader, cache *AuthoritySet) error
- func ParseDottedQuad(addr string, out *[4]byte)
- func WeightedSample(weights []int64, rand *mathrand.Rand) int
- type Authorities
- type AuthoritySet
- type BandwidthWeights
- type Consensus
- type Directory
- type MinimalNodeInfo
- type NodeInfo
- type PositionWeights
- type ShortNodeInfo
- type Version
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HashPublicKey ¶
func ParseCertification ¶
func ParseCertification(r io.Reader, cache *AuthoritySet) error
func ParseDottedQuad ¶
Types ¶
type Authorities ¶
type AuthoritySet ¶
type AuthoritySet struct {
// contains filtered or unexported fields
}
func ReadCertifications ¶
func ReadCertifications(r io.Reader, allowedFingerprints []string) *AuthoritySet
ReadCertifications updates signingKeys and identities whenever sufficient cross-certification is provided
func (*AuthoritySet) NumAuthorities ¶
func (c *AuthoritySet) NumAuthorities() int
func (*AuthoritySet) SigningKey ¶
func (c *AuthoritySet) SigningKey(idHashHex, signingHashHex string) *rsa.PublicKey
type BandwidthWeights ¶
type BandwidthWeights struct {
ForGuard, ForRelay, ForExit PositionWeights
}
func (*BandwidthWeights) WeighBootstrap ¶
func (w *BandwidthWeights) WeighBootstrap(n *NodeInfo) int64
type Consensus ¶
type Consensus struct {
NotBefore, FreshUntil, NotAfter time.Time
BandwidthWeights BandwidthWeights
Routers []*ShortNodeInfo
}
func ReadMicrodescriptorConsensus ¶
func ReadMicrodescriptorConsensus(r io.Reader, authorities Authorities, nRequired int) (*Consensus, error)
212.112.245.170/tor/status-vote/current/consensus-microdesc/14C131+27B6B5+49015F+585769+805509+D586D1+E8A9C4+ED03BB+EFCBE7.z tor.noreply.org/tor/micro/d/MrvCj76HvmISlvtspAVTjzcp7p0NuCkUkUYg3Gs6Cig-xzZVjbCMiNkkTlWOWAcwqXWTTJYz9vDs37gam8kDiLA.z
type Directory ¶
type Directory struct { Authorities Authorities Consensus *Consensus Routers []*NodeInfo }
type MinimalNodeInfo ¶
type NodeInfo ¶
type NodeInfo struct { *ShortNodeInfo NTorOnionKey []byte OnionKey rsa.PublicKey ExitPolicy4, ExitPolicy6 string Addresses []string FamilyFingerprints []string // []hex(sha1(idKey)), lowerCase FamilyNicknames []string // in addition to FamilyFingerprints, NOT corresponding }
func ReadMicrodescriptors ¶
func ReadMicrodescriptors(r_ io.Reader, shortInfos []*ShortNodeInfo) ([]*NodeInfo, error)
type PositionWeights ¶
type PositionWeights struct {
Guard, Relay, Exit, GuardExit int64
}
PositionWeights represents weights for choosing a node that will serve in a particular position (guard / relay / exit / directory).
func (*PositionWeights) Weigh ¶
func (w *PositionWeights) Weigh(n *NodeInfo) int64
type ShortNodeInfo ¶
type ShortNodeInfo struct { MinimalNodeInfo Nickname string MicrodescriptorDigest [32]byte // sha256(microdescriptor) Published time.Time DirectoryPort uint16 Version Version RawBandwidth int // kilobytes per second UnmeasuredBandwidth int Authority, BadExit, Exit, Fast, Guard, HSDir, Named, Running, Stable, Unnamed, V2Dir, Valid bool }
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package bufio implements buffered I/O. It wraps an io.Reader or io.Writer object, creating another object (Reader or Writer) that also implements the interface but provides buffering and some help for textual I/O.
|
Package bufio implements buffered I/O. It wraps an io.Reader or io.Writer object, creating another object (Reader or Writer) that also implements the interface but provides buffering and some help for textual I/O. |
Click to show internal directories.
Click to hide internal directories.