We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8e9c749 commit 8a127a6Copy full SHA for 8a127a6
1 file changed
pkg/intel/metadata/common/bgheader/bgheader.go
@@ -40,20 +40,15 @@ func (bgv BootGuardVersion) String() string {
40
41
func DetectBGV(r io.Reader) (BootGuardVersion, error) {
42
var s structInfo
43
- err := binary.Read(r, binaryOrder, s.ID[:])
+ err := binary.Read(r, binaryOrder, &s)
44
if err != nil {
45
return 0, fmt.Errorf("unable to read field 'ID': %w", err)
46
}
47
- err = binary.Read(r, binaryOrder, s.Version)
48
- if err != nil {
49
- return 0, fmt.Errorf("unable to read field 'Version': %w", err)
50
- }
51
- switch s.Version {
52
- case 0x10:
53
- return Version10, nil
54
- case 0x20:
+ if s.Version >= 0x20 {
55
return Version20, nil
56
- default:
+ } else if (s.Version < 0x20) && (s.Version >= 0x10) {
+ return Version10, nil
+ } else {
57
return 0, fmt.Errorf("couldn't detect version")
58
59
0 commit comments