validator

package
v0.0.0-...-f44e450 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2023 License: BSD-3-Clause Imports: 34 Imported by: 0

Documentation

Overview

Copyright 2023 Meta Platforms, Inc. and affiliates.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Copyright 2023 Meta Platforms, Inc. and affiliates.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Copyright 2023 Meta Platforms, Inc. and affiliates.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Copyright 2023 Meta Platforms, Inc. and affiliates.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Copyright 2023 Meta Platforms, Inc. and affiliates.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Copyright 2023 Meta Platforms, Inc. and affiliates.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Copyright 2023 Meta Platforms, Inc. and affiliates.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Copyright 2023 Meta Platforms, Inc. and affiliates.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Copyright 2023 Meta Platforms, Inc. and affiliates.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Copyright 2023 Meta Platforms, Inc. and affiliates.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Copyright 2023 Meta Platforms, Inc. and affiliates.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Index

Constants

View Source
const (
	// EventLogPath is the path used to extract TPM EventLog.
	EventLogPath = `/sys/kernel/security/tpm0/binary_bios_measurements`
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CurrentKMID

type CurrentKMID struct{}

CurrentKMID validates if KMID of ACM_POLICY_STATUS matched the KMID of Key Manifest.

func (CurrentKMID) Validate

func (CurrentKMID) Validate(
	ctx context.Context,
	info *ValidationInfo,
) error

Validate implements Validator.

type ErrAlg

type ErrAlg struct {
	Err error
	Alg tpm2.Algorithm
}

ErrAlg is an error. See the description in method Error.

func (ErrAlg) Error

func (err ErrAlg) Error() string

Error implements error.

func (ErrAlg) Unwrap

func (err ErrAlg) Unwrap() error

Unwrap is a standard method used by package "errors" to handle nested errors.

type ErrAlignFirmwares

type ErrAlignFirmwares struct {
	Err error
}

ErrAlignFirmwares means it was unable to align firmware images to each other to use the same PCR measurements offsets.

func (ErrAlignFirmwares) Error

func (err ErrAlignFirmwares) Error() string

Error implements error.

func (ErrAlignFirmwares) Unwrap

func (err ErrAlignFirmwares) Unwrap() error

Unwrap is a standard method used by package "errors" to handle nested errors.

type ErrCompilePCR0DATAMeasurement

type ErrCompilePCR0DATAMeasurement struct {
	PCR0Data *xtpmeventlog.PCR0DATALog
	HashAlgo tpm2.Algorithm
	Err      error
}

ErrCompilePCR0DATAMeasurement is an error. See the description in method Error.

func (ErrCompilePCR0DATAMeasurement) Error

Error implements error.

func (ErrCompilePCR0DATAMeasurement) Unwrap

func (err ErrCompilePCR0DATAMeasurement) Unwrap() error

Unwrap is a standard method used by package "errors" to handle nested errors.

type ErrCurrentFirmware

type ErrCurrentFirmware struct {
	Err error
}

ErrCurrentFirmware is an error. See the description in method Error.

func (ErrCurrentFirmware) Error

func (err ErrCurrentFirmware) Error() string

Error implements error.

func (ErrCurrentFirmware) Unwrap

func (err ErrCurrentFirmware) Unwrap() error

Unwrap is a standard method used by package "errors" to handle nested errors.

type ErrDump

type ErrDump struct {
	Err error
}

ErrDump is an error. See the description in method Error.

func (ErrDump) Description

func (err ErrDump) Description() string

Description explains how to interpret the error in details.

func (ErrDump) Error

func (err ErrDump) Error() string

Error implements error.

func (ErrDump) Unwrap

func (err ErrDump) Unwrap() error

Unwrap is a standard method used by package "errors" to handle nested errors.

type ErrEventLog

type ErrEventLog struct {
	Err  error
	Path string
}

ErrEventLog is an error. See the description in method Error.

func (ErrEventLog) Error

func (err ErrEventLog) Error() string

Error implements error.

func (ErrEventLog) Unwrap

func (err ErrEventLog) Unwrap() error

Unwrap is a standard method used by package "errors" to handle nested errors.

type ErrExpectedFirmware

type ErrExpectedFirmware struct {
	Err error
}

ErrExpectedFirmware is an error. See the description in method Error.

func (ErrExpectedFirmware) Error

func (err ErrExpectedFirmware) Error() string

Error implements error.

func (ErrExpectedFirmware) Unwrap

func (err ErrExpectedFirmware) Unwrap() error

Unwrap is a standard method used by package "errors" to handle nested errors.

type ErrExpectedPCR0

type ErrExpectedPCR0 struct {
	ErrPCR0Mismatch

	ExpectedMeasurementsLog string
}

ErrExpectedPCR0 is an error. See the description in method Error.

func (ErrExpectedPCR0) Description

func (err ErrExpectedPCR0) Description() string

Description implements Descriptioner.

func (ErrExpectedPCR0) Error

func (err ErrExpectedPCR0) Error() string

Error implements error.

func (ErrExpectedPCR0) Unwrap

func (err ErrExpectedPCR0) Unwrap() error

Unwrap is a standard method used by package "errors" to handle nested errors.

type ErrFetchTXTConfigSpace

type ErrFetchTXTConfigSpace struct {
	Err error
}

ErrFetchTXTConfigSpace is an error. See the description in method Error.

func (ErrFetchTXTConfigSpace) Error

func (err ErrFetchTXTConfigSpace) Error() string

Error implements error.

func (ErrFetchTXTConfigSpace) Unwrap

func (err ErrFetchTXTConfigSpace) Unwrap() error

Unwrap is a standard method used by package "errors" to handle nested errors.

type ErrGetPCR0Measurements

type ErrGetPCR0Measurements struct {
	Err error
}

ErrGetPCR0Measurements is an error. See the description in method Error.

func (ErrGetPCR0Measurements) Error

func (err ErrGetPCR0Measurements) Error() string

Error implements error.

func (ErrGetPCR0Measurements) Unwrap

func (err ErrGetPCR0Measurements) Unwrap() error

Unwrap is a standard method used by package "errors" to handle nested errors.

type ErrHostBootedUp

type ErrHostBootedUp struct {
}

ErrHostBootedUp means that the host booted up, but it wasn't expected to do so.

func (ErrHostBootedUp) Error

func (err ErrHostBootedUp) Error() string

type ErrHostFailedBootUp

type ErrHostFailedBootUp struct {
}

ErrHostFailedBootUp means that the host failed to boot up

func (ErrHostFailedBootUp) Error

func (err ErrHostFailedBootUp) Error() string

type ErrIncorrectEventLog

type ErrIncorrectEventLog struct {
	Err error
}

ErrIncorrectEventLog is an error. See the description in method Error.

func (ErrIncorrectEventLog) Error

func (err ErrIncorrectEventLog) Error() string

Error implements error.

func (ErrIncorrectEventLog) Unwrap

func (err ErrIncorrectEventLog) Unwrap() error

Unwrap is a standard method used by package "errors" to handle nested errors.

type ErrKMIDMismatch

type ErrKMIDMismatch struct {
	Actual   uint8
	Expected uint8
}

ErrKMIDMismatch means KMID from ACM_POLICY_STATUS does not match the KMID from the Key Manifest.

func (ErrKMIDMismatch) Error

func (err ErrKMIDMismatch) Error() string

Error implements error.

type ErrLocalDMITable

type ErrLocalDMITable struct {
	Err error
}

ErrLocalDMITable is an error. See the description in method Error.

func (ErrLocalDMITable) Error

func (err ErrLocalDMITable) Error() string

func (ErrLocalDMITable) Unwrap

func (err ErrLocalDMITable) Unwrap() error

Unwrap is a standard method used by package "errors" to handle nested errors.

type ErrOrigFirmware

type ErrOrigFirmware struct {
	Err error
}

ErrOrigFirmware is an error. See the description in method Error.

func (ErrOrigFirmware) Error

func (err ErrOrigFirmware) Error() string

Error implements error.

func (ErrOrigFirmware) Unwrap

func (err ErrOrigFirmware) Unwrap() error

Unwrap is a standard method used by package "errors" to handle nested errors.

type ErrOriginalPCR0

type ErrOriginalPCR0 struct {
	PCR0Data *xtpmeventlog.PCR0DATALog
	HashAlgo tpm2.Algorithm
	Expected []byte
	Actual   []byte
}

ErrOriginalPCR0 is an error. See the description in method Error.

func (ErrOriginalPCR0) Error

func (err ErrOriginalPCR0) Error() string

Error implements error.

type ErrPCR0Mismatch

type ErrPCR0Mismatch struct {
	Received []byte
	Expected []byte
}

ErrPCR0Mismatch is an error. See the description in method Error.

func (ErrPCR0Mismatch) Error

func (err ErrPCR0Mismatch) Error() string

Unwrap is a standard method used by package "errors" to handle nested errors.

type ErrParseDMITable

type ErrParseDMITable struct {
	Err error
}

ErrParseDMITable is an error. See the description in method Error.

func (ErrParseDMITable) Error

func (err ErrParseDMITable) Error() string

Error implements error.

func (ErrParseDMITable) Unwrap

func (err ErrParseDMITable) Unwrap() error

Unwrap is a standard method used by package "errors" to handle nested errors.

type ErrParseFirmware

type ErrParseFirmware struct {
	Err error
}

ErrParseFirmware is an error. See the description in method Error.

func (ErrParseFirmware) Error

func (err ErrParseFirmware) Error() string

Error implements error.

func (ErrParseFirmware) Unwrap

func (err ErrParseFirmware) Unwrap() error

Unwrap is a standard method used by package "errors" to handle nested errors.

type ErrParsePCR0DATALog

type ErrParsePCR0DATALog struct {
	Err error
}

ErrParsePCR0DATALog means the PCR0_DATA description in the EventLog is not parsable, by xtpmeventlog package.

func (ErrParsePCR0DATALog) Error

func (err ErrParsePCR0DATALog) Error() string

Error implements error.

func (ErrParsePCR0DATALog) Unwrap

func (err ErrParsePCR0DATALog) Unwrap() error

Unwrap is a standard method used by package "errors" to handle nested errors.

type ErrReadMSRRegisters

type ErrReadMSRRegisters struct {
	Err error
}

ErrReadMSRRegisters is an error. See the description in method Error.

func (ErrReadMSRRegisters) Error

func (err ErrReadMSRRegisters) Error() string

Error implements error.

func (ErrReadMSRRegisters) Unwrap

func (err ErrReadMSRRegisters) Unwrap() error

Unwrap is a standard method used by package "errors" to handle nested errors.

type ErrReadTXTRegisters

type ErrReadTXTRegisters struct {
	Err error
}

ErrReadTXTRegisters is an error. See the description in method Error.

func (ErrReadTXTRegisters) Error

func (err ErrReadTXTRegisters) Error() string

Error implements error.

func (ErrReadTXTRegisters) Unwrap

func (err ErrReadTXTRegisters) Unwrap() error

Unwrap is a standard method used by package "errors" to handle nested errors.

type ErrReconstructDigestMismatch

type ErrReconstructDigestMismatch struct {
	PCR0Data *xtpmeventlog.PCR0DATALog
	HashAlgo tpm2.Algorithm
	Expected []byte
	Actual   []byte
}

ErrReconstructDigestMismatch is an error. See the description in method Error.

func (ErrReconstructDigestMismatch) Error

Error implements error.

type ErrReplayEventLog

type ErrReplayEventLog struct {
	Err             error
	Algo            tpm2.Algorithm
	ReplayLog       string
	MeasurementsLog string
}

ErrReplayEventLog is an error. See the description in method Error.

func (ErrReplayEventLog) Description

func (err ErrReplayEventLog) Description() string

Description implements Descriptioner.

func (ErrReplayEventLog) Error

func (err ErrReplayEventLog) Error() string

Error implements error.

func (ErrReplayEventLog) Unwrap

func (err ErrReplayEventLog) Unwrap() error

Unwrap is a standard method used by package "errors" to handle nested errors.

type ErrSELNotFound

type ErrSELNotFound struct {
	// contains filtered or unexported fields
}

ErrSELNotFound means that no matching SEL event was found

func (ErrSELNotFound) Error

func (err ErrSELNotFound) Error() string

type ErrSetup

type ErrSetup struct {
	Err error
}

ErrSetup is an error. See the description in method Error.

func (ErrSetup) Error

func (err ErrSetup) Error() string

Error implements error.

func (ErrSetup) Unwrap

func (err ErrSetup) Unwrap() error

Unwrap is a standard method used by package "errors" to handle nested errors.

type ErrStatusRegisters

type ErrStatusRegisters struct {
	Err error
}

ErrStatusRegisters is an error. See the description in method Error.

func (ErrStatusRegisters) Error

func (err ErrStatusRegisters) Error() string

Error implements error.

func (ErrStatusRegisters) Unwrap

func (err ErrStatusRegisters) Unwrap() error

Unwrap is a standard method used by package "errors" to handle nested errors.

type ErrTPM

type ErrTPM struct {
	Err error
}

ErrTPM is an error. See the description in method Error.

func (ErrTPM) Error

func (err ErrTPM) Error() string

Error implements error.

func (ErrTPM) Unwrap

func (err ErrTPM) Unwrap() error

Unwrap is a standard method used by package "errors" to handle nested errors.

type ErrUnexepectedSELFound

type ErrUnexepectedSELFound struct {
	// contains filtered or unexported fields
}

ErrUnexepectedSELFound means that a SEL event was found that should not be generated

func (ErrUnexepectedSELFound) Error

func (err ErrUnexepectedSELFound) Error() string

type ErrValidator

type ErrValidator struct {
	Err       error
	Validator Validator
}

ErrValidator is an error. See the description in method Error.

func (ErrValidator) Error

func (err ErrValidator) Error() string

Error implements error.

func (ErrValidator) Unwrap

func (err ErrValidator) Unwrap() error

Unwrap is a standard method used by package "errors" to handle nested errors.

type ErrWrongPCR0DATALog

type ErrWrongPCR0DATALog struct {
	Algo   tpm2.Algorithm
	Logged *xtpmeventlog.PCR0DATALog
	Err    error
}

ErrWrongPCR0DATALog is an error. See the description in method Error.

func (ErrWrongPCR0DATALog) Description

func (err ErrWrongPCR0DATALog) Description() string

Description implements Descriptioner.

func (ErrWrongPCR0DATALog) Error

func (err ErrWrongPCR0DATALog) Error() string

Error implements error.

func (ErrWrongPCR0DATALog) Unwrap

func (err ErrWrongPCR0DATALog) Unwrap() error

Unwrap is a standard method used by package "errors" to handle nested errors.

type ExpectHostBootedUp

type ExpectHostBootedUp struct {
	// contains filtered or unexported fields
}

ExpectHostBootedUp validates that the host is booted or not

func NewExpectHostBootedUp

func NewExpectHostBootedUp(expectedToBoot bool) ExpectHostBootedUp

NewExpectHostBootedUp creates a new HostBootedValidator validator

func (ExpectHostBootedUp) Validate

func (hb ExpectHostBootedUp) Validate(
	ctx context.Context,
	info *ValidationInfo,
) error

Validate implements Validator.

type ExpectSEL

type ExpectSEL struct {
	// contains filtered or unexported fields
}

ExpectSEL validates that SEL events contain the expected one

func MustExpectSEL

func MustExpectSEL(positive string, negatve string) ExpectSEL

MustExpectSEL creates a new ExpectSEL validator and panics if an error occures

func NewExpectSEL

func NewExpectSEL(positive string, negatve string) (ExpectSEL, error)

NewExpectSEL creates new matcher for a SEL event @positive is an optional SEL event should be found among all SELs @negative is an optional SEL event that should not be found before the positive SEL is found. If positive SEL is not specified, negative should not match any SEL event

func (ExpectSEL) Validate

func (es ExpectSEL) Validate(
	ctx context.Context,
	info *ValidationInfo,
) error

Validate implements Validator.

type ExpectedFirmware

type ExpectedFirmware struct{}

ExpectedFirmware checks if current firmware is the one we expect in this test case.

func (ExpectedFirmware) Validate

func (ExpectedFirmware) Validate(
	ctx context.Context,
	info *ValidationInfo,
) error

Validate implements Validator.

type ExpectedPCR0

type ExpectedPCR0 struct{}

ExpectedPCR0 checks if current PCR0 value is the same as we expect for the current firmware image.

func (ExpectedPCR0) Validate

func (ExpectedPCR0) Validate(
	ctx context.Context,
	info *ValidationInfo,
) error

Validate implements Validator.

type Firmware

type Firmware struct {
	UEFI     *uefi.UEFI
	DMITable *dmidecode.DMITable
	Intel    *FirmwareIntelStructs
}

Firmware contains all information about a firmware image commonly needed in validators.

type FirmwareIntelStructs

type FirmwareIntelStructs struct {
	FIT fit.Table
	BPM *cbntbootpolicy.Manifest
	KM  *cbntkey.Manifest
}

FirmwareIntelStructs contains structures of a firmware image related to Intel CPUs.

type PCR0DATALog

type PCR0DATALog struct{}

PCR0DATALog checks if TPM EventLog contains expected granular log for PCR0_DATA (CBnT).

func (PCR0DATALog) Validate

func (PCR0DATALog) Validate(
	ctx context.Context,
	info *ValidationInfo,
) error

Validate implements Validator.

type ReplayEventLog

type ReplayEventLog struct{}

ReplayEventLog checks if current PCR0 values could be reproduces by replaying the EventLog.

func (ReplayEventLog) Validate

func (ReplayEventLog) Validate(
	ctx context.Context,
	info *ValidationInfo,
) error

Validate implements Validator.

type TestCaseSetup

type TestCaseSetup interface {
	Setup(ctx context.Context, image []byte) error
}

TestCaseSetup represents the Setup method of a testcase

type ValidationInfo

type ValidationInfo struct {
	HostBooted                   bool
	SELs                         []types.SEL
	FirmwareCurrent              Firmware
	FirmwareExpected             Firmware
	FirmwareOriginal             Firmware
	FirmwareAlignToCurrentOffset uint64
	ExpectedBootResult           *bootengine.BootProcess
	ExpectedTPMState             *tpm.TPM
	StatusRegisters              registers.Registers
	EventLog                     *tpmeventlog.TPMEventLog
	PCR0Current                  map[tpm2.Algorithm][]byte
}

ValidationInfo is the prerequisites for any validation work.

func GetValidationInfo

func GetValidationInfo(
	ctx context.Context,
	t TestCaseSetup,
	origImage []byte,
	opts types.Options,
) (*ValidationInfo, error)

GetValidationInfo extracts ValidationInfo from the local machine.

type Validator

type Validator interface {
	// Validate returns nil if the feature works properly, and non-nil if
	// there is an problem.
	Validate(ctx context.Context, info *ValidationInfo) error
}

Validator is a validation handler of a single feature.

type Validators

type Validators []Validator

Validators is a set of Validator-s.

func CommonHostBootUpExpected

func CommonHostBootUpExpected() Validators

CommonHostBootUpExpected is a set of Validator-s which are expected to be executed for any test case that expects the host to boot up

func CommonHostBootUpNotExpected

func CommonHostBootUpNotExpected(extraValidators ...Validator) Validators

CommonHostBootUpNotExpected is a set of Validator-s which are expected to be executed for any test case that doesn't expect the host to boot up

func (Validators) Validate

func (s Validators) Validate(ctx context.Context, info *ValidationInfo) error

Validate just calls Validate methods of each Validator until first error received. If no error received, then nil is returned.

Jump to

Keyboard shortcuts

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