Add backends and simulated TPM device

Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com>
This commit is contained in:
Ettore Di Giacinto
2022-02-16 12:52:30 +01:00
parent c2203f40dd
commit 1ab3e10e4d
11 changed files with 269 additions and 16 deletions

13
backend/socket.go Normal file
View File

@@ -0,0 +1,13 @@
package backend
import "net"
func Socket(f string) (*FakeTPM, error) {
conn, err := net.Dial("unix", f)
if err != nil {
return nil, err
}
return &FakeTPM{
ReadWriteCloser: conn,
}, nil
}