tunneled1x

package
v0.0.0-...-683b059 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2022 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Overview

Package tunneled1x provides a Config type for PEAP/TTLS protected network. Both PEAP and TTLS are tunneled protocols which use EAP inside of a TLS secured tunnel. The secured tunnel is a symmetric key encryption scheme negotiated under the protection of a public key in the server certificate. Thus, we'll see server credentials in the form of certificates, but client credentials in the form of passwords and a CA Cert to root the trust chain.

Index

Constants

View Source
const (
	TTLSPrefix = "TTLS-"

	Layer1TypePEAP = "PEAP"
	Layer1TypeTTLS = "TTLS"

	Layer2TypeGTC          = "GTC"
	Layer2TypeMSCHAPV2     = "MSCHAPV2"
	Layer2TypeMD5          = "MD5"
	Layer2TypeTTLSMSCHAPV2 = TTLSPrefix + "MSCHAPV2"
	Layer2TypeTTLSMSCHAP   = TTLSPrefix + "MSCHAP"
	Layer2TypeTTLSPAP      = TTLSPrefix + "PAP"
)

Outer (layer1) and inner (layer2) protocols.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Embedded WPA-EAP Config to inherit the Install* and HostapdConfig methods.
	*wpaeap.Config
	// contains filtered or unexported fields
}

Config implements security.Config interface for TTLS/PEAP protected network.

func (*Config) ShillServiceProperties

func (c *Config) ShillServiceProperties() (map[string]interface{}, error)

ShillServiceProperties returns shill properties of TTLS/PEAP network.

type ConfigFactory

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

ConfigFactory holds some Option and provides Gen method to build a new Config.

func NewConfigFactory

func NewConfigFactory(serverCACert string, serverCred certificate.Credential, clientCACert, identity, serverPassword string, ops ...Option) *ConfigFactory

NewConfigFactory builds a ConfigFactory with the given Option.

func (*ConfigFactory) Gen

func (f *ConfigFactory) Gen() (security.Config, error)

Gen builds a Config with the given Option stored in ConfigFactory.

type Option

type Option func(*ConfigFactory)

Option is the function signature used to specify options of Config.

func AltSubjectMatch

func AltSubjectMatch(sans []string) Option

AltSubjectMatch returns an Option which sets shill EAP.SubjectAlternativeNameMatch property in Config.

func ClientPassword

func ClientPassword(passwd string) Option

ClientPassword returns an Option which sets the client password in Config. Note that this is used for setting a bad password for testing, that is, it will be set to be the same as server's by default.

func DomainSuffixMatch

func DomainSuffixMatch(domainSuffix []string) Option

DomainSuffixMatch returns an Option which sets shill EAP.DomainSuffixMatch property in Config.

func FileSuffix

func FileSuffix(suffix string) Option

FileSuffix returns an Option which sets the file suffix in Config.

func InnerProtocol

func InnerProtocol(inner string) Option

InnerProtocol returns an Option which sets the inner (layer2) protocol in Config.

func Mode

func Mode(mode wpa.ModeEnum) Option

Mode returns an Option which sets WPA mode in Config.

func OuterProtocol

func OuterProtocol(outer string) Option

OuterProtocol returns an Option which sets the outer (layer1) protocol in Config.

func Phase2User

func Phase2User(user, passwd, protocol string) Option

Phase2User returns an Option which adds additional phase 2 user in Config.

Jump to

Keyboard shortcuts

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