radius

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2020 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Overview

package radius implements AAA server's radius interface for accounting & authentication

package radius implements AAA server's radius interface for accounting & authentication

Copyright 2020 The Magma Authors.

This source code is licensed under the BSD-style license found in the LICENSE file in the root directory of this source tree.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

package radius implements AAA server's radius interface for accounting & authentication

package radius implements AAA server's radius interface for accounting & authentication

Index

Constants

View Source
const (
	MSMPPESendKey_Type radius.Type = 16
	MSMPPERecvKey_Type radius.Type = 17
)

Variables

View Source
var MicrosoftVendor = []byte{0x00, 0x00, 0x01, 0x37}

MicrosoftVendor bytes depicting Microsoft vendor for RADIUS Vendor-Specific attributes

Functions

func AddMessageAuthenticatorAttr

func AddMessageAuthenticatorAttr(p *radius.Packet) error

AddMessageAuthenticatorAttr generates and adds MessageAuthenticator AVP to the packet

func GenSessionID

func GenSessionID(calling string, called string) string

GenSessionID creates syntetic radius session ID if none is supplied by the client

func GenerateMPPEAttribute

func GenerateMPPEAttribute(key []byte, s []byte, r []byte, a []byte, t radius.Type) ([]byte, error)

GenerateMPPEAttribute Wraps the MPPE key with RADIUS attributes as indicated in rfc2866 (Vendor-Specific attribute)

func GenerateMPPEKey

func GenerateMPPEKey(key []byte, s []byte, r []byte, a []byte) []byte

GenerateMPPEKey follows RFC2548 section 2.4.3 and 2.4.4 to generate MPPE keying material. all parameter names are taken from the RFC so it's easier to follow the code

func GetKeyingAttributes

func GetKeyingAttributes(msk []byte, secret []byte, authenticator []byte) (rcv, snd radius.Attribute, err error)

GetKeyingAttributes Generates RADIUS keying materials

func ToRadiusCode

func ToRadiusCode(eapCode uint8) radius.Code

ToRadiusCode returs the RADIUS packet code which, as per RFCxxxx should carry the EAP payload of the given EAP Code

func ValidateConfigs

func ValidateConfigs(cfg *mconfig.RadiusConfig) *mconfig.RadiusConfig

Types

type AcctServer

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

AcctServer - radius accounting server implementation

func (*AcctServer) ServeRADIUS

func (s *AcctServer) ServeRADIUS(w radius.ResponseWriter, r *radius.Request)

ServeRADIUS - radius handler interface implementation for EAP server

type AuthServer

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

AuthServer - radius EAP server implementation

func (*AuthServer) ServeRADIUS

func (s *AuthServer) ServeRADIUS(w radius.ResponseWriter, r *radius.Request)

ServeRADIUS - radius handler interface implementation for EAP server

type Server

type Server struct {
	AuthServer
	AcctServer
	// contains filtered or unexported fields
}

Server - radius server implementation

func New

New returns new radius server

func (*Server) GetConfig

func (s *Server) GetConfig() *mconfig.RadiusConfig

GetConfig returns server configs

func (*Server) StartAcct

func (s *Server) StartAcct() error

StartAuth starts Auth Radius server, it'll block on success & needs to be executed in its own thread/routine

func (*Server) StartAuth

func (s *Server) StartAuth() error

StartAuth starts Auth Radius server, it'll block on success & needs to be executed in its own thread/routine

Directories

Path Synopsis
package dae implements Radius Dynamic Authorization Extensions API (https://tools.ietf.org/html/rfc5176) package dae implements Radius Dynamic Authorization Extensions API (https://tools.ietf.org/html/rfc5176)
package dae implements Radius Dynamic Authorization Extensions API (https://tools.ietf.org/html/rfc5176) package dae implements Radius Dynamic Authorization Extensions API (https://tools.ietf.org/html/rfc5176)

Jump to

Keyboard shortcuts

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