Skip to content

Commit

Permalink
only support Azure for JSON output
Browse files Browse the repository at this point in the history
  • Loading branch information
elchead committed Oct 6, 2023
1 parent ca829c3 commit 53095b8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions cli/internal/cmd/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,10 +291,13 @@ type jsonAttestationDocFormatter struct {
}

// format returns the raw or formatted attestation doc depending on the rawOutput argument.
func (f *jsonAttestationDocFormatter) format(ctx context.Context, docString string, _ bool,
func (f *jsonAttestationDocFormatter) format(ctx context.Context, docString string, PCRsOnly bool,
_ bool, _ measurements.M, attestationServiceURL string,
) (string, error) {
instanceInfo, err := extractInstanceInfo(docString)
if PCRsOnly {
return "", fmt.Errorf("JSON output is currently only supported for Azure")
}
instanceInfo, err := extractAzureInstanceInfo(docString)
if err != nil {
return "", fmt.Errorf("unmarshal instance info: %w", err)
}
Expand Down Expand Up @@ -840,7 +843,7 @@ func newTCBVersion(tcbVersion kds.TCBVersion) (res verify.TCBVersion) {
}
}

func extractInstanceInfo(docString string) (azureInstanceInfo, error) {
func extractAzureInstanceInfo(docString string) (azureInstanceInfo, error) {
var doc attestationDoc
if err := json.Unmarshal([]byte(docString), &doc); err != nil {
return azureInstanceInfo{}, fmt.Errorf("unmarshal attestation document: %w", err)
Expand Down

0 comments on commit 53095b8

Please sign in to comment.