knowledge

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Overview

Package knowledge holds the certificates involved in the October 2026 eMudhra intermediate CA key compromise (Mozilla bug 2083449) and the facts the scanner matches on.

Every match is by public key, never by name: names can be copied, keys cannot. The data proves itself at start-up. Each "compromised" key must be k·G for a tiny k, which is exactly what makes it compromised; if the embedded data ever stopped satisfying that, Load fails instead of scanning with bad data.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotLoaded = errors.New("knowledge base not loaded")

ErrNotLoaded is returned by helpers used before Load succeeded.

Functions

func CertHash

func CertHash(c *x509.Certificate) string

CertHash returns the upper-case hex SHA-256 of a certificate's DER encoding.

func SPKIHash

func SPKIHash(c *x509.Certificate) string

SPKIHash returns the upper-case hex SHA-256 of a certificate's SubjectPublicKeyInfo.

Types

type Key

type Key struct {
	Name       string   // subject common name
	Kind       Kind     // Compromised or PathRoot
	Usage      string   // "tls", "code-signing", or "" for roots
	SPKISHA256 string   // hex, upper case
	Scalar     uint32   // private scalar, Compromised keys only
	RawKey     []byte   // EC point (uncompressed) or RSA modulus, for byte search
	CertSHA256 []string // every known certificate with this key
	Certs      []*x509.Certificate
}

Key is one public key the scanner looks for, with every certificate that carries it (the same key can appear under several issuers).

type Kind

type Kind int

Kind says why a key matters.

const (
	// Compromised: one of the eight intermediate keys anyone can recover.
	Compromised Kind = iota + 1
	// PathRoot: a CA that issued or cross-signed the compromised intermediates.
	// Trusting it lets a client build a chain to them.
	PathRoot
)

func (Kind) String

func (k Kind) String() string

type Set

type Set struct {
	Keys []*Key
	// contains filtered or unexported fields
}

Set is the loaded, verified knowledge base.

func Load

func Load() (*Set, error)

Load parses and verifies the embedded data. It is safe to call repeatedly.

func (*Set) ByCert

func (s *Set) ByCert(c *x509.Certificate) *Key

ByCert returns the key this certificate carries, if it is one we track.

Jump to

Keyboard shortcuts

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