installer

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2019 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Overview

Package installer contains routines used for installing and or updating Tor Browser.

Index

Constants

This section is empty.

Variables

View Source
var ErrExtractionCanceled = errors.New("tar extraction canceled")

ErrExtractionCanceled is the error returned when the untar operation was canceled.

View Source
var StaticHPKPPins *hpkp.MemStorage

StaticHPKPPins is the backing store containing static HPKP pins for install/update related hosts.

Functions

func DownloadsURL

func DownloadsURL(cfg *config.Config, useOnion bool) string

DownloadsURL returns the `downloads.json` URL for the configured channel.

func ExtractBundle

func ExtractBundle(destDir string, bundleTarXz []byte, cancelCh chan interface{}) error

ExtractBundle extracts the supplied tar.xz archive into destDir. Any writes to cancelCh will abort the extraction.

func UpdateURL

func UpdateURL(manif *config.Manifest, useOnion bool) (string, error)

UpdateURL returns the update check URL for the installed bundle.

func ValidatePGPSignature

func ValidatePGPSignature(bundle, signature []byte) error

ValidatePGPSignature validates the bundle and signature pair against the TBB key ring.

func VerifyTorBrowserMAR

func VerifyTorBrowserMAR(mar []byte) error

VerifyTorBrowserMAR validates the MAR signature against the TBB MAR signing keys.

Types

type DownloadsEntry

type DownloadsEntry struct {
	// Sig is the URL to the PGP signature of the Binary.
	Sig string

	// Binary is the URL to the tar.xz bundle.
	Binary string
}

DownloadsEntry is a bundle download entry.

func GetDownloadsEntry

func GetDownloadsEntry(cfg *config.Config, b []byte) (string, *DownloadsEntry, error)

GetDownloadsEntry parses the json file and returns the Version and appropriate DownloadsEntry for the current configuration.

type Patch

type Patch struct {
	Url          string `xml:"URL,attr"`
	HashFunction string `xml:"hashFunction,attr"`
	HashValue    string `xml:"hashValue,attr"`
	Size         int    `xml:"size,attr"`
	Type         string `xml:"type,attr"`
}

Patch is an update patch.

type UpdateEntry

type UpdateEntry struct {
	Type            string  `xml:"type,attr"`
	DisplayVersion  string  `xml:"displayVersion,attr"`
	AppVersion      string  `xml:"appVersion,attr"`
	PlatformVersion string  `xml:"platformVersion,attr"`
	BuildID         string  `xml:"buildID,attr"`
	DetailsURL      string  `xml:"detailsURL,attr"`
	Actions         string  `xml:"actions,attr"`
	OpenURL         string  `xml:"openURL,attr"`
	Patch           []Patch `xml:"patch"`
}

UpdateEntry is a MAR update entry.

func GetUpdateEntry

func GetUpdateEntry(b []byte) (*UpdateEntry, error)

GetUpdateEntry parses the xml file and returns the UpdateEntry if any.

Jump to

Keyboard shortcuts

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