segverifier

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package segverifier implements primitives for verifying path segments.

A Unit contains a path segment, and all the revocations that reference IFIDs in that path segment.

When a unit is verified, it spawns one goroutine for the path segment's verification, and one goroutine for the verification of each revocation. It then collects the results from all workers (forcefully terminating them if the unit's context is Done). A UnitResult object is returned, containing a reference to the Unit itself and a map of errors. The map only contains non-nil errors as values, and the keys are represented by the following:

  • If the path segment verification failed, its error is contained at key -1
  • If a revocation verification failed, its error is contained at key x, where x is the position of the revocation in the slice of SignedRevInfos passed to BuildVerificationUnits.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func VerifyRevInfo

func VerifyRevInfo(ctx context.Context, signedRevInfo *path_mgmt.SignedRevInfo,
	trail []addr.ISD) error

func VerifySegment

func VerifySegment(ctx context.Context, segment *seg.Meta, trail []addr.ISD) error

Types

type ElemResult

type ElemResult struct {
	Index int
	Error error
}

type Unit

type Unit struct {
	SegMeta   *seg.Meta
	SRevInfos []*path_mgmt.SignedRevInfo
}

Unit contains multiple verification items.

func BuildUnits

func BuildUnits(segMetas []*seg.Meta,
	sRevInfos []*path_mgmt.SignedRevInfo) []*Unit

BuildUnits constructs one verification unit for each segment, together with its associated revocations.

func (*Unit) Len

func (u *Unit) Len() int

func (*Unit) Verify

func (u *Unit) Verify(ctx context.Context, unitResults chan UnitResult)

Verify verifies a single unit, putting the results of verifications on unitResults.

type UnitResult

type UnitResult struct {
	Unit   *Unit
	Errors map[int]error
}

Jump to

Keyboard shortcuts

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