github.com/linuxboot/fiano@v1.2.0/pkg/intel/metadata/cbnt/cbntbootpolicy/manifest_nocodegen.go (about) 1 // Copyright 2017-2021 the LinuxBoot Authors. All rights reserved 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 //go:build !manifestcodegen 6 // +build !manifestcodegen 7 8 // 9 // To avoid errors "bpm.KeySignatureOffsetTotalSize undefined" and 10 // "bpm.BPMH.PrettyString undefined" we place these functions to a file 11 // with a build tag "!manifestcodegen" 12 13 package cbntbootpolicy 14 15 import ( 16 "fmt" 17 18 "github.com/linuxboot/fiano/pkg/intel/metadata/common/pretty" 19 ) 20 21 func (bpm *Manifest) rehashedBPMH() BPMH { 22 bpmh := bpm.BPMH 23 bpmh.KeySignatureOffset = uint16(bpm.PMSEOffset() + bpm.PMSE.KeySignatureOffset()) 24 return bpmh 25 } 26 27 // Print prints the Manifest 28 func (bpm Manifest) Print() { 29 fmt.Printf("%v", bpm.BPMH.PrettyString(1, true)) 30 for _, item := range bpm.SE { 31 fmt.Printf("%v", item.PrettyString(1, true)) 32 } 33 if bpm.TXTE != nil { 34 fmt.Printf("%v\n", bpm.TXTE.PrettyString(1, true)) 35 } else { 36 fmt.Printf(" --TXTE--\n\t not set!(optional)\n") 37 } 38 39 if bpm.PCDE != nil { 40 fmt.Printf("%v\n", bpm.PCDE.PrettyString(1, true)) 41 } else { 42 fmt.Println(" --PCDE-- \n\tnot set!(optional)") 43 } 44 45 if bpm.PME != nil { 46 fmt.Printf("%v\n", bpm.PME.PrettyString(1, true)) 47 } else { 48 fmt.Println(" --PME--\n\tnot set!(optional)") 49 } 50 51 if bpm.PMSE.Signature.DataTotalSize() < 1 { 52 fmt.Printf("%v\n", bpm.PMSE.PrettyString(1, true, pretty.OptionOmitKeySignature(true))) 53 fmt.Printf(" --PMSE--\n\tBoot Policy Manifest not signed!\n\n") 54 } else { 55 fmt.Printf("%v\n", bpm.PMSE.PrettyString(1, true, pretty.OptionOmitKeySignature(false))) 56 } 57 }