Skip to content

Commit

Permalink
bootenv: move scope tests from secboot to bootenv
Browse files Browse the repository at this point in the history
the mockPlatformHandler was copied over to the bootenv package and
all the test logic related to the new scope functionality was decoupled
from the outside keydata_test.go file.
  • Loading branch information
sespiros committed Jan 23, 2024
1 parent c4376a7 commit 3870268
Show file tree
Hide file tree
Showing 3 changed files with 329 additions and 171 deletions.
11 changes: 11 additions & 0 deletions bootenv/export_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"crypto"
"crypto/ecdsa"
"crypto/elliptic"
"crypto/rand"
"crypto/x509"
"errors"

Expand Down Expand Up @@ -146,3 +147,13 @@ func NewEcdsaPublicKey(rand []byte) (ecdsaPublicKey, error) {

return pk, nil
}

func NewPrimaryKey(sz1 int) (secboot.PrimaryKey, error) {
primaryKey := make(secboot.PrimaryKey, sz1)
_, err := rand.Read(primaryKey)
if err != nil {
return nil, err
}

return primaryKey, nil
}
Loading

0 comments on commit 3870268

Please sign in to comment.