mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-08-07 06:22:17 -04:00
monorepo
Co-authored-by: Malte Poll <mp@edgeless.systems> Co-authored-by: katexochen <katexochen@users.noreply.github.com> Co-authored-by: Daniel Weiße <dw@edgeless.systems> Co-authored-by: Thomas Tendyck <tt@edgeless.systems> Co-authored-by: Benedict Schlueter <bs@edgeless.systems> Co-authored-by: leongross <leon.gross@rub.de> Co-authored-by: Moritz Eckert <m1gh7ym0@gmail.com>
This commit is contained in:
commit
2d8fcd9bf4
362 changed files with 50980 additions and 0 deletions
40
cli/cmd/verify_gcp_noncvm.go
Normal file
40
cli/cmd/verify_gcp_noncvm.go
Normal file
|
@ -0,0 +1,40 @@
|
|||
package cmd
|
||||
|
||||
import (
|
||||
"github.com/edgelesssys/constellation/coordinator/atls"
|
||||
"github.com/edgelesssys/constellation/coordinator/attestation/gcp"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
// TODO: Remove this command once we no longer use non cvms.
|
||||
func newVerifyGCPNonCVMCmd() *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "gcp-non-cvm IP PORT",
|
||||
Short: "Verify the TPM attestation of your shielded VM Constellation on Google Cloud Platform.",
|
||||
Long: "Verify the TPM attestation of your shielded VM Constellation on Google Cloud Platform.",
|
||||
Args: cobra.ExactArgs(2),
|
||||
ValidArgsFunction: verifyCompletion,
|
||||
RunE: runVerifyGCPNonCVM,
|
||||
}
|
||||
|
||||
return cmd
|
||||
}
|
||||
|
||||
func runVerifyGCPNonCVM(cmd *cobra.Command, args []string) error {
|
||||
pcrs := map[uint32][]byte{}
|
||||
validator, err := getGCPNonCVMValidator(cmd, pcrs)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return runVerify(cmd, args, pcrs, validator)
|
||||
}
|
||||
|
||||
// getGCPNonCVMValidator returns a GCP validator for regular shielded VMs.
|
||||
func getGCPNonCVMValidator(cmd *cobra.Command, pcrs map[uint32][]byte) (atls.Validator, error) {
|
||||
if err := prepareValidator(cmd, pcrs); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return gcp.NewNonCVMValidator(pcrs), nil
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue