refdata

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: Apache-2.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package refdata holds the dated reference lists the TLS evaluation judges against: the Mozilla and Chrome root stores (with their distrust constraints), the published Diffie-Hellman groups, the CT log list and the certificate-lifetime limits.

Every list except the lifetime table is generated by ./gen from a downloaded source and carries that source's URL, retrieval date and SHA-256. Nothing is fetched at run time. The lifetime table is a short schedule transcribed from a ballot; it is written by hand in lifetime.go and pinned by a test.

Regenerate (the sources are not committed; licences and attribution are in docs/reference-data.md):

curl -o mozilla.csv 'https://ccadb.my.salesforce-sites.com/ccadb/Report?Name=MozillaTLSServerAuthenticationCSV'
curl -o chrome.csv  'https://ccadb.my.salesforce-sites.com/ccadb/Report?Name=ChromeTLSServerAuthenticationCSV'
curl -o ct.json     https://www.gstatic.com/ct/log_list/v3/log_list.json
for n in 2409 3526 5114 7919; do curl -o rfc$n.txt https://www.rfc-editor.org/rfc/rfc$n.txt; done
go run ./internal/refdata/gen -mozilla mozilla.csv -chrome chrome.csv -ctlogs ct.json \
    -rfcs . -retrieved YYYY-MM-DD -out internal/refdata

Index

Constants

View Source
const LifetimeSourceLabel = "CA/B Forum BR §6.3.2 (Ballot SC-081v3)"

LifetimeSourceLabel names the rule a limit comes from.

View Source
const StaleAfterDays = 180

StaleAfterDays is the age at which a list is flagged as old (REQ-TDAT-3).

Variables

This section is empty.

Functions

func MaxLifetime

func MaxLifetime(notBefore time.Time) (int, bool)

MaxLifetime returns the limit for a certificate issued at notBefore, and false when it was issued before the first entry (no limit is applied).

func RootName

func RootName(sha string) (owner, name string, ok bool)

RootName returns the CA owner and certificate name of a bundled root.

func Stores

func Stores() []*pki.Store

Stores returns the bundled root stores, Mozilla first. The values are shared and read-only.

Types

type CTLog

type CTLog struct {
	ID       string // base64 log ID (SHA-256 of the log key)
	Name     string
	Operator string
	State    string
	URL      string
}

CTLog is one log from the CT log list.

func LookupCTLog

func LookupCTLog(id []byte) (CTLog, bool)

LookupCTLog finds a log by its 32-byte ID.

type DHPrime

type DHPrime struct {
	SHA256     string // of the prime's big-endian bytes, leading zeros trimmed
	Name       string
	Bits       int
	Source     string // "RFC 7919 §A.1"
	Negotiated bool   // an RFC 7919 named group (the recommended kind)
}

DHPrime is one published Diffie-Hellman group.

func LookupDHPrime

func LookupDHPrime(sha string) (DHPrime, bool)

LookupDHPrime finds a published group by the hex SHA-256 the prober records.

type LifetimeLimit

type LifetimeLimit struct {
	From time.Time
	Days int
}

LifetimeLimit is the maximum validity for certificates issued on or after From.

func LifetimeTable

func LifetimeTable() []LifetimeLimit

LifetimeTable returns a copy of the schedule.

type Source

type Source struct {
	Name      string `json:"name"`
	URL       string `json:"source"`
	Retrieved string `json:"retrieved"` // YYYY-MM-DD
	SHA256    string `json:"sha256"`    // of the downloaded source file(s)
	Licence   string `json:"licence"`
	Count     int    `json:"count"`
}

Source describes where a bundled list came from.

func Sources

func Sources() []Source

Sources lists every bundled list with its count, for the About page and the reference-data API.

func (Source) Age

func (s Source) Age(now time.Time) int

Age is how old the list is at now, in whole days.

Directories

Path Synopsis
Command gen turns downloaded reference sources into the Go tables in the parent package.
Command gen turns downloaded reference sources into the Go tables in the parent package.

Jump to

Keyboard shortcuts

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