mirror of
https://github.com/kairos-io/tpm-helpers.git
synced 2025-09-20 00:38:29 +00:00
Add backends and simulated TPM device
Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com>
This commit is contained in:
9
get.go
9
get.go
@@ -16,7 +16,7 @@ import (
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
func Get(cacerts []byte, url string, header http.Header) ([]byte, error) {
|
||||
func Get(cacerts []byte, url string, header http.Header, opts ...Option) ([]byte, error) {
|
||||
dialer := websocket.DefaultDialer
|
||||
if len(cacerts) > 0 {
|
||||
pool := x509.NewCertPool()
|
||||
@@ -30,12 +30,15 @@ func Get(cacerts []byte, url string, header http.Header) ([]byte, error) {
|
||||
}
|
||||
}
|
||||
|
||||
attestationData, aikBytes, err := getAttestationData()
|
||||
c := &Config{}
|
||||
c.Apply(opts...)
|
||||
|
||||
attestationData, aikBytes, err := getAttestationData(c)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
hash, err := GetPubHash()
|
||||
hash, err := GetPubHash(opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user