net.jradius.client.auth
Class EAPAuthenticator

java.lang.Object
  extended by net.jradius.client.auth.RadiusAuthenticator
      extended by net.jradius.client.auth.EAPAuthenticator
Direct Known Subclasses:
EAPMD5Authenticator, EAPMSCHAPv2Authenticator

public abstract class EAPAuthenticator
extends RadiusAuthenticator

EAP Authentication. This abstract class is extended to implement EAP protocols.

Author:
David Bird

Field Summary
static int EAP_AKA
           
static int EAP_CISCO_MSCHAPV2
           
static int EAP_FAILURE
           
static int EAP_GTC
           
static int EAP_HEADERLEN
           
static int EAP_IDENTITY
           
static int EAP_LEAP
           
static int EAP_MD5
           
static int EAP_MSCHAPV2
           
static int EAP_NAK
           
static int EAP_NOTIFICATION
           
static int EAP_OTP
           
static int EAP_PEAP
           
static int EAP_REQUEST
           
static int EAP_RESPONSE
           
static int EAP_SIM
           
static int EAP_SUCCESS
           
static int EAP_TLS
           
static int EAP_TLV
           
static int EAP_TTLS
           
protected  boolean peap
           
protected  int state
           
static int STATE_AUTHENTICATED
           
static int STATE_CHALLENGE
           
static int STATE_FAILURE
           
static int STATE_REJECTED
           
static int STATE_SUCCESS
           
 
Fields inherited from class net.jradius.client.auth.RadiusAuthenticator
classAttribute, client, password, stateAttribute, username
 
Constructor Summary
EAPAuthenticator()
           
 
Method Summary
 byte[] doEAP(byte[] eapReply)
          From: http://tools.ietf.org/id/draft-kamath-pppext-peapv0-00.txt
abstract  byte[] doEAPType(byte id, byte[] data)
           
 byte[] doEAPType(byte id, byte[] data, byte[] fullEAPPacket)
           
 byte[] eapFailure(byte id)
           
protected  byte[] eapRequest(int type, byte id, byte[] data)
           
protected  byte[] eapResponse(int type, byte id, byte[] data)
          Encodes an EAP-Response
 byte[] eapSuccess(byte id)
           
 byte getEAPType()
           
 int getState()
           
 boolean isStartWithIdentity()
           
protected  byte[] negotiateEAPType(byte id, byte eapType)
          Negotiates the EAP Authentication Protocol to use
 void processChallenge(RadiusPacket p, RadiusPacket r)
          EAP requires a challenge/response.
 void processRequest(RadiusPacket p)
           
 void setEAPType(int eapType)
           
 void setStartWithIdentity(boolean startWithIdentity)
           
 void setState(int state)
           
protected  boolean suedoEAPType(byte[] eap)
           
 byte[] tlvSuccess(byte id)
           
 
Methods inherited from class net.jradius.client.auth.RadiusAuthenticator
getAuthName, getClassAttribute, getClient, getPassword, getStateAttribute, getUsername, setClient, setPassword, setupRequest, setUsername
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

peap

protected boolean peap

state

protected int state

STATE_CHALLENGE

public static final int STATE_CHALLENGE
See Also:
Constant Field Values

STATE_AUTHENTICATED

public static final int STATE_AUTHENTICATED
See Also:
Constant Field Values

STATE_REJECTED

public static final int STATE_REJECTED
See Also:
Constant Field Values

STATE_SUCCESS

public static final int STATE_SUCCESS
See Also:
Constant Field Values

STATE_FAILURE

public static final int STATE_FAILURE
See Also:
Constant Field Values

EAP_HEADERLEN

public static final int EAP_HEADERLEN
See Also:
Constant Field Values

EAP_REQUEST

public static final int EAP_REQUEST
See Also:
Constant Field Values

EAP_RESPONSE

public static final int EAP_RESPONSE
See Also:
Constant Field Values

EAP_SUCCESS

public static final int EAP_SUCCESS
See Also:
Constant Field Values

EAP_FAILURE

public static final int EAP_FAILURE
See Also:
Constant Field Values

EAP_IDENTITY

public static final int EAP_IDENTITY
See Also:
Constant Field Values

EAP_NOTIFICATION

public static final int EAP_NOTIFICATION
See Also:
Constant Field Values

EAP_NAK

public static final int EAP_NAK
See Also:
Constant Field Values

EAP_MD5

