Skip to content

Commit

Permalink
Merge pull request #43 from Ruoyu-y/enhance_go
Browse files Browse the repository at this point in the history
  • Loading branch information
wenhuizhang authored Apr 22, 2024
2 parents bcc11dc + f75cdd0 commit 287d71c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/golang/cctrusted_vm/cvm.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ func (d *GenericDevice) Report(nonce, userData string, extraArgs map[string]any)
return cctrusted_base.CcReport{}, errors.New("Failed to get generation info.")
}
generation, _ = strconv.Atoi(string(rawGeneration))
// Check if the outblob has been corrupted during file open
if generation > 1 {
return cctrusted_base.CcReport{}, errors.New("Found corrupted generation.")
}
}

if _, err = os.Stat(filepath.Join(tempdir, "provider")); !os.IsNotExist(err) {
Expand Down

0 comments on commit 287d71c

Please sign in to comment.