ILIAS  release_4-4 Revision
Auth_RADIUS_MSCHAPv2 Class Reference
+ Inheritance diagram for Auth_RADIUS_MSCHAPv2:
+ Collaboration diagram for Auth_RADIUS_MSCHAPv2:

Public Member Functions

 putAuthAttributes ()
 Put MS-CHAPv2 specific attributes. More...
 
 close ()
 Frees resources. More...
 
- Public Member Functions inherited from Auth_RADIUS_MSCHAPv1
 putAuthAttributes ()
 Put MS-CHAPv1 specific attributes. More...
 
- Public Member Functions inherited from Auth_RADIUS_CHAP_MD5
 Auth_RADIUS_CHAP_MD5 ($username=null, $challenge=null, $chapid=1)
 Constructor. More...
 
 putAuthAttributes ()
 Put CHAP-MD5 specific attributes. More...
 
 close ()
 Frees resources. More...
 
- Public Member Functions inherited from Auth_RADIUS_PAP
 Auth_RADIUS_PAP ($username=null, $password=null)
 Constructor. More...
 
 open ()
 Creates a RADIUS resource. More...
 
 createRequest ()
 Creates an authentication request. More...
 
 putAuthAttributes ()
 Put authentication specific attributes. More...
 
- Public Member Functions inherited from Auth_RADIUS
 Auth_RADIUS ()
 Constructor. More...
 
 addServer ($servername='localhost', $port=0, $sharedSecret='testing123', $timeout=3, $maxtries=3)
 Adds a RADIUS server to the list of servers for requests. More...
 
 getError ()
 Returns an error message, if an error occurred. More...
 
 setConfigfile ($file)
 Sets the configuration-file. More...
 
 putAttribute ($attrib, $value, $type=null)
 Puts an attribute. More...
 
 putVendorAttribute ($vendor, $attrib, $value, $type=null)
 Puts a vendor-specific attribute. More...
 
 dumpAttributes ()
 Prints known attributes received from the server. More...
 
 open ()
 Overwrite this. More...
 
 createRequest ()
 Overwrite this. More...
 
 putStandardAttributes ()
 Puts standard attributes. More...
 
 putAuthAttributes ()
 Puts custom attributes. More...
 
 putServer ($servername, $port=0, $sharedsecret='testing123', $timeout=3, $maxtries=3)
 Configures the radius library. More...
 
 putConfigfile ($file)
 Configures the radius library via external configurationfile. More...
 
 start ()
 Initiates a RADIUS request. More...
 
 send ()
 Sends a prepared RADIUS request and waits for a response. More...
 
 getAttributes ()
 Reads all received attributes after sending the request. More...
 
 close ()
 Frees resources. More...
 
- Public Member Functions inherited from PEAR
 PEAR ($error_class=null)
 Constructor. More...
 
 _PEAR ()
 Destructor (the emulated type of...). More...
 
getStaticProperty ($class, $var)
 If you have a class that's mostly/entirely static, and you need static properties, you can use this method to simulate them. More...
 
 registerShutdownFunc ($func, $args=array())
 Use this function to register a shutdown method for static classes. More...
 
 isError ($data, $code=null)
 Tell whether a value is a PEAR error. More...
 
 setErrorHandling ($mode=null, $options=null)
 Sets how errors generated by this object should be handled. More...
 
 expectError ($code=' *')
 This method is used to tell which errors you expect to get. More...
 
 popExpect ()
 This method pops one element off the expected error codes stack. More...
 
 _checkDelExpect ($error_code)
 This method checks unsets an error code if available. More...
 
 delExpect ($error_code)
 This method deletes all occurences of the specified element from the expected error codes stack. More...
 
raiseError ($message=null, $code=null, $mode=null, $options=null, $userinfo=null, $error_class=null, $skipmsg=false)
 This method is a wrapper that returns an instance of the configured error class with this object's default error handling applied. More...
 