public static final int EAP_MD5
See Also:
Constant Field Values

EAP_OTP

public static final int EAP_OTP
See Also:
Constant Field Values

EAP_GTC

public static final int EAP_GTC
See Also:
Constant Field Values

EAP_TLS

public static final int EAP_TLS
See Also:
Constant Field Values

EAP_LEAP

public static final int EAP_LEAP
See Also:
Constant Field Values

EAP_SIM

public static final int EAP_SIM
See Also:
Constant Field Values

EAP_TTLS

public static final int EAP_TTLS
See Also:
Constant Field Values

EAP_AKA

public static final int EAP_AKA
See Also:
Constant Field Values

EAP_PEAP

public static final int EAP_PEAP
See Also:
Constant Field Values

EAP_MSCHAPV2

public static final int EAP_MSCHAPV2
See Also:
Constant Field Values

EAP_CISCO_MSCHAPV2

public static final int EAP_CISCO_MSCHAPV2
See Also:
Constant Field Values

EAP_TLV

public static final int EAP_TLV
See Also:
Constant Field Values
Constructor Detail

EAPAuthenticator

public EAPAuthenticator()
Method Detail

processRequest

public void processRequest(RadiusPacket p)
                    throws RadiusException
Specified by:
processRequest in class RadiusAuthenticator
Parameters:
p - The RadiusPacket to be processed
Throws:
RadiusException
See Also:
RadiusAuthenticator.processRequest(net.jradius.packet.RadiusPacket)

processChallenge

public void processChallenge(RadiusPacket p,
                             RadiusPacket r)
                      throws RadiusException
EAP requires a challenge/response. The request packet is reset with a new RADIUS identifier and the EAP-Message is encoded.

Overrides:
processChallenge in class RadiusAuthenticator
Parameters:
p - The original AccessRequest RadiusPacket
r - The AccessChallenge packet
Throws:
RadiusException
See Also:
RadiusAuthenticator.processChallenge(net.jradius.packet.RadiusPacket, net.jradius.packet.RadiusPacket)

getEAPType

public byte getEAPType()
Returns:
Returns the EAP Type.

setEAPType

public void setEAPType(int eapType)
Parameters:
eapType - The eapType to set.

doEAPType

public abstract byte[] doEAPType(byte id,
                                 byte[] data)
                          throws RadiusException
Parameters:
id - The EAP ID
data - The EAP Data
Returns:
Returns the EAP-Type specific EAP-Message
Throws:
RadiusException

doEAPType

public byte[] doEAPType(byte id,
                        byte[] data,
                        byte[] fullEAPPacket)
                 throws RadiusException
Throws:
RadiusException

suedoEAPType

protected boolean suedoEAPType(byte[] eap)

doEAP

public byte[] doEAP(byte[] eapReply)
             throws RadiusException
From: http://tools.ietf.org/id/draft-kamath-pppext-peapv0-00.txt
   
 2.1.  Extensions Request Packet
   
   A summary of the Extensions Request packet format is shown below.  The
   fields are transmitted from left to right.
   
   0                   1                   2                   3
   0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |     Code      |   Identifier  |            Length             |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |     Type      |                  Data....
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Parameters:
eapReply - The in-coming EAP-Message
Returns:
Returns the out-bound EAP-Message
Throws:
RadiusException

negotiateEAPType

protected byte[] negotiateEAPType(byte id,
                                  byte eapType)
Negotiates the EAP Authentication Protocol to use

Parameters:
id - The EAP ID
eapType - The wanted EAP Protocol Type
Returns:
Returns the EAP-Message

eapResponse

protected byte[] eapResponse(int type,
                             byte id,
                             byte[] data)
Encodes an EAP-Response

Parameters:
type - The EAP-Type
id - The EAP Packet ID
data - The EAP-Message data
Returns:
Returns the EAP-Message

eapRequest

protected byte[] eapRequest(int type,
                            byte id,
                            byte[] data)

eapSuccess

public byte[] eapSuccess(byte id)

eapFailure

public byte[] eapFailure(byte id)

tlvSuccess

public byte[] tlvSuccess(byte id)

isStartWithIdentity

public boolean isStartWithIdentity()

setStartWithIdentity

public void setStartWithIdentity(boolean startWithIdentity)

getState

public int getState()

setState

public void setState(int state)


Copyright © 2011 Coova Technologies, LLC, All Rights Reserved.