Documentation
¶
Overview ¶
Package fdo implements FDO 1.1 protocol.
Many of the protocol types and values are located in the protocol subpackage. This domain package includes the core "entrypoint" types.
For client devices, DI is called, using an HMAC and private key, to generate a credential. After this, TO1 (unless using rendezvous bypass) and TO2 are called successively. When calling TO2, service info modules that the device is capable of performing are provided.
Device secrets (HMAC and private key) use interfaces from the Go standard library so there are many ways to generate and provide them. Two implementations are included in the library. [blob.DeviceCredential] stores secrets in a binary-encoded file and [tpm.DeviceCredential] uses unexportable keys secured inside a TPM 2.0.
For owner services, message handling protocol.Responder implementations are provided: DIServer, TO0Server, TO1Server, and TO2Server. These require state management.
There are a handful of state management interfaces to allow for combining backends. A practical example of this is that one may wish to store some state inside a JWT/CWT cookie, while more persistent state (lasts beyond a session) is stored in a SQL database. As an example implementation, [sqlite.DB] is provided in a separate, optional module, which runs SQLite inside a WASM runtime running as part of the same process.
The other type in this package is Voucher, which represents an FDO ownership voucher. It is not the direct input or output of either device or owner service protocols, since it is loaded/stored via the persistence interfaces. However, it is included for symmetry with DeviceCredential, as the anchor of trust (combined with the associated private key - same as device credential) on the opposite end of the device onboarding handshake.
Index ¶
- Constants
- Variables
- func TO1(ctx context.Context, transport Transport, cred DeviceCredential, ...) (*cose.Sign1[protocol.To1d, []byte], error)
- type AutoExtend
- type AutoTO0
- type DIConfig
- type DIServer
- type DISessionState
- type DeviceCredential
- type ErrUnsupportedKeyType
- type ManufacturerVoucherPersistentState
- type OwnerKeyPersistentState
- type OwnerVoucherPersistentState
- type RendezvousBlobPersistentState
- type TO0Client
- type TO0Server
- type TO0SessionState
- type TO1Options
- type TO1Server
- type TO1SessionState
- type TO2Config
- type TO2Server
- type TO2SessionState
- type Transport
- type Voucher
- func (v *Voucher) DevicePublicKey() (crypto.PublicKey, error)
- func (v *Voucher) OwnerPublicKey() (crypto.PublicKey, error)
- func (v *Voucher) VerifyCertChainHash() error
- func (v *Voucher) VerifyDeviceCertChain(roots *x509.CertPool) error
- func (v *Voucher) VerifyEntries() error
- func (v *Voucher) VerifyHeader(hmacSha256, hmacSha384 hash.Hash) error
- func (v *Voucher) VerifyManufacturerCertChain(roots *x509.CertPool) error
- func (v *Voucher) VerifyManufacturerKey(keyHash protocol.Hash) error
- type VoucherEntryPayload
- type VoucherHeader
Constants ¶
const DefaultRVBlobTTL = 4_294_967_295 // max uint32
DefaultRVBlobTTL is the default requested TTL for a rendezvous blob mapping.
Variables ¶
var ErrCryptoVerifyFailed = errors.New("cryptographic verification failed")
ErrCryptoVerifyFailed indicates that the wrapping error originated from a case of cryptographic verification failing rather than a broken invariant.
var ErrInvalidSession = fmt.Errorf("invalid session")
ErrInvalidSession is used when the token is invalid or the backend fails during validation.
var ErrNotFound = fmt.Errorf("not found")
ErrNotFound is used when the resource does not exist for the session.
Functions ¶
func TO1 ¶
func TO1(ctx context.Context, transport Transport, cred DeviceCredential, key crypto.Signer, opts *TO1Options) (*cose.Sign1[protocol.To1d, []byte], error)
TO1 runs the TO1 protocol and returns the owner service (TO2) addresses. It requires that a device credential, hmac secret, and key are all configured on the client.
Types ¶
type AutoExtend ¶
type AutoExtend interface { // ManufacturerKey returns the signer of a given key type and its certificate // chain (required). ManufacturerKey(keyType protocol.KeyType) (crypto.Signer, []*x509.Certificate, error) // OwnerKey returns the private key matching a given key type and optionally // its certificate chain. OwnerKey(keyType protocol.KeyType) (crypto.Signer, []*x509.Certificate, error) }
AutoExtend provides the necessary methods for automatically extending a device voucher upon the completion of DI.
type AutoTO0 ¶
type AutoTO0 interface { // OwnerKey returns the private key matching a given key type and optionally // its certificate chain. OwnerKey(keyType protocol.KeyType) (crypto.Signer, []*x509.Certificate, error) // SetRVBlob sets the owner rendezvous blob for a device. SetRVBlob(context.Context, *Voucher, *cose.Sign1[protocol.To1d, []byte], time.Time) error }
AutoTO0 provides the necessary methods for setting a rendezvous blob upon device voucher auto-extension.
type DIConfig ¶
type DIConfig struct { // HMAC-SHA256 with a device secret that does not change when ownership is // transferred. HMAC-SHA256 support is always required by spec, so this // field must be non-nil. // // This hash.Hash may optionally implement the following interface to // return errors from Reset/Write/Sum, noting that implementations of // hash.Hash are not supposed to return non-nil errors from Write. // // type FallibleHash interface { // Err() error // } HmacSha256 hash.Hash // HMAC-SHA384 with a device secret that does not change when ownership is // transferred. HMAC-SHA384 support is optional by spec, so this field may // be nil iff Key is RSA 2048 or EC P-256. // // This hash.Hash may optionally implement the following interface to // return errors from Reset/Write/Sum, noting that implementations of // hash.Hash are not supposed to return non-nil errors from Write. // // type FallibleHash interface { // Err() error // } HmacSha384 hash.Hash // An ECDSA or RSA private key Key crypto.Signer // When true and an RSA key is used as a crypto.Signer argument, RSA-SSAPSS // will be used for signing PSS bool }
DIConfig contains required device secrets and optional configuration.
type DIServer ¶
type DIServer[T any] struct { Session DISessionState Vouchers ManufacturerVoucherPersistentState // SignDeviceCertChain creates a device certificate chain based on info // provided in the DI.AppStart message. SignDeviceCertificate func(*T) ([]*x509.Certificate, error) // DeviceInfo returns the device info string to use for a given device, // based on its self-reported info and certificate chain. DeviceInfo func(context.Context, *T, []*x509.Certificate) (string, protocol.KeyType, protocol.KeyEncoding, error) // When set, new vouchers will be extended using the appropriate owner key. AutoExtend AutoExtend // When set, new vouchers will be registered for rendezvous. AutoTO0 AutoTO0 AutoTO0Addrs []protocol.RvTO2Addr // Rendezvous directives RvInfo func(context.Context, *Voucher) ([][]protocol.RvInstruction, error) }
DIServer implements the DI protocol.
type DISessionState ¶
type DISessionState interface { // SetDeviceCertChain sets the device certificate chain generated from // DI.AppStart info. SetDeviceCertChain(context.Context, []*x509.Certificate) error // DeviceCertChain gets a device certificate chain from the current // session. DeviceCertChain(context.Context) ([]*x509.Certificate, error) // SetIncompleteVoucherHeader stores an incomplete (missing HMAC) voucher // header tied to a session. SetIncompleteVoucherHeader(context.Context, *VoucherHeader) error // IncompleteVoucherHeader gets an incomplete (missing HMAC) voucher header // which has not yet been persisted. IncompleteVoucherHeader(context.Context) (*VoucherHeader, error) }
DISessionState stores DI protocol state for a particular session.
type DeviceCredential ¶
type DeviceCredential struct { Version uint16 DeviceInfo string GUID protocol.GUID RvInfo [][]protocol.RvInstruction PublicKeyHash protocol.Hash // expected to be a hash of the entire CBOR structure (not just pkBody) for Voucher.VerifyEntries to succeed }
DeviceCredential is non-normative, but the TPM Draft Spec proposes a CBOR encoding, so that will be used, excluding the key type/handle.
DCTPM = [ DCProtVer: protver, DCDeviceInfo: tstr, DCGuid: bstr DCRVInfo: RendezvousInfo, DCPubKeyHash: Hash DeviceKeyType: uint DeviceKeyHandle: uint ]
func DI ¶
DI runs the DI protocol and returns the voucher header and manufacturer public key hash. It requires that the client is configured with an HMAC secret, but not necessarily a key.
The device is identified to the manufacturing component by the ID string, which may be a device serial, MAC address, or similar. There is generally an expectation of network trust for DI.
The device certificate chain should be created before DI is performed, because the manufacturing component signs the ownership voucher, but isn't necessarily the root of trust for the device's identity and may or may not validate the device's presented certificate chain.
However, the Java server implementation expects a certificate signing request marshaled in the device info and performs certificate signing, so PKI and voucher signing duties may be simultaneously handled by the manufacturing component.
func TO2 ¶
func TO2(ctx context.Context, transport Transport, to1d *cose.Sign1[protocol.To1d, []byte], c TO2Config) (*DeviceCredential, error)
TO2 runs the TO2 protocol and returns a DeviceCredential with replaced GUID, rendezvous info, and owner public key. It requires that a device credential, hmac secret, and key are all provided as configuration.
A to1d signed blob is expected if rendezvous bypass is not used. This blob is output from TO1.
It has the side effect of performing service info modules, which may include actions such as downloading files.
If the Credential Reuse protocol is allowed and occurs, then the returned device credential will be nil.
type ErrUnsupportedKeyType ¶
ErrUnsupportedKeyType is used when no key of the given type has been added to the server.
func (ErrUnsupportedKeyType) Error ¶
func (err ErrUnsupportedKeyType) Error() string
type ManufacturerVoucherPersistentState ¶
type ManufacturerVoucherPersistentState interface { // NewVoucher creates and stores a voucher for a newly initialized device. // Note that the voucher may have entries if the server was configured for // auto voucher extension. NewVoucher(context.Context, *Voucher) error }
ManufacturerVoucherPersistentState maintains vouchers created during DI which have not yet been extended.
type OwnerKeyPersistentState ¶
type OwnerKeyPersistentState interface { // OwnerKey returns the private key matching a given key type and optionally // its certificate chain. OwnerKey(protocol.KeyType) (crypto.Signer, []*x509.Certificate, error) }
OwnerKeyPersistentState maintains the owner service keys.
type OwnerVoucherPersistentState ¶
type OwnerVoucherPersistentState interface { // AddVoucher stores the voucher of a device owned by the service. AddVoucher(context.Context, *Voucher) error // ReplaceVoucher stores a new voucher, possibly deleting or marking the // previous voucher as replaced. ReplaceVoucher(context.Context, protocol.GUID, *Voucher) error // RemoveVoucher untracks a voucher, possibly by deleting it or marking it // as removed, and returns it for extension. RemoveVoucher(context.Context, protocol.GUID) (*Voucher, error) // Voucher retrieves a voucher by GUID. Voucher(context.Context, protocol.GUID) (*Voucher, error) }
OwnerVoucherPersistentState maintains vouchers owned by the service.
type RendezvousBlobPersistentState ¶
type RendezvousBlobPersistentState interface { // SetRVBlob sets the owner rendezvous blob for a device. SetRVBlob(context.Context, *Voucher, *cose.Sign1[protocol.To1d, []byte], time.Time) error // RVBlob returns the owner rendezvous blob for a device. RVBlob(context.Context, protocol.GUID) (*cose.Sign1[protocol.To1d, []byte], *Voucher, error) }
RendezvousBlobPersistentState maintains device to owner info state used in TO0 and TO1.
type TO0Client ¶
type TO0Client struct { // Vouchers is used to lookup the ownership voucher for registering a // rendezvous blob for a given device. Vouchers OwnerVoucherPersistentState // OwnerKeys are used for signing the rendezvous blob. OwnerKeys OwnerKeyPersistentState // TTL is the amount of time to recommend that the Rendezvous Server allows // the rendezvous blob mapping to remain active. // // If TTL is 0, [DefaultRVBlobTTL] will be used. TTL uint32 }
TO0Client is used by owner services communicating with rendezvous services. Unlike [DOClient], it is not used by devices.
func (*TO0Client) RegisterBlob ¶
func (c *TO0Client) RegisterBlob(ctx context.Context, transport Transport, guid protocol.GUID, addrs []protocol.RvTO2Addr) (uint32, error)
RegisterBlob tells a Rendezvous Server where to direct a given device to its owner service for onboarding. The returned uint32 is the number of seconds before the rendezvous blob must be refreshed by calling [RegisterBlob] again.
type TO0Server ¶
type TO0Server struct { Session TO0SessionState RVBlobs RendezvousBlobPersistentState // AcceptVoucher is an optional function which, when given, is used to // determine whether to accept a voucher from a client. // // If AcceptVoucher is not set, then all vouchers will be accepted. It is // expected that some other means of authorization is used in this case. AcceptVoucher func(context.Context, Voucher) (accept bool, err error) // NegotiateTTL is an optional function to select a validity period for a // rendezvous blob based on the requested number of seconds and the // ownership voucher contents. // // If NegotiateTTL is not set, the requested TTL will be used. NegotiateTTL func(requestedSeconds uint32, ov Voucher) (waitSeconds uint32) }
TO0Server implements the TO0 protocol.
type TO0SessionState ¶
type TO0SessionState interface { // SetTO0SignNonce sets the Nonce expected in TO0.OwnerSign. SetTO0SignNonce(context.Context, protocol.Nonce) error // TO0SignNonce returns the Nonce expected in TO0.OwnerSign. TO0SignNonce(context.Context) (protocol.Nonce, error) }
TO0SessionState stores TO0 protocol state for a particular session.
type TO1Options ¶
type TO1Options struct { // When true and an RSA key is used as a crypto.Signer argument, RSA-SSAPSS // will be used for signing. PSS bool }
TO1Options contains optional configuration values.
type TO1Server ¶
type TO1Server struct { Session TO1SessionState RVBlobs RendezvousBlobPersistentState }
TO1Server implements the TO1 protocol.
type TO1SessionState ¶
type TO1SessionState interface { // SetTO1ProofNonce sets the Nonce expected in TO1.ProveToRV. SetTO1ProofNonce(context.Context, protocol.Nonce) error // TO1ProofNonce returns the Nonce expected in TO1.ProveToRV. TO1ProofNonce(context.Context) (protocol.Nonce, error) }
TO1SessionState stores TO1 protocol state for a particular session.
type TO2Config ¶
type TO2Config struct { // Non-secret device credential data. Cred DeviceCredential // HMAC-SHA256 with a device secret that does not change when ownership is // transferred. HMAC-SHA256 support is always required by spec, so this // field must be non-nil. // // This hash.Hash may optionally implement the following interface to // return errors from Reset/Write/Sum, noting that implementations of // hash.Hash are not supposed to return non-nil errors from Write. // // type FallibleHash interface { // Err() error // } HmacSha256 hash.Hash // HMAC-SHA384 with a device secret that does not change when ownership is // transferred. HMAC-SHA384 support is optional by spec, so this field may // be nil iff Key is RSA 2048 or EC P-256. // // This hash.Hash may optionally implement the following interface to // return errors from Reset/Write/Sum, noting that implementations of // hash.Hash are not supposed to return non-nil errors from Write. // // type FallibleHash interface { // Err() error // } HmacSha384 hash.Hash // An ECDSA or RSA private key that may or may not be implemented with the // stdlib ecdsa and rsa packages. Key crypto.Signer // When true and an RSA key is used as a crypto.Signer argument, RSA-SSAPSS // will be used for signing. PSS bool // Devmod contains all required and any number of optional messages. // // Alternatively to setting this field, a devmod module may be provided in // the arguments to TransferOwnership2 where the module must provide any // devmod messages EXCEPT nummodules and modules via its Yield method. // // Note: The device plugin will be yielded to exactly once and is expected // to provide all required and desired fields and yield. It may then exit. Devmod serviceinfo.Devmod // Each ServiceInfo module will be reported in devmod and potentially // activated and used. If a devmod module is included in this list, it // overrides the Devmod field in TO2Config. The custom devmod should not // send nummodules or modules messages, as these will always be sent upon // module completion. DeviceModules map[string]serviceinfo.DeviceModule // Selects the key exchange suite to use. If unset, it defaults to ECDH384. KeyExchange kex.Suite // Selects the cipher suite to use for encryption. If unset, it defaults to // A256GCM. CipherSuite kex.CipherSuiteID // Maximum transmission unit (MTU) to tell owner service to send with. If // zero, the default of 1300 will be used. The value chosen can make a // difference for performance when using service info to exchange large // amounts of data, but choosing the best value depends on network // configuration (e.g. jumbo packets) and transport (overhead size). MaxServiceInfoSizeReceive uint16 // Allow for the Credential Reuse Protocol (Section 7) to be used. If not // enabled, TO2 will fail with CredReuseErrCode (102) if reuse is // attempted by the owner service. AllowCredentialReuse bool }
TO2Config contains the device credential, including secrets and keys, optional configuration, and service info modules.
type TO2Server ¶
type TO2Server struct { Session TO2SessionState Vouchers OwnerVoucherPersistentState OwnerKeys OwnerKeyPersistentState // Choose the replacement rendezvous directives based on the current // voucher of the onboarding device. RvInfo func(context.Context, Voucher) ([][]protocol.RvInstruction, error) // Create an iterator of service info modules for a given device. The // iterator returns the name of the module and its implementation. OwnerModules func(ctx context.Context, replacementGUID protocol.GUID, info string, chain []*x509.Certificate, devmod serviceinfo.Devmod, modules []string) iter.Seq2[string, serviceinfo.OwnerModule] // ReuseCredential, if not nil, will be called to determine whether to // apply the Credential Reuse Protocol based on the current voucher of an // onboarding device. ReuseCredential func(context.Context, Voucher) bool // VerifyVoucher, if not nil, will be called before creating and responding // with a TO2.ProveOVHdr message. Any error will cause TO2 to fail with a // not found status code. // // If VerifyVoucher is nil, the default behavior is to reject all vouchers // with zero extensions. VerifyVoucher func(context.Context, Voucher) error // Optional configuration MaxDeviceServiceInfoSize uint16 // contains filtered or unexported fields }
TO2Server implements the TO2 protocol.
func (*TO2Server) CryptSession ¶
CryptSession returns the current encryption session.
func (*TO2Server) Resell ¶
func (s *TO2Server) Resell(ctx context.Context, guid protocol.GUID, nextOwner crypto.PublicKey, extra map[int][]byte) (*Voucher, error)
Resell implements the FDO Resale Protocol by removing a voucher from ownership, extending it to a new owner, and then returning it for out-of-band transport.
type TO2SessionState ¶
type TO2SessionState interface { // SetGUID associates a voucher GUID with a TO2 session. SetGUID(context.Context, protocol.GUID) error // GUID retrieves the GUID of the voucher associated with the session. GUID(context.Context) (protocol.GUID, error) // SetRvInfo stores the rendezvous instructions to store at the end of TO2. SetRvInfo(context.Context, [][]protocol.RvInstruction) error // RvInfo retrieves the rendezvous instructions to store at the end of TO2. RvInfo(context.Context) ([][]protocol.RvInstruction, error) // SetReplacementGUID stores the device GUID to persist at the end of TO2. SetReplacementGUID(context.Context, protocol.GUID) error // ReplacementGUID retrieves the device GUID to persist at the end of TO2. ReplacementGUID(context.Context) (protocol.GUID, error) // SetReplacementHmac stores the voucher HMAC to persist at the end of TO2. SetReplacementHmac(context.Context, protocol.Hmac) error // ReplacementHmac retrieves the voucher HMAC to persist at the end of TO2. ReplacementHmac(context.Context) (protocol.Hmac, error) // SetXSession updates the current key exchange/encryption session based on // an opaque "authorization" token. // // The Session value is not safe to use after the function returns. SetXSession(context.Context, kex.Suite, kex.Session) error // XSession returns the current key exchange/encryption session based on an // opaque "authorization" token. XSession(context.Context) (kex.Suite, kex.Session, error) // SetProveDeviceNonce stores the Nonce used in TO2.ProveDevice for use in // TO2.Done. SetProveDeviceNonce(context.Context, protocol.Nonce) error // ProveDeviceNonce returns the Nonce used in TO2.ProveDevice and TO2.Done. ProveDeviceNonce(context.Context) (protocol.Nonce, error) // SetSetupDeviceNonce stores the Nonce used in TO2.SetupDevice for use in // TO2.Done2. SetSetupDeviceNonce(context.Context, protocol.Nonce) error // SetupDeviceNonce returns the Nonce used in TO2.SetupDevice and // TO2.Done2. SetupDeviceNonce(context.Context) (protocol.Nonce, error) // SetMTU sets the max service info size the device may receive. SetMTU(context.Context, uint16) error // MTU returns the max service info size the device may receive. MTU(context.Context) (uint16, error) }
TO2SessionState stores TO2 protocol state for a particular session.
type Transport ¶
type Transport interface { // Send a message and receive a response. The response reader should always // be closed. Send(ctx context.Context, msgType uint8, msg any, sess kex.Session) (respType uint8, _ io.ReadCloser, _ error) }
Transport abstracts the underlying TCP/HTTP/CoAP transport for sending a message and receiving a response.
type Voucher ¶
type Voucher struct { Version uint16 Header cbor.Bstr[VoucherHeader] Hmac protocol.Hmac CertChain *[]*cbor.X509Certificate Entries []cose.Sign1Tag[VoucherEntryPayload, []byte] }
Voucher is the top level structure.
OwnershipVoucher = [ OVProtVer: protver, ;; protocol version OVHeaderTag: bstr .cbor OVHeader, OVHeaderHMac: HMac, ;; hmac[DCHmacSecret, OVHeader] OVDevCertChain: OVDevCertChainOrNull, OVEntryArray: OVEntries ] ;; Device certificate chain ;; use null for Intel® EPID. OVDevCertChainOrNull = X5CHAIN / null ;; CBOR null for Intel® EPID device key ;; Ownership voucher entries array OVEntries = [ * OVEntry ]
func ExtendVoucher ¶
func ExtendVoucher[T protocol.PublicKeyOrChain](v *Voucher, owner crypto.Signer, nextOwner T, extra map[int][]byte) (*Voucher, error)
ExtendVoucher adds a new signed voucher entry to the list and returns the new extended voucher. Vouchers should be treated as immutable structures.
ExtraInfo may be used to pass additional supply-chain information along with the Ownership Voucher. The Device implicitly verifies the plaintext of OVEExtra along with the verification of the Ownership Voucher. An Owner which trusts the Device' verification of the Ownership Voucher may also choose to trust OVEExtra.
func (*Voucher) DevicePublicKey ¶
DevicePublicKey extracts the device's public key from from the certificate chain. Before calling this method, the voucher must be fully verified. For certain key types, such as Intel EPID, the public key will be nil.
func (*Voucher) OwnerPublicKey ¶
OwnerPublicKey extracts the voucher owner's public key from either the header or the entries list.
func (*Voucher) VerifyCertChainHash ¶
VerifyCertChainHash uses the hash in the voucher header to verify that the certificate chain of the voucher has not been tampered with. This method should therefore not be called before VerifyHeader.
func (*Voucher) VerifyDeviceCertChain ¶
VerifyDeviceCertChain using trusted roots. If roots is nil then the last certificate in the chain will be implicitly trusted.
func (*Voucher) VerifyEntries ¶
VerifyEntries checks the chain of signatures on each voucher entry payload.
func (*Voucher) VerifyHeader ¶
VerifyHeader checks that the OVHeader was not modified by comparing the HMAC generated using the secret from the device credentials.
func (*Voucher) VerifyManufacturerCertChain ¶
VerifyManufacturerCertChain using trusted roots. If roots is nil then the last certificate in the chain will be implicitly trusted.
If the manufacturer public key is X509 encoded rather than X5Chain, then this method will fail if a non-nil root certificate pool is given.
type VoucherEntryPayload ¶
type VoucherEntryPayload struct { PreviousHash protocol.Hash HeaderHash protocol.Hash Extra *cbor.Bstr[map[int][]byte] PublicKey protocol.PublicKey }
VoucherEntryPayload is an entry in a voucher's list of recorded transfers.
;; ...each entry is a COSE Sign1 object with a payload OVEntry = CoseSignature $COSEProtectedHeaders //= (
1: OVSignType
) $COSEPayloads /= (
OVEntryPayload
) ;; ... each payload contains the hash of the previous entry ;; and the signature of the public key to verify the next signature ;; (or the Owner, in the last entry). OVEntryPayload = [
OVEHashPrevEntry: Hash, OVEHashHdrInfo: Hash, ;; hash[GUID||DeviceInfo] in header OVEExtra: null / bstr .cbor OVEExtraInfo OVEPubKey: PublicKey
]
OVEExtraInfo = { * OVEExtraInfoType: bstr } OVEExtraInfoType = int
;;OVSignType = Supporting COSE signature types
func (*VoucherEntryPayload) VerifyOwnerCertChain ¶
func (e *VoucherEntryPayload) VerifyOwnerCertChain(roots *x509.CertPool) error
VerifyOwnerCertChain validates the certificate chain of the owner public key using trusted roots. If roots is nil then the last certificate in the chain will be implicitly trusted. If the public key is X509 encoded rather than X5Chain, then this method will fail if a non-nil root certificate pool is given.
type VoucherHeader ¶
type VoucherHeader struct { Version uint16 GUID protocol.GUID RvInfo [][]protocol.RvInstruction DeviceInfo string ManufacturerKey protocol.PublicKey CertChainHash *protocol.Hash }
VoucherHeader is the Ownership Voucher header, also used in TO1 protocol.
OVHeader = [ OVHProtVer: protver, ;; protocol version OVGuid: Guid, ;; guid OVRVInfo: RendezvousInfo, ;; rendezvous instructions OVDeviceInfo: tstr, ;; DeviceInfo OVPubKey: PublicKey, ;; mfg public key OVDevCertChainHash:OVDevCertChainHashOrNull ] ;; Hash of Device certificate chain ;; use null for Intel® EPID OVDevCertChainHashOrNull = Hash / null ;; CBOR null for Intel® EPID device key
func (*VoucherHeader) Equal ¶
func (ovh *VoucherHeader) Equal(otherOVH *VoucherHeader) bool
Equal compares two ownership voucher headers for equality.
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
Package blob implements a device credential that may be stored to disk as a marshaled blob.
|
Package blob implements a device credential that may be stored to disk as a marshaled blob. |
Package cbor implements a basic encoding/decoding API for RFC 8949 Concise Binary Object Representation (CBOR).
|
Package cbor implements a basic encoding/decoding API for RFC 8949 Concise Binary Object Representation (CBOR). |
cdn
Package cdn implements CBOR Diagnotic Notation.
|
Package cdn implements CBOR Diagnotic Notation. |
Package cose implements CBOR Object Signing and Encryption (COSE) defined in RFC8152.
|
Package cose implements CBOR Object Signing and Encryption (COSE) defined in RFC8152. |
Package custom implements non-normative types and functions for DI.
|
Package custom implements non-normative types and functions for DI. |
examples
module
|
|
Package fdotest contains test harnesses for the main fdo package.
|
Package fdotest contains test harnesses for the main fdo package. |
internal
Package internal includes internal test helpers.
|
Package internal includes internal test helpers. |
internal/memory
Package memory implements server state using non-persistent memory to complement internal/token.Service for state that must persist between protocol sessions.
|
Package memory implements server state using non-persistent memory to complement internal/token.Service for state that must persist between protocol sessions. |
internal/token
Package token implements all server state interfaces possible using a stateless token.
|
Package token implements all server state interfaces possible using a stateless token. |
fsim
module
|
|
Package http implements FDO transport interfaces using an HTTP protocol.
|
Package http implements FDO transport interfaces using an HTTP protocol. |
internal/httputil
Package httputil implements APIs misssing from the TinyGo stdlib.
|
Package httputil implements APIs misssing from the TinyGo stdlib. |
internal
|
|
build
Package build is used to hold code related to build tags.
|
Package build is used to hold code related to build tags. |
nistkdf
Package nistkdf implements a NIST 800-108 KDF using the parameters defined in FDO.
|
Package nistkdf implements a NIST 800-108 KDF using the parameters defined in FDO. |
Package kex implements the Key Exchange subprotocol of FDO.
|
Package kex implements the Key Exchange subprotocol of FDO. |
Package plugin defines a line-based protocol and implements service info device and owner module adapters to plugins communicating over a reader- writer pair.
|
Package plugin defines a line-based protocol and implements service info device and owner module adapters to plugins communicating over a reader- writer pair. |
Package protocol contains common protocol-related types and values.
|
Package protocol contains common protocol-related types and values. |
Package serviceinfo handles FDO Service Info and Service Info Modules.
|
Package serviceinfo handles FDO Service Info and Service Info Modules. |
sqlite
module
|
|
tpm
module
|