throwError ($message=null, $code=null, $userinfo=null)
 Simpler form of raiseError with fewer options. More...
 
 staticPushErrorHandling ($mode, $options=null)
 
 staticPopErrorHandling ()
 
 pushErrorHandling ($mode, $options=null)
 Push a new error handler on top of the error handler options stack. More...
 
 popErrorHandling ()
 Pop the last error handler used. More...
 
 loadExtension ($ext)
 OS independant PHP extension load. More...
 

Data Fields

 $challenge = null
 
 $peerChallenge = null
 
- Data Fields inherited from Auth_RADIUS_MSCHAPv1
 $lmResponse = null
 
 $flags = 1
 
- Data Fields inherited from Auth_RADIUS_CHAP_MD5
 $challenge = null
 
 $response = null
 
 $chapid = 1
 
- Data Fields inherited from Auth_RADIUS
 $_servers = array()
 
 $_configfile = null
 
 $res = null
 
 $username = null
 
 $password = null
 
 $attributes = array()
 
 $rawAttributes = array()
 
 $rawVendorAttributes = array()
 
 $useStandardAttributes = true
 
- Data Fields inherited from PEAR
 $_debug = false
 
 $_default_error_mode = null
 
 $_default_error_options = null
 
 $_default_error_handler = ''
 
 $_error_class = 'PEAR_Error'
 
 $_expected_errors = array()
 

Detailed Description

Definition at line 779 of file RADIUS.php.

Member Function Documentation

◆ close()

Auth_RADIUS_MSCHAPv2::close ( )

Frees resources.

Calling this method is always a good idea, because all security relevant attributes are filled with Nullbytes to leave nothing in the mem.

public

Definition at line 831 of file RADIUS.php.

References Auth_RADIUS_CHAP_MD5\close().

832  {
834  $this->peerChallenge = str_repeat("\0", strlen($this->peerChallenge));
835  }
close()
Frees resources.
Definition: RADIUS.php:710
+ Here is the call graph for this function:

◆ putAuthAttributes()

Auth_RADIUS_MSCHAPv2::putAuthAttributes ( )

Put MS-CHAPv2 specific attributes.

For authenticating using MS-CHAPv1 via RADIUS you have to put the challenge and the response. The response has this structure: struct rad_mschapv2value { u_char ident; u_char flags; u_char pchallenge[16]; u_char reserved[8]; u_char response[24]; }; where pchallenge is the peer challenge. Like for MS-CHAPv1 we set the flags field to 1.

Returns
void

Definition at line 808 of file RADIUS.php.

References Auth_RADIUS\putAttribute(), and Auth_RADIUS\putVendorAttribute().

809  {
810  if (isset($this->username)) {
811  $this->putAttribute(RADIUS_USER_NAME, $this->username);
812  }
813  if (isset($this->response) && isset($this->peerChallenge)) {
814  // Response: chapid, flags (1 = use NT Response), Peer challenge, reserved, Response
815  $resp = pack('CCa16a8a24',$this->chapid , 1, $this->peerChallenge, str_repeat("\0", 8), $this->response);
816  $this->putVendorAttribute(RADIUS_VENDOR_MICROSOFT, RADIUS_MICROSOFT_MS_CHAP2_RESPONSE, $resp);
817  }
818  if (isset($this->challenge)) {
819  $this->putVendorAttribute(RADIUS_VENDOR_MICROSOFT, RADIUS_MICROSOFT_MS_CHAP_CHALLENGE, $this->challenge);
820  }
821  }
putAttribute($attrib, $value, $type=null)
Puts an attribute.
Definition: RADIUS.php:185
putVendorAttribute($vendor, $attrib, $value, $type=null)
Puts a vendor-specific attribute.
Definition: RADIUS.php:216
+ Here is the call graph for this function:

Field Documentation

◆ $challenge

Auth_RADIUS_MSCHAPv2::$challenge = null

Definition at line 785 of file RADIUS.php.

◆ $peerChallenge

Auth_RADIUS_MSCHAPv2::$peerChallenge = null

Definition at line 791 of file RADIUS.php.


The documentation for this class was generated from the following file: