Giter VIP home page Giter VIP logo

Comments (5)

twitchy-jsonp avatar twitchy-jsonp commented on July 28, 2024
// EKCertVerifier checks that EK certificates chain up to a set of intermediates
// and root certificates.
type EKCertVerifier struct {
  roots, intermediates *x509.CertPool
}

// NewEKCertVerifier builds an EKCertVerifier object from the given set
// of root & intermediate certificates.
func NewEKCertVerifier(roots, intermediates []byte) (*EKCertVerifier, error) {
  // parse certs --> respective cert pools
}

// Verify checks the EK cert chains up to a known set of root & intermediate
// certificates.
func (v *EKCertVerifier) Verify(cert []byte) (chains [][]*x509.Certificate, err error) {
  // ...
}

@ericchiang WDYT?

from go-attestation.

ericchiang avatar ericchiang commented on July 28, 2024

This functionality is already available via "crypto/x509".Certificate.Verify https://golang.org/pkg/crypto/x509/#Certificate.Verify

I don't see the benefit of adding duplicate API here. Would this be better as documentation?

from go-attestation.

twitchy-jsonp avatar twitchy-jsonp commented on July 28, 2024

We could get away with documentation if we specify:

  • Youre gonna need to use the cert-transparency x509 package
  • Set cert.UnhandledCriticalExtensions to nil in the EKCert before verifying
  • Set VerifyOptions.KeyUsages to []x509.ExtKeyUsage{x509.ExtKeyUsageAny}

from go-attestation.

ericchiang avatar ericchiang commented on July 28, 2024

sgtm

I think that'd be a good place to start anyway. We should also document why you need to use cert-transparency x509, and why UnhandledCriticalExtensions has to be set to nil. Ideally, we'd actually parse those extensions in the future too.

I feel like it might be reasonable to add a higher level API, expressing different trust models: https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/tpm-key-attestation#BKMK_DeploymentOverview

But I think it'd be good to prototype that outside of attest, see what works and what doesn't, then propose the API here.

from go-attestation.

brandonweeks avatar brandonweeks commented on July 28, 2024

Do we not want to bundle the canonical trusted TPM roots?

https://go.microsoft.com/fwlink/?linkid=2097925

from go-attestation.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.