Documentation
¶
Index ¶
- Constants
- Variables
- func AuthenticatorHashTLS13(cipherSuite uint16) (crypto.Hash, error)
- func CreateAuthenticator(st *tls.ConnectionState, role Role, req *AuthenticatorRequest, ...) ([]byte, error)
- func CreateAuthenticatorWithPolicy(st *tls.ConnectionState, role Role, req *AuthenticatorRequest, ...) ([]byte, error)
- func ExportFinishedKey(st *tls.ConnectionState, role Role) ([]byte, crypto.Hash, error)
- func ExportHandshakeContext(st *tls.ConnectionState, role Role) ([]byte, crypto.Hash, error)
- func ExtractCMWAttestationFromExtensions(exts []Extension) ([]byte, bool, error)
- func MarshalExtensions(exts []Extension) ([]byte, error)
- func MarshalHandshakeMessage(m HandshakeMessage) ([]byte, error)
- func NewRandomContext(n int) ([]byte, error)
- func PolicyPermitsCertificateExtension(policy *SpontaneousAuthenticatorPolicy, typ uint16) bool
- func RequestPermitsCertificateExtension(req *AuthenticatorRequest, typ uint16) bool
- func ValidateCMWAttestationPlacement(entries []CertificateEntry) error
- type AuthenticatorRequest
- func (r AuthenticatorRequest) CertificateAuthorities() ([][]byte, bool)
- func (r AuthenticatorRequest) Marshal() ([]byte, error)
- func (r AuthenticatorRequest) OIDFilters() ([]OIDFilter, bool)
- func (r AuthenticatorRequest) SignatureSchemes() ([]uint16, bool)
- func (r AuthenticatorRequest) SignatureSchemesCert() ([]uint16, bool)
- type CertificateEntry
- type CertificateMessage
- type CertificateVerifyMessage
- type Extension
- func CMWAttestationDataExtension(cmw []byte) (Extension, error)
- func CMWAttestationOfferExtension() Extension
- func SignatureAlgorithmsCertExtension(schemes []uint16) (Extension, error)
- func SignatureAlgorithmsExtension(schemes []uint16) (Extension, error)
- func UnmarshalExtensions(b []byte) (exts []Extension, rest []byte, err error)
- type FinishedMessage
- type HandshakeMessage
- type OIDFilter
- type Role
- type Session
- func (s *Session) CreateAuthenticator(st *tls.ConnectionState, role Role, req *AuthenticatorRequest, ...) ([]byte, error)
- func (s *Session) CreateAuthenticatorWithPolicy(st *tls.ConnectionState, role Role, req *AuthenticatorRequest, ...) ([]byte, error)
- func (s *Session) MarkContextUsed(ctx []byte) error
- func (s *Session) ValidateAuthenticator(st *tls.ConnectionState, role Role, req *AuthenticatorRequest, ...) (*ValidationResult, error)
- func (s *Session) ValidateAuthenticatorWithAttestation(st *tls.ConnectionState, role Role, req *AuthenticatorRequest, ...) (*ValidationResult, error)
- func (s *Session) ValidateAuthenticatorWithPolicies(st *tls.ConnectionState, role Role, req *AuthenticatorRequest, ...) (*ValidationResult, error)
- func (s *Session) ValidateAuthenticatorWithPolicy(st *tls.ConnectionState, role Role, req *AuthenticatorRequest, ...) (*ValidationResult, error)
- type SpontaneousAuthenticatorPolicy
- type ValidationResult
- func ValidateAuthenticator(st *tls.ConnectionState, role Role, req *AuthenticatorRequest, ...) (*ValidationResult, error)
- func ValidateAuthenticatorWithAttestation(st *tls.ConnectionState, role Role, req *AuthenticatorRequest, ...) (*ValidationResult, error)
- func ValidateAuthenticatorWithPolicies(st *tls.ConnectionState, role Role, req *AuthenticatorRequest, ...) (*ValidationResult, error)
- func ValidateAuthenticatorWithPolicy(st *tls.ConnectionState, role Role, req *AuthenticatorRequest, ...) (*ValidationResult, error)
Constants ¶
View Source
const ( LabelClientAuthenticatorHandshakeContext = "EXPORTER-client authenticator handshake context" LabelServerAuthenticatorHandshakeContext = "EXPORTER-server authenticator handshake context" LabelClientAuthenticatorFinishedKey = "EXPORTER-client authenticator finished key" LabelServerAuthenticatorFinishedKey = "EXPORTER-server authenticator finished key" )
View Source
const ( HandshakeTypeCertificate uint8 = 11 HandshakeTypeCertificateRequest uint8 = 13 HandshakeTypeCertificateVerify uint8 = 15 HandshakeTypeClientCertificateRequest uint8 = 17 HandshakeTypeFinished uint8 = 20 )
View Source
const ( SignatureAlgorithmsExtensionType uint16 = 0x000d ServerNameExtensionType uint16 = 0x0000 CertificateAuthoritiesExtensionType uint16 = 0x002f OIDFiltersExtensionType uint16 = 0x0030 SignatureAlgorithmsCertExtensionType uint16 = 0x0032 )
View Source
const CMWAttestationExtensionType uint16 = 0xFF00
Variables ¶
View Source
var ( ErrTruncated = errors.New("ea: truncated input") ErrInvalidLength = errors.New("ea: invalid length") ErrUnsupportedHandshakeType = errors.New("ea: unsupported handshake type") ErrNotTLS13 = errors.New("ea: not TLS 1.3") ErrUnknownCipherSuite = errors.New("ea: unknown cipher suite") ErrContextReuse = errors.New("ea: certificate_request_context already used") ErrInvalidRole = errors.New("ea: invalid authenticator role") ErrUnsupportedSignatureScheme = errors.New("ea: unsupported signature scheme") ErrSignatureMismatch = errors.New("ea: CertificateVerify signature mismatch") ErrFinishedMismatch = errors.New("ea: Finished MAC mismatch") ErrContextMismatch = errors.New("ea: certificate_request_context mismatch") ErrBadRequest = errors.New("ea: bad authenticator request") )
Functions ¶
func CreateAuthenticator ¶
func CreateAuthenticator(st *tls.ConnectionState, role Role, req *AuthenticatorRequest, identity tls.Certificate, leafEntryExtensions []Extension) ([]byte, error)
func CreateAuthenticatorWithPolicy ¶
func CreateAuthenticatorWithPolicy(st *tls.ConnectionState, role Role, req *AuthenticatorRequest, policy *SpontaneousAuthenticatorPolicy, identity tls.Certificate, leafEntryExtensions []Extension) ([]byte, error)
func ExportFinishedKey ¶
func ExportHandshakeContext ¶
func MarshalExtensions ¶
func MarshalHandshakeMessage ¶
func MarshalHandshakeMessage(m HandshakeMessage) ([]byte, error)
func NewRandomContext ¶
func PolicyPermitsCertificateExtension ¶
func PolicyPermitsCertificateExtension(policy *SpontaneousAuthenticatorPolicy, typ uint16) bool
func RequestPermitsCertificateExtension ¶
func RequestPermitsCertificateExtension(req *AuthenticatorRequest, typ uint16) bool
func ValidateCMWAttestationPlacement ¶
func ValidateCMWAttestationPlacement(entries []CertificateEntry) error
Types ¶
type AuthenticatorRequest ¶
func UnmarshalAuthenticatorRequest ¶
func UnmarshalAuthenticatorRequest(handshakeBytes []byte) (AuthenticatorRequest, []byte, error)
func (AuthenticatorRequest) CertificateAuthorities ¶
func (r AuthenticatorRequest) CertificateAuthorities() ([][]byte, bool)
func (AuthenticatorRequest) Marshal ¶
func (r AuthenticatorRequest) Marshal() ([]byte, error)
func (AuthenticatorRequest) OIDFilters ¶
func (r AuthenticatorRequest) OIDFilters() ([]OIDFilter, bool)
func (AuthenticatorRequest) SignatureSchemes ¶
func (r AuthenticatorRequest) SignatureSchemes() ([]uint16, bool)
func (AuthenticatorRequest) SignatureSchemesCert ¶
func (r AuthenticatorRequest) SignatureSchemesCert() ([]uint16, bool)
type CertificateEntry ¶
type CertificateMessage ¶
type CertificateMessage struct {
Context []byte
Entries []CertificateEntry
}
func UnmarshalCertificateMessage ¶
func UnmarshalCertificateMessage(handshakeBytes []byte) (CertificateMessage, []byte, error)
func (CertificateMessage) Marshal ¶
func (m CertificateMessage) Marshal() ([]byte, error)
type CertificateVerifyMessage ¶
func UnmarshalCertificateVerifyMessage ¶
func UnmarshalCertificateVerifyMessage(handshakeBytes []byte) (CertificateVerifyMessage, []byte, error)
func (CertificateVerifyMessage) Marshal ¶
func (m CertificateVerifyMessage) Marshal() ([]byte, error)
type Extension ¶
func CMWAttestationOfferExtension ¶
func CMWAttestationOfferExtension() Extension
type FinishedMessage ¶
type FinishedMessage struct {
VerifyData []byte
}
func UnmarshalFinishedMessage ¶
func UnmarshalFinishedMessage(handshakeBytes []byte) (FinishedMessage, []byte, error)
func (FinishedMessage) Marshal ¶
func (m FinishedMessage) Marshal() ([]byte, error)
type HandshakeMessage ¶
func UnmarshalHandshakeMessage ¶
func UnmarshalHandshakeMessage(b []byte) (msg HandshakeMessage, rest []byte, err error)
type OIDFilter ¶
type OIDFilter struct {
OID asn1.ObjectIdentifier
Values []byte
}
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
func NewSession ¶
func NewSession() *Session
func (*Session) CreateAuthenticator ¶
func (s *Session) CreateAuthenticator(st *tls.ConnectionState, role Role, req *AuthenticatorRequest, identity tls.Certificate, leafEntryExtensions []Extension) ([]byte, error)
func (*Session) CreateAuthenticatorWithPolicy ¶
func (s *Session) CreateAuthenticatorWithPolicy(st *tls.ConnectionState, role Role, req *AuthenticatorRequest, policy *SpontaneousAuthenticatorPolicy, identity tls.Certificate, leafEntryExtensions []Extension) ([]byte, error)
func (*Session) MarkContextUsed ¶
func (*Session) ValidateAuthenticator ¶
func (s *Session) ValidateAuthenticator(st *tls.ConnectionState, role Role, req *AuthenticatorRequest, authBytes []byte, verifyOpts *x509.VerifyOptions) (*ValidationResult, error)
func (*Session) ValidateAuthenticatorWithAttestation ¶
func (s *Session) ValidateAuthenticatorWithAttestation(st *tls.ConnectionState, role Role, req *AuthenticatorRequest, authBytes []byte, verifyOpts *x509.VerifyOptions, attPolicy eaattestation.VerificationPolicy) (*ValidationResult, error)
func (*Session) ValidateAuthenticatorWithPolicies ¶
func (s *Session) ValidateAuthenticatorWithPolicies(st *tls.ConnectionState, role Role, req *AuthenticatorRequest, policy *SpontaneousAuthenticatorPolicy, authBytes []byte, verifyOpts *x509.VerifyOptions, attPolicy eaattestation.VerificationPolicy) (*ValidationResult, error)
func (*Session) ValidateAuthenticatorWithPolicy ¶
func (s *Session) ValidateAuthenticatorWithPolicy(st *tls.ConnectionState, role Role, req *AuthenticatorRequest, policy *SpontaneousAuthenticatorPolicy, authBytes []byte, verifyOpts *x509.VerifyOptions) (*ValidationResult, error)
type ValidationResult ¶
type ValidationResult struct {
Context []byte
Chain []*x509.Certificate
CMWAttestation []byte
Attestation *eaattestation.VerifiedPayload
Empty bool
}
func ValidateAuthenticator ¶
func ValidateAuthenticator(st *tls.ConnectionState, role Role, req *AuthenticatorRequest, authBytes []byte, verifyOpts *x509.VerifyOptions) (*ValidationResult, error)
func ValidateAuthenticatorWithAttestation ¶
func ValidateAuthenticatorWithAttestation(st *tls.ConnectionState, role Role, req *AuthenticatorRequest, authBytes []byte, verifyOpts *x509.VerifyOptions, attPolicy eaattestation.VerificationPolicy) (*ValidationResult, error)
func ValidateAuthenticatorWithPolicies ¶
func ValidateAuthenticatorWithPolicies(st *tls.ConnectionState, role Role, req *AuthenticatorRequest, policy *SpontaneousAuthenticatorPolicy, authBytes []byte, verifyOpts *x509.VerifyOptions, attPolicy eaattestation.VerificationPolicy) (*ValidationResult, error)
func ValidateAuthenticatorWithPolicy ¶
func ValidateAuthenticatorWithPolicy(st *tls.ConnectionState, role Role, req *AuthenticatorRequest, policy *SpontaneousAuthenticatorPolicy, authBytes []byte, verifyOpts *x509.VerifyOptions) (*ValidationResult, error)
Click to show internal directories.
Click to hide internal directories.