tlsmiddlebox

package
v3.18.0-alpha Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2023 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

Package tlsmiddlebox implements the tlsmiddlebox experiment

Spec: https://github.com/ooni/spec/blob/master/nettests/ts-037-tlsmiddlebox.md.

Index

Constants

This section is empty.

Variables

ClientIDs to map configurable inputs to uTLS fingerprints We use a non-zero index to map to each ClientID

Functions

func NewDialerTTLWrapper

func NewDialerTTLWrapper() model.Dialer

Types

type CompleteTrace

type CompleteTrace struct {
	Address      string          `json:"address"`
	ControlTrace *IterativeTrace `json:"control_trace"`
	TargetTrace  *IterativeTrace `json:"target_trace"`
}

CompleteTrace records the result of the network trace using a control SNI and a target SNI

type Config

type Config struct {
	// ResolverURL is the default DoH resolver
	ResolverURL string `ooni:"URL for DoH resolver"`

	// SNIPass is the SNI value we don't expect to be blocked
	SNIControl string `ooni:"control SNI value for testhelper"`

	// Delay is the delay between each iteration (in milliseconds).
	Delay int64 `ooni:"delay between consecutive iterations"`

	// MaxTTL is the default number of interations we trace
	MaxTTL int64 `ooni:"maximum TTL value to iterate upto"`

	// TestHelper is the testhelper host for iterative tracing
	TestHelper string `ooni:"testhelper URL to use for tracing"`

	// ClientId is the client fingerprint to use
	ClientId int `ooni:"ClientHello fingerprint to use"`
}

Config contains the experiment configuration.

type Iteration

type Iteration struct {
	TTL       int                                     `json:"ttl"`
	Handshake *model.ArchivalTLSOrQUICHandshakeResult `json:"handshake"`
}

Iteration is a single network iteration with variable TTL

type IterativeTrace

type IterativeTrace struct {
	SNI        string       `json:"server_name"`
	Iterations []*Iteration `json:"iterations"`
	// contains filtered or unexported fields
}

Trace is an iterative trace for the corresponding servername and address

type Measurer

type Measurer struct {
	// contains filtered or unexported fields
}

Measurer performs the measurement.

func NewExperimentMeasurer

func NewExperimentMeasurer(config Config) *Measurer

NewExperimentMeasurer creates a new ExperimentMeasurer.

func (*Measurer) DNSLookup

func (m *Measurer) DNSLookup(ctx context.Context, index int64, zeroTime time.Time,
	logger model.Logger, domain string, tk *TestKeys) ([]string, error)

DNSLookup performs a DNS Lookup for the passed domain

func (*Measurer) ExperimentName

func (m *Measurer) ExperimentName() string

ExperimentName implements ExperimentMeasurer.ExperimentName.

func (*Measurer) ExperimentVersion

func (m *Measurer) ExperimentVersion() string

ExperimentVersion implements ExperimentMeasurer.ExperimentVersion.

func (Measurer) GetSummaryKeys

func (m Measurer) GetSummaryKeys(measurement *model.Measurement) (interface{}, error)

GetSummaryKeys implements model.ExperimentMeasurer.GetSummaryKeys.

func (*Measurer) Run

func (m *Measurer) Run(ctx context.Context, args *model.ExperimentArgs) error

// Run implements ExperimentMeasurer.Run.

func (*Measurer) TCPConnect

func (m *Measurer) TCPConnect(ctx context.Context, index int64, zeroTime time.Time,
	logger model.Logger, address string, tk *TestKeys) error

TCPConnect performs a TCP connect to filter working addresses

func (*Measurer) TLSTrace

func (m *Measurer) TLSTrace(ctx context.Context, index int64, zeroTime time.Time, logger model.Logger,
	address string, targetSNI string, trace *CompleteTrace)

TLSTrace performs tracing using control and target SNI

func (*Measurer) TraceAddress

func (m *Measurer) TraceAddress(ctx context.Context, index int64, zeroTime time.Time, logger model.Logger,
	address string, sni string, tk *TestKeys, wg *sync.WaitGroup) error

TraceAddress measures a single address after the DNSLookup

type SummaryKeys

type SummaryKeys struct {
	IsAnomaly bool `json:"-"`
}

Summary contains the summary results

type TestKeys

type TestKeys struct {
	Queries        []*model.ArchivalDNSLookupResult  `json:"queries"`
	TCPConnect     []*model.ArchivalTCPConnectResult `json:"tcp_connect"`
	IterativeTrace []*CompleteTrace                  `json:"iterative_trace"`
	// contains filtered or unexported fields
}

TestKeys contains the experiment results

func NewTestKeys

func NewTestKeys() *TestKeys

NewTestKeys creates new tlsmiddlebox TestKeys

Jump to

Keyboard shortcuts

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