Skip to content

Commit

Permalink
print measurements individually as hex
Browse files Browse the repository at this point in the history
  • Loading branch information
miampf committed Mar 20, 2024
1 parent b68a995 commit dd698e2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cli/internal/cmd/configfetchmeasurements.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"net/http"
"net/url"
"time"
"encoding/hex"

"github.com/edgelesssys/constellation/v2/internal/api/attestationconfigapi"
"github.com/edgelesssys/constellation/v2/internal/api/versionsapi"
Expand Down Expand Up @@ -157,7 +158,11 @@ func (cfm *configFetchMeasurementsCmd) configFetchMeasurements(
return fmt.Errorf("fetching and verifying measurements: %w", err)
}
}
cfm.log.Debug(fmt.Sprintf("Measurements: %#v\n", fetchedMeasurements))
measurementsToPrint := "";
for i, measurement := range fetchedMeasurements {
measurementsToPrint += fmt.Sprintf("\t%d: 0x%s\n", i, hex.EncodeToString(measurement.Expected))
}
cfm.log.Debug(fmt.Sprintf("Measurements:\n%s", measurementsToPrint))

cfm.log.Debug("Updating measurements in configuration")
conf.UpdateMeasurements(fetchedMeasurements)
Expand Down

0 comments on commit dd698e2

Please sign in to comment.