tpm

package
v0.0.0-...-ba47a78 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2020 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Overview

Package tpm reads and extends pcrs with measurements.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtendPCR

func ExtendPCR(tpmHandle io.ReadWriteCloser, pcr int, hash []byte) error

* ExtendPCR writes the measurements passed as 'hash' arg to pcr#x, * where x is provided by 'pcr' arg. * * pcr is owned by 'tpm2Handle', a tpm device handle. * err is returned if write to pcr fails.

func ExtendPCRDebug

func ExtendPCRDebug(tpmHandle io.ReadWriteCloser, pcr int, data io.Reader, eventDesc string) error

* ExtendPCRDebug extends a PCR with the contents of a byte slice * and notifies the kernel of this measurement by sending event via sysfs. * * In debug mode, it prints * 1. old pcr value before the hash is written to pcr * 2. new pcr values after hash is written to pcr * 3. compares old and new pcr values and prints error if they are not

func GetHandle

func GetHandle() (io.ReadWriteCloser, error)

* GetHandle returns a tpm device handle from go-tpm/tpm2 * returns a tpm handle from go-tpm/tpm2 * that can be used for storing hashes.

func ReadPCR

func ReadPCR(tpmHandle io.ReadWriteCloser, pcr int) ([]byte, error)

* ReadPCR reads pcr#x, where x is provided by 'pcr' arg and returns * the result in a byte slice. * 'tpmHandle' is the tpm device that owns the 'pcr'. * err is returned if read fails.

Types

This section is empty.

Jump to

Keyboard shortcuts

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