mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-07-27 17:25:20 -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
33
image/measured-boot/measure/authentihash_test.go
Normal file
33
image/measured-boot/measure/authentihash_test.go
Normal file
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
Copyright (c) Edgeless Systems GmbH
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
package measure
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"crypto/sha256"
|
||||
"testing"
|
||||
|
||||
"github.com/edgelesssys/constellation/v2/image/measured-boot/fixtures"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestPeSectionReader(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
|
||||
peReader := bytes.NewReader(fixtures.UKI())
|
||||
digest, err := Authentihash(peReader, sha256.New())
|
||||
assert.NoError(err)
|
||||
assert.Equal(
|
||||
[]byte{
|
||||
0xd3, 0x43, 0xbe, 0x62, 0x65, 0xeb, 0x3e, 0x23,
|
||||
0xf7, 0x8b, 0x0a, 0xe0, 0x96, 0xbf, 0xf3, 0x34,
|
||||
0xe3, 0x7a, 0x76, 0x0a, 0xe8, 0x30, 0x73, 0x62,
|
||||
0x83, 0xf9, 0xb0, 0x26, 0x8e, 0xce, 0xdc, 0xf2,
|
||||
},
|
||||
digest,
|
||||
)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue