mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-07-30 18:48:39 -04:00
image: reimplement and adapt measurement generation in Go
This commit is contained in:
parent
8e706d6de3
commit
f6d9f91877
31 changed files with 1343 additions and 286 deletions
24
image/measured-boot/pesection/pesection.go
Normal file
24
image/measured-boot/pesection/pesection.go
Normal file
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
Copyright (c) Edgeless Systems GmbH
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
package pesection
|
||||
|
||||
// PESection describes a PE section.
|
||||
type PESection struct {
|
||||
Name string
|
||||
Size uint32
|
||||
Digest [32]byte
|
||||
Measure bool
|
||||
MeasureOrder int
|
||||
}
|
||||
|
||||
// NullTerminatedName returns the name of the section with a null terminator.
|
||||
func (u PESection) NullTerminatedName() []byte {
|
||||
if len(u.Name) > 0 && u.Name[len(u.Name)-1] == 0x00 {
|
||||
return []byte(u.Name)
|
||||
}
|
||||
return append([]byte(u.Name), 0x00)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue