2022-09-05 03:06:08 -04:00
|
|
|
/*
|
|
|
|
Copyright (c) Edgeless Systems GmbH
|
|
|
|
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
*/
|
|
|
|
|
2022-03-22 11:03:15 -04:00
|
|
|
package azure
|
|
|
|
|
|
|
|
import (
|
2022-08-31 14:10:49 -04:00
|
|
|
"github.com/edgelesssys/constellation/internal/atls"
|
|
|
|
"github.com/edgelesssys/constellation/internal/attestation/azure/snp"
|
|
|
|
"github.com/edgelesssys/constellation/internal/attestation/azure/trustedlaunch"
|
2022-06-01 09:08:42 -04:00
|
|
|
"github.com/edgelesssys/constellation/internal/attestation/vtpm"
|
2022-03-22 11:03:15 -04:00
|
|
|
)
|
|
|
|
|
2022-08-31 14:10:49 -04:00
|
|
|
// NewIssuer returns an SNP issuer if it can successfully read the idkeydigest from the TPM.
|
|
|
|
// Otherwise returns a Trusted Launch issuer.
|
|
|
|
func NewIssuer() atls.Issuer {
|
|
|
|
if _, err := snp.GetIdKeyDigest(vtpm.OpenVTPM); err == nil {
|
|
|
|
return snp.NewIssuer()
|
|
|
|
} else {
|
|
|
|
return trustedlaunch.NewIssuer()
|
2022-08-19 06:26:29 -04:00
|
|
|
}
|
|
|
|
}
|