File: mso_test.go

package info (click to toggle)
golang-github-foxboron-go-tpm-keyfiles 0.0~git20241207.04534a2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 216 kB
  • sloc: makefile: 9
file content (31 lines) | stat: -rw-r--r-- 413 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package keyfile

import (
	"testing"

	"github.com/google/go-tpm/tpm2"
)

func TestHandleMSO(t *testing.T) {
	for _, c := range []struct {
		h  tpm2.TPMHandle
		m  uint32
		ok bool
	}{
		{
			0x40000001,
			TPM_HT_PERMANENT,
			true,
		},
		{
			0x41000001,
			TPM_HT_PERMANENT,
			false,
		},
	} {

		if ok := IsMSO(c.h, c.m); ok != c.ok {
			t.Fatalf("mso doesn't match. expected %v got %v", c.ok, ok)
		}
	}
}