@@ -8,9 +8,11 @@ package cmd
8
8
9
9
import (
10
10
"encoding/base64"
11
+ "encoding/json"
11
12
"fmt"
12
13
"os"
13
14
15
+ "github.com/intel/trustauthority-client/go-connector"
14
16
"github.com/intel/trustauthority-client/go-tdx"
15
17
"github.com/intel/trustauthority-client/tdx-cli/constants"
16
18
"github.com/pkg/errors"
@@ -59,11 +61,17 @@ func getQuote(cmd *cobra.Command) error {
59
61
}
60
62
61
63
var nonceBytes []byte
64
+ var verifierNonce connector.VerifierNonce
62
65
if nonce != "" {
63
66
nonceBytes , err = base64 .StdEncoding .DecodeString (nonce )
64
67
if err != nil {
65
68
return errors .Wrap (err , "Error while base64 decoding of nonce" )
66
69
}
70
+ err = json .Unmarshal (nonceBytes , & verifierNonce )
71
+ if err != nil {
72
+ fmt .Println ("Unmarshall error: " , err .Error ())
73
+ }
74
+ nonceBytes = append (verifierNonce .Val , verifierNonce .Iat [:]... )
67
75
}
68
76
69
77
adapter , err := tdx .NewEvidenceAdapter (userDataBytes , nil )
@@ -75,6 +83,9 @@ func getQuote(cmd *cobra.Command) error {
75
83
return errors .Wrap (err , "Failed to collect evidence" )
76
84
}
77
85
78
- fmt .Fprintln (os .Stdout , evidence .Evidence )
86
+ fmt .Println ("Quote:" , base64 .StdEncoding .EncodeToString (evidence .Evidence ))
87
+ fmt .Println ("runtime_data:" , base64 .StdEncoding .EncodeToString (evidence .UserData ))
88
+ fmt .Println ("user_data:" , userData )
89
+
79
90
return nil
80
91
}
0 commit comments