Documentation
¶
Overview ¶
Portions of the AnyConnect multiple-certificate exchange are derived from OpenConnect commit 2035601b64a5360a46d18e08937e7f654b3230f2, auth.c prepare_multicert_response/post_multicert_response and openssl.c multicert_sign_data. OpenConnect is licensed LGPL-2.1-or-later.
This file contains a Go port of OpenConnect 9.21, lzs.c.
Copyright © 2008-2015 Intel Corporation. Author: David Woodhouse <dwmw2@infradead.org>
OpenConnect is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 2.1, as published by the Free Software Foundation. OpenConnect is distributed without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose.
Portions of the RSA SecurID implementation are derived from libstoken commit 837e843e8850d14a5d49d799b066d61d04fd649a, src/securid.c. It follows securid_mac, v2_decode_token, v2_decrypt_seed, v3_decode_token, v3_decrypt_seed, and securid_compute_tokencode. Copyright 2012 Kevin Cernekee. libstoken is licensed LGPL-2.1-or-later.
Index ¶
- Constants
- Variables
- type AuthChallenge
- type AuthForm
- type AuthFormChoice
- type AuthFormField
- type AuthFormResponse
- type AuthResponse
- type BrowserCookie
- type BrowserRequest
- type BrowserResult
- type CSDOptions
- type Client
- func (c *Client) ActiveTransport() string
- func (c *Client) ActiveTransportUpdated() <-chan struct{}
- func (c *Client) AuthChallengeUpdated() <-chan struct{}
- func (c *Client) CancelAuthChallenge(id string) error
- func (c *Client) Close() error
- func (c *Client) CompleteAuthChallenge(id string, response AuthResponse) error
- func (c *Client) DroppedIncomingDataPackets() uint64
- func (c *Client) PendingAuthChallenge() *AuthChallenge
- func (c *Client) ReadDataPacket(ctx context.Context) ([]byte, error)
- func (c *Client) ReadDataPacketBuffer(ctx context.Context) (*buf.Buffer, error)
- func (c *Client) ReadDataPackets(ctx context.Context) ([]*buf.Buffer, error)
- func (c *Client) Ready() bool
- func (c *Client) RestartSession()
- func (c *Client) Start() error
- func (c *Client) TunnelConfiguration() TunnelConfiguration
- func (c *Client) WriteDataPacket(packet []byte) error
- func (c *Client) WriteDataPacketBuffers(packetBuffers []*buf.Buffer) error
- func (c *Client) WriteDataPackets(packets [][]byte) error
- type ClientOptions
- type ClientTLSOptions
- type FormEntry
- type FortinetHostCheckOptions
- type HIPOptions
- type Material
- type MobileOptions
- type TNCCOptions
- type TokenOptions
- type TunnelConfiguration
- type TunnelConfigurationEvent
- type TunnelConfigurationEventReason
- type TunnelRoute
- type TunnelSplitDNSRule
Constants ¶
const ( AuthFormFieldText = "text" AuthFormFieldPassword = "password" AuthFormFieldSelect = "select" )
const ( FlavorAnyConnect = "anyconnect" FlavorGP = "gp" FlavorFortinet = "fortinet" FlavorF5 = "f5" FlavorPulse = "pulse" FlavorNC = "nc" )
const ( TokenModeTOTP = "totp" TokenModeHOTP = "hotp" TokenModeSToken = "stoken" TokenModeOIDC = "oidc" CompressionModeStateless = "stateless" CompressionModeAll = "all" )
const ( TransportCSTP = "cstp" TransportGPST = "gpst" TransportTLS = "tls" TransportDTLS = "dtls" TransportIFT = "ift" TransportONCP = "oncp" TransportESP = "esp" )
const PacketHeadroom = espFixedHeaderSize
Variables ¶
var ( ErrMissingServer = E.New("missing openconnect server") ErrUnsupportedFlavor = E.New("unsupported openconnect flavor") ErrClientClosed = E.New("client is closed") ErrDataChannelNotReady = E.New("data channel is not ready") ErrNoPendingAuthChallenge = E.New("no pending openconnect authentication challenge") ErrAuthChallengeNotAnswerable = E.New("authentication challenge does not accept a response") ErrAuthChallengeCanceled = E.New("authentication challenge canceled") ErrInvalidAuthResponse = E.New("invalid openconnect authentication response") ErrAuthenticationFailed = E.New("authentication failed") ErrSessionRejected = E.New("session rejected") ErrInvalidBrowserAuthentication = E.New("invalid openconnect browser authentication result") ErrMaterialSourceConflict = E.New("material path and content are both set") ErrInvalidTLSMaterial = E.New("invalid openconnect TLS material") ErrDeprecatedCryptoDisabled = E.New("deprecated cryptography is disabled") ErrReconnectTimeout = E.New("reconnect timeout exceeded") ErrProtocolNotSupported = E.New("protocol behavior is not supported") )
Functions ¶
This section is empty.
Types ¶
type AuthChallenge ¶
type AuthForm ¶
type AuthForm struct {
Fields []AuthFormField
}
type AuthFormChoice ¶
type AuthFormField ¶
type AuthFormResponse ¶
type AuthResponse ¶
type AuthResponse struct {
Form *AuthFormResponse
Browser *BrowserResult
}
type BrowserCookie ¶
type BrowserRequest ¶
type BrowserResult ¶
type BrowserResult struct {
FinalURL string
Cookies []BrowserCookie
Header http.Header
}
type CSDOptions ¶
type CSDOptions struct {
WrapperPath string
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(options ClientOptions) (*Client, error)
func (*Client) ActiveTransport ¶
func (*Client) ActiveTransportUpdated ¶
func (c *Client) ActiveTransportUpdated() <-chan struct{}
func (*Client) AuthChallengeUpdated ¶
func (c *Client) AuthChallengeUpdated() <-chan struct{}
func (*Client) CancelAuthChallenge ¶
func (*Client) CompleteAuthChallenge ¶
func (c *Client) CompleteAuthChallenge(id string, response AuthResponse) error
func (*Client) DroppedIncomingDataPackets ¶
func (*Client) PendingAuthChallenge ¶
func (c *Client) PendingAuthChallenge() *AuthChallenge
func (*Client) ReadDataPacket ¶
ReadDataPacket returns a caller-owned copy of the next packet.
func (*Client) ReadDataPacketBuffer ¶
ReadDataPacketBuffer transfers ownership of the returned buffer to the caller, which must release it.
func (*Client) ReadDataPackets ¶
ReadDataPackets transfers ownership of the returned buffers to the caller, which must release each buffer.
func (*Client) RestartSession ¶
func (c *Client) RestartSession()
func (*Client) TunnelConfiguration ¶
func (c *Client) TunnelConfiguration() TunnelConfiguration
func (*Client) WriteDataPacket ¶
WriteDataPacket copies packet before returning.
func (*Client) WriteDataPacketBuffers ¶
WriteDataPacketBuffers takes ownership of every buffer and releases them before returning.
func (*Client) WriteDataPackets ¶
WriteDataPackets copies every packet before returning.
type ClientOptions ¶
type ClientOptions struct {
Context context.Context
Server string
Flavor string
Username string
Password string
AuthGroup string
Cookie string
Token *TokenOptions
ReportedOS string
UserAgent string
Version string
LocalHostname string
Mobile *MobileOptions
CSD *CSDOptions
HIP *HIPOptions
TNCC *TNCCOptions
FortinetHostCheck *FortinetHostCheckOptions
NoUDP bool
DTLSLocalPort uint16
DTLSCipherSuites string
DTLS12CipherSuites string
CompressionDisabled bool
CompressionMode string
IPv6Disabled bool
HTTPKeepAliveDisabled bool
XMLPostDisabled bool
ExternalAuthDisabled bool
PasswordAuthenticationDisabled bool
AllowInsecureCrypto bool
PFS bool
MTU uint32
BaseMTU uint32
QueueLength uint32
DPDInterval time.Duration
ReconnectTimeout time.Duration
TrojanInterval time.Duration
TLSConfig ClientTLSOptions
FormEntries []FormEntry
Dialer N.Dialer
Logger logger.ContextLogger
OnTunnelConfiguration func(event TunnelConfigurationEvent) error
}
type ClientTLSOptions ¶
type ClientTLSOptions struct {
Config *tls.Config
ServerName string
SystemTrustDisabled bool
CertificateExpiryWarning time.Duration
CertificateExpiryWarningDisabled bool
PeerFingerprints []string
CertificateAuthority Material
Certificate Material
Key Material
KeyPassword string
MCACertificate Material
MCAKey Material
MCAKeyPassword string
}
type HIPOptions ¶
type HIPOptions struct {
WrapperPath string
}
type MobileOptions ¶
type TNCCOptions ¶
type TokenOptions ¶
type TunnelConfiguration ¶
type TunnelConfiguration struct {
MTU uint32
RemoteAddress netip.Addr
Addresses []netip.Prefix
Routes []TunnelRoute
ExcludedRoutes []TunnelRoute
DNS []netip.Addr
NBNS []netip.Addr
SearchDomains []string
SplitDNS []string
SplitDNSRules []TunnelSplitDNSRule
ProxyAutoConfigURL string
Banner string
TunnelAllDNS bool
ClientBypassProtocol bool
IdleTimeout time.Duration
AuthenticationExpiration time.Time
// contains filtered or unexported fields
}
type TunnelConfigurationEvent ¶
type TunnelConfigurationEvent struct {
Reason TunnelConfigurationEventReason
Configuration TunnelConfiguration
}
type TunnelConfigurationEventReason ¶
type TunnelConfigurationEventReason string
const ( TunnelConfigurationEventInitial TunnelConfigurationEventReason = "initial" TunnelConfigurationEventReestablishment TunnelConfigurationEventReason = "reestablishment" TunnelConfigurationEventRekey TunnelConfigurationEventReason = "rekey" TunnelConfigurationEventPathMTU TunnelConfigurationEventReason = "path-mtu" )
type TunnelSplitDNSRule ¶
Source Files
¶
- anyconnect_auth.go
- anyconnect_compression.go
- anyconnect_csd.go
- anyconnect_csd_platform_unix.go
- anyconnect_form.go
- anyconnect_mca.go
- anyconnect_session.go
- auth_form.go
- client.go
- client_supervisor.go
- cstp_client.go
- cstp_keepalive.go
- cstp_packet.go
- cstp_rekey.go
- data_packet_queue.go
- data_packet_writer.go
- default_dialer.go
- direct_cookie.go
- dtls_certificate.go
- dtls_certificate_legacy.go
- dtls_certificate_legacy_crypto.go
- dtls_certificate_legacy_handshake.go
- dtls_cipher.go
- dtls_client.go
- dtls_legacy.go
- dtls_legacy_crypto.go
- dtls_legacy_record.go
- dtls_mtu.go
- dtls_rekey.go
- dtls_session.go
- errors.go
- esp_channel.go
- esp_packet.go
- esp_replay.go
- f5_auth.go
- f5_config.go
- f5_form.go
- f5_session.go
- flavor.go
- fortinet_auth.go
- fortinet_config.go
- fortinet_form.go
- fortinet_session.go
- gp_auth.go
- gp_config.go
- gp_form.go
- gp_gpst.go
- gp_hip.go
- gp_probe.go
- gp_session.go
- html.go
- http_client.go
- lzs.go
- material.go
- nc_auth.go
- nc_form.go
- nc_oncp.go
- nc_session.go
- nc_tncc.go
- nc_tncc_wrapper_unix.go
- oidc.go
- options.go
- packet_buffer.go
- pinned_http.go
- ppp_control.go
- ppp_frame.go
- ppp_link.go
- ppp_negotiation.go
- ppp_session.go
- pulse_auth.go
- pulse_config.go
- pulse_form.go
- pulse_ift.go
- pulse_session.go
- pulse_ttls.go
- tls_config.go
- token_oath.go
- token_stoken.go
- transport.go
- tunnel_config.go