cvelistrepo

package
v0.0.0-...-f538f38 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 License: BSD-3-Clause, CC-BY-4.0 Imports: 27 Imported by: 0

Documentation

Overview

Package cvelistrepo supports working with the repo containing the list of CVEs.

Index

Constants

View Source
const (
	URLv4 = "https://github.com/CVEProject/cvelist"
	URLv5 = "https://github.com/CVEProject/cvelistV5"
)

URLs of the CVE project list repos.

Variables

This section is empty.

Functions

func FetchCVE

func FetchCVE[T any](ctx context.Context, repo *git.Repository, cveID string) (_ T, err error)

FetchCVE fetches the CVE file for cveID from the CVElist repo and returns the parsed info.

func Parse

func Parse[T any](repo *git.Repository, f File) (T, error)

Parse unmarshals the contents of f.

func TestToReport

func TestToReport[S report.Source](t *testing.T, update, realProxy bool) error

func UpdateTxtar

func UpdateTxtar(ctx context.Context, t *testing.T, url string)

Types

type File

type File struct {
	DirPath  string
	Filename string
	TreeHash plumbing.Hash
	BlobHash plumbing.Hash
	Year     int
	Number   int
}

A File is a file in the cvelist repo that contains a CVE.

func Files

func Files(repo *git.Repository, commit *object.Commit) (_ []File, err error)

Files returns all the CVE files in the given repo commit, sorted by name.

func (*File) ReadAll

func (f *File) ReadAll(repo *git.Repository) ([]byte, error)

Jump to

Keyboard shortcuts

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