ctap_hid

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 12, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CTAPHIDSERVER_MAX_PACKET_SIZE int = 64
)
View Source
const CTAPHID_STATUS_UPNEEDED uint8 = 2

Variables

View Source
var CTAPHIDCommandDescriptions = map[CTAPHIDCommand]string{
	CTAPHID_COMMAND_MSG:       "CTAPHID_COMMAND_MSG",
	CTAPHID_COMMAND_CBOR:      "CTAPHID_COMMAND_CBOR",
	CTAPHID_COMMAND_INIT:      "CTAPHID_COMMAND_INIT",
	CTAPHID_COMMAND_PING:      "CTAPHID_COMMAND_PING",
	CTAPHID_COMMAND_CANCEL:    "CTAPHID_COMMAND_CANCEL",
	CTAPHID_COMMAND_ERROR:     "CTAPHID_COMMAND_ERROR",
	CTAPHID_COMMAND_KEEPALIVE: "CTAPHID_COMMAND_KEEPALIVE",
	CTAPHID_COMMAND_WINK:      "CTAPHID_COMMAND_WINK",
	CTAPHID_COMMAND_LOCK:      "CTAPHID_COMMAND_LOCK",
}
View Source
var CTAPHIDErrorCodeDescriptions = map[CTAPHIDErrorCode]string{
	CTAPHID_ERR_INVALID_COMMAND:   "CTAPHID_ERR_INVALID_COMMAND",
	CTAPHID_ERR_INVALID_PARAMETER: "CTAPHID_ERR_INVALID_PARAMETER",
	CTAPHID_ERR_INVALID_LENGTH:    "CTAPHID_ERR_INVALID_LENGTH",
	CTAPHID_ERR_INVALID_SEQUENCE:  "CTAPHID_ERR_INVALID_SEQUENCE",
	CTAPHID_ERR_MESSAGE_TIMEOUT:   "CTAPHID_ERR_MESSAGE_TIMEOUT",
	CTAPHID_ERR_CHANNEL_BUSY:      "CTAPHID_ERR_CHANNEL_BUSY",
	CTAPHID_ERR_LOCK_REQUIRED:     "CTAPHID_ERR_LOCK_REQUIRED",
	CTAPHID_ERR_INVALID_CHANNEL:   "CTAPHID_ERR_INVALID_CHANNEL",
	CTAPHID_ERR_OTHER:             "CTAPHID_ERR_OTHER",
}

Functions

This section is empty.

Types

type CTAPHIDCapabilityFlag

type CTAPHIDCapabilityFlag uint8
const (
	CTAPHID_CAPABILITY_WINK CTAPHIDCapabilityFlag = 0x1
	CTAPHID_CAPABILITY_CBOR CTAPHIDCapabilityFlag = 0x4
	CTAPHID_CAPABILITY_NMSG CTAPHIDCapabilityFlag = 0x8
)

type CTAPHIDChannel

type CTAPHIDChannel struct {
	// contains filtered or unexported fields
}

type CTAPHIDChannelID

type CTAPHIDChannelID uint32
const (
	CTAPHID_BROADCAST_CHANNEL CTAPHIDChannelID = 0xFFFFFFFF
)

type CTAPHIDCommand

type CTAPHIDCommand uint8
const (
	// Each CTAPHID command has its seventh bit set for easier reading
	CTAPHID_COMMAND_MSG       CTAPHIDCommand = 0x83
	CTAPHID_COMMAND_CBOR      CTAPHIDCommand = 0x90
	CTAPHID_COMMAND_INIT      CTAPHIDCommand = 0x86
	CTAPHID_COMMAND_PING      CTAPHIDCommand = 0x81
	CTAPHID_COMMAND_CANCEL    CTAPHIDCommand = 0x91
	CTAPHID_COMMAND_ERROR     CTAPHIDCommand = 0xBF
	CTAPHID_COMMAND_KEEPALIVE CTAPHIDCommand = 0xBB
	CTAPHID_COMMAND_WINK      CTAPHIDCommand = 0x88
	CTAPHID_COMMAND_LOCK      CTAPHIDCommand = 0x84
)

type CTAPHIDErrorCode

type CTAPHIDErrorCode uint8
const (
	CTAPHID_ERR_INVALID_COMMAND   CTAPHIDErrorCode = 0x01
	CTAPHID_ERR_INVALID_PARAMETER CTAPHIDErrorCode = 0x02
	CTAPHID_ERR_INVALID_LENGTH    CTAPHIDErrorCode = 0x03
	CTAPHID_ERR_INVALID_SEQUENCE  CTAPHIDErrorCode = 0x04
	CTAPHID_ERR_MESSAGE_TIMEOUT   CTAPHIDErrorCode = 0x05
	CTAPHID_ERR_CHANNEL_BUSY      CTAPHIDErrorCode = 0x06
	CTAPHID_ERR_LOCK_REQUIRED     CTAPHIDErrorCode = 0x0A
	CTAPHID_ERR_INVALID_CHANNEL   CTAPHIDErrorCode = 0x0B
	CTAPHID_ERR_OTHER             CTAPHIDErrorCode = 0x7F
)

type CTAPHIDInitReponse

type CTAPHIDInitReponse struct {
	Nonce              [8]byte
	NewChannelID       CTAPHIDChannelID
	ProtocolVersion    uint8
	DeviceVersionMajor uint8
	DeviceVersionMinor uint8
	DeviceVersionBuild uint8
	CapabilitiesFlags  CTAPHIDCapabilityFlag
}

type CTAPHIDMessageHeader

type CTAPHIDMessageHeader struct {
	ChannelID     CTAPHIDChannelID
	Command       CTAPHIDCommand
	PayloadLength uint16
}

func (CTAPHIDMessageHeader) String

func (header CTAPHIDMessageHeader) String() string

type CTAPHIDServer

type CTAPHIDServer struct {
	// contains filtered or unexported fields
}

func NewCTAPHIDServer

func NewCTAPHIDServer(ctapServer *ctap.CTAPServer, u2fServer *u2f.U2FServer) *CTAPHIDServer

func (*CTAPHIDServer) GetResponse

func (server *CTAPHIDServer) GetResponse(id uint32, timeout int64) []byte

func (*CTAPHIDServer) HandleMessage

func (server *CTAPHIDServer) HandleMessage(message []byte)

func (*CTAPHIDServer) RemoveWaitingRequest

func (server *CTAPHIDServer) RemoveWaitingRequest(id uint32) bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL