Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[intel/fit] Fix ACMv3 headers parser #376

Merged
merged 1 commit into from
Apr 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions pkg/intel/metadata/fit/ent_startup_ac_module_entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,16 @@ type ACModuleHeaderVersion uint32

const (
// ACHeaderVersion0 is version "0.0 – for SINIT ACM before 2017"
ACHeaderVersion0 = ACModuleHeaderVersion(0x0000)
ACHeaderVersion0 = ACModuleHeaderVersion(0x00000000)

// ACHeaderVersion3 is version "3.0 – for SINIT ACM of converge of BtG and TXT"
ACHeaderVersion3 = ACModuleHeaderVersion(0x0300)
ACHeaderVersion3 = ACModuleHeaderVersion(0x00030000)
)

func (ver ACModuleHeaderVersion) GoString() string {
return fmt.Sprintf("0x%08X", ver)
}

// ACChipsetID defines the module release identifier
type ACChipsetID uint16

Expand Down
2 changes: 1 addition & 1 deletion pkg/intel/metadata/fit/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type ErrUnknownACMHeaderVersion struct {
}

func (err *ErrUnknownACMHeaderVersion) Error() string {
return fmt.Sprintf("unknown ACM header version: %v", err.ACHeaderVersion)
return fmt.Sprintf("unknown ACM header version: %#v", err.ACHeaderVersion)
}

// ErrInvalidTXTPolicyRecordVersion means TXT Policy entry has invalid version.
Expand Down