mirror of
https://github.com/edgelesssys/constellation.git
synced 2024-12-15 10:54:29 -05:00
c7d12055d1
* config: move AMD root key to global constant * attestation: add SNP based attestation for aws * Always enable SNP, regardless of attestation type. * Make AWSNitroTPM default again There exists a bug in AWS SNP implementation where sometimes a host might not be able to produce valid SNP reports. Since we have to wait for AWS to fix this we are merging SNP attestation as opt-in feature.
49 lines
1021 B
Go
49 lines
1021 B
Go
/*
|
|
Copyright (c) Edgeless Systems GmbH
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
*/
|
|
|
|
package snp
|
|
|
|
import "fmt"
|
|
|
|
// decodeError is used to signal an error during decoding of a public key.
|
|
// It only wrapps an error.
|
|
type decodeError struct {
|
|
inner error
|
|
}
|
|
|
|
// newDecodeError an error in a DecodeError.
|
|
func newDecodeError(err error) *decodeError {
|
|
return &decodeError{inner: err}
|
|
}
|
|
|
|
func (e *decodeError) Error() string {
|
|
return fmt.Sprintf("error decoding public key: %v", e.inner)
|
|
}
|
|
|
|
func (e *decodeError) Unwrap() error {
|
|
return e.inner
|
|
}
|
|
|
|
// validationError is used to signal an invalid SNP report.
|
|
// It only wrapps an error.
|
|
// Used during testing to error conditions more precisely.
|
|
type validationError struct {
|
|
inner error
|
|
}
|
|
|
|
// newValidationError wraps an error in a ValidationError.
|
|
func newValidationError(err error) *validationError {
|
|
return &validationError{inner: err}
|
|
}
|
|
|
|
func (e *validationError) Error() string {
|
|
return e.inner.Error()
|
|
}
|
|
|
|
func (e *validationError) Unwrap() error {
|
|
return e.inner
|
|
}
|