TrustCore SDK NanoSec API reference  version 7.0
EAP-RADIUS Functions

Provides EAP-RADIUS (EAP-remote authentication dial in user service) authentication in passthrough or server mode. More...

Functions

MOC_EXTERN MSTATUS EAP_radiusDecapsulate (ubyte *eapSessionHdl, ubyte4 instanceId, ubyte *secret, sbyte4 secretlen, RADIUS_RqstRecord *pRadiusReq, ubyte **eap_pkt, ubyte4 *eapLen)
 Decapsulate (extract) an EAP packet from a RADIUS packet. More...
 
MOC_EXTERN MSTATUS EAP_radiusEncapsulate (ubyte *eapSessionHdl, ubyte4 instanceId, ubyte4 authServerID, MOC_IP_ADDRESS addr, ubyte4 nas_port, ubyte4 nas_port_type, ubyte *secret, sbyte4 secretlen, ubyte *eap_pkt, RADIUS_RqstRecord **radiusReq)
 Encapsulate an EAP packet into a RADIUS packet. More...
 
MOC_EXTERN MSTATUS EAP_radiusGetMPPEKeys (ubyte *eapSessionHdl, ubyte4 instanceId, ubyte **mppeSendKey, ubyte4 *mppeSendKeyLen, ubyte **mppeRecvKey, ubyte4 *mppeRecvKeyLen)
 Get a session's MPPE keys. More...
 
MOC_EXTERN MSTATUS EAP_radiusServerDecapsulate (ubyte *eapSessionHdl, ubyte4 instanceId, ubyte *secret, sbyte4 secretlen, ubyte *stateAttr, ubyte4 stateAttrLen, RADIUS_RqstRecord *pRadiusReq, ubyte **eap_pkt, ubyte4 *eapLen)
 Decapsulate (extract) an EAP packet from a RADIUS packet. More...
 
MOC_EXTERN MSTATUS EAP_radiusServerEncapsulate (ubyte *eapSessionHdl, ubyte4 instanceId, ubyte4 authServerID, ubyte *secret, sbyte4 secretlen, ubyte *eap_pkt, ubyte4 eap_pkt_len, RADIUS_RqstRecord *pRadiusReq)
 Encapsulate an EAP packet into a RADIUS packet. More...
 

Detailed Description

Function Documentation

◆ EAP_radiusDecapsulate()

MOC_EXTERN MSTATUS EAP_radiusDecapsulate ( ubyte *  eapSessionHdl,
ubyte4  instanceId,
ubyte *  secret,
sbyte4  secretlen,
RADIUS_RqstRecord *  pRadiusReq,
ubyte **  eap_pkt,
ubyte4 *  eapLen 
)

This function decapsulates (extracts) an EAP packet from a RADIUS packet. Typically the upper layer calls this function and then subsequently passes the decapsulated packet to the lower layer for transmission to a peer, thereby providing passthrough authentication service (sending packets to a backend RADIUS authentication server).

Since
1.41
Version
1.41 and later

To enable this function, the following flags must be defined in moptions.h:

  • __ENABLE_MOCANA_RADIUS_CLIENT__
  • __ENABLE_MOCANA_EAP_RADIUS__

Additionally, at least one of the following flags must be defined in moptions.h:

  • __ENABLE_MOCANA_EAP_PEER__
  • __ENABLE_MOCANA_EAP_AUTH__

eap_radius.h

Parameters
eapSessionHdlEAP session handle returned from EAP_sessionCreate.
instanceIdEAP instance ID returned from EAP_initInstance.
secretShared secret between RADIUS client and backend RADIUS authentication server.
secretlenNumber of bytes in secret.
pRadiusReqPointer to RADIUS packet (received from backend RADIUS authentication server) containing encapsulated EAP packet.
eap_pktOn return, pointer to decapsulated EAP packet.
eapLenOn return, pointer to number of bytes in eap_pkt.
Returns
OK (0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR macro.
See also
EAP_MD5_getChallenge
EAP_MD5ProcessAuth

eap_radius.h

◆ EAP_radiusEncapsulate()

MOC_EXTERN MSTATUS EAP_radiusEncapsulate ( ubyte *  eapSessionHdl,
ubyte4  instanceId,
ubyte4  authServerID,
MOC_IP_ADDRESS  addr,
ubyte4  nas_port,
ubyte4  nas_port_type,
ubyte *  secret,
sbyte4  secretlen,
ubyte *  eap_pkt,
RADIUS_RqstRecord **  radiusReq 
)

This function encapsulates a given EAP packet into a RADIUS packet, appending the required attributes and returning the encapsulated packet through the radiusReq parameter. Typically the upper layer calls this function to provide passthrough authentication (sending packets to a backend RADIUS authentication server).

Since
1.41
Version
1.41 and later

To enable this function, the following flags must be defined in moptions.h:

  • __ENABLE_MOCANA_RADIUS_CLIENT__
  • __ENABLE_MOCANA_EAP_RADIUS__

Additionally, at least one of the following flags must be defined in moptions.h:

  • __ENABLE_MOCANA_EAP_PEER__
  • __ENABLE_MOCANA_EAP_AUTH__

eap_radius.h

Parameters
eapSessionHdlEAP session handle returned from EAP_sessionCreate.
instanceIdEAP instance ID returned from EAP_initInstance.
authServerIDBackend RADIUS authentication server ID (index specified by Mocana internal code).
addrInterface address of NAS (network authentication server).
nas_portNAS port number.
nas_port_typeNAS port type (see NAS (Network Access Server) Port Types).
secretShared secret between RADIUS client and backend RADIUS authentication server.
secretlenNumber of bytes in secret.
eap_pktPointer to EAP packet to be encapsulated.
radiusReqOn return, pointer to encapsulated RADIUS EAP packet.
Returns
OK (0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR macro.

eap_radius.h

◆ EAP_radiusGetMPPEKeys()

MOC_EXTERN MSTATUS EAP_radiusGetMPPEKeys ( ubyte *  eapSessionHdl,
ubyte4  instanceId,
ubyte **  mppeSendKey,
ubyte4 *  mppeSendKeyLen,
ubyte **  mppeRecvKey,
ubyte4 *  mppeRecvKeyLen 
)

This function retrieves a session's MPPE (Microsoft Point-to-Point Encryption) keys that the RADIUS server sent to the passthrough authenticator in the Access Accept Message.

Since
2.02
Version
2.02 and later

To enable this function, the following flags must be defined in moptions.h:

  • __ENABLE_MOCANA_RADIUS_CLIENT__
  • __ENABLE_MOCANA_EAP_RADIUS__

Additionally, at least one of the following flags must be defined in moptions.h:

  • __ENABLE_MOCANA_EAP_PEER__
  • __ENABLE_MOCANA_EAP_AUTH__

eap_radius.h

Parameters
eapSessionHdlEAP session handle returned from EAP_sessionCreate.
instanceIdEAP instance ID returned from EAP_initInstance.
mppeSendKeyOn return, pointer to sent MPPE key.
mppeSendKeyLenOn return, pointer to length of sent MPPE key (mppeSendKey).
mppeRecvKeyOn return, pointer to received MPPE key.
mppeRecvKeyLenOn return, pointer to length of received MPPE key (mppeRecvKey).
Returns
OK (0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR macro.

eap_radius.h

◆ EAP_radiusServerDecapsulate()

MOC_EXTERN MSTATUS EAP_radiusServerDecapsulate ( ubyte *  eapSessionHdl,
ubyte4  instanceId,
ubyte *  secret,
sbyte4  secretlen,
ubyte *  stateAttr,
ubyte4  stateAttrLen,
RADIUS_RqstRecord *  pRadiusReq,
ubyte **  eap_pkt,
ubyte4 *  eapLen 
)

This function decapsulates (extracts) an EAP packet from a RADIUS packet. Typically the upper layer calls this function and then subsequently passes the decapsulated packet to the lower layer for transmission to a peer, thereby providing passthrough authentication service (sending packets to a backend RADIUS authentication server).

Since
1.41
Version
1.41 and later

To enable this function, the following flags must be defined in moptions.h:

  • __ENABLE_MOCANA_EAP_AUTH__
  • __ENABLE_MOCANA_EAP_RADIUS__
  • __ENABLE_MOCANA_RADIUS_CLIENT__
  • __ENABLE_RADIUS_SERVER__

eap_radius.h

Parameters
eapSessionHdlEAP session handle returned from EAP_sessionCreate.
instanceIdEAP instance ID returned from EAP_initInstance.
secretShared secret between RADIUS client and backend RADIUS authentication server.
secretlenNumber of bytes in secret.
stateAttrState Attributes from backend RADIUS authentication server.
stateAttrLenNumber of bytes in stateAttr.
pRadiusReqPointer to RADIUS packet (received from backend RADIUS authentication server) containing encapsulated EAP packet.
eap_pktOn return, pointer to decapsulated EAP packet.
eapLenOn return, pointer to number of bytes in eap_pkt.
Returns
OK (0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR macro.
See also
EAP_MD5_getChallenge
EAP_MD5ProcessAuth

eap_radius.h

◆ EAP_radiusServerEncapsulate()

MOC_EXTERN MSTATUS EAP_radiusServerEncapsulate ( ubyte *  eapSessionHdl,
ubyte4  instanceId,
ubyte4  authServerID,
ubyte *  secret,
sbyte4  secretlen,
ubyte *  eap_pkt,
ubyte4  eap_pkt_len,
RADIUS_RqstRecord *  pRadiusReq 
)

This function encapsulates a given EAP packet into a RADIUS packet, appending the required attributes and returning the encapsulated packet through the radiusReq parameter. Typically the upper layer calls this function to provide passthrough authentication (sending packets to a backend RADIUS authentication server).

Since
1.41
Version
1.41 and later

To enable this function, the following flags must be defined in moptions.h:

  • __ENABLE_MOCANA_EAP_AUTH__
  • __ENABLE_MOCANA_EAP_RADIUS__
  • __ENABLE_MOCANA_RADIUS_CLIENT__
  • __ENABLE_RADIUS_SERVER__

eap_radius.h

Parameters
eapSessionHdlEAP session handle returned from EAP_sessionCreate.
instanceIdEAP instance ID returned from EAP_initInstance.
authServerIDBackend RADIUS authentication server ID (index specified by Mocana internal code).
secretShared secret between RADIUS client and backend RADIUS authentication server.
secretlenNumber of bytes in secret.
eap_pktPointer to EAP packet to be encapsulated.
eap_pkt_lenNumber of bytes in eap_pkt.
pRadiusReqOn return, pointer to encapsulated RADIUS EAP packet.
Returns
OK (0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR macro.

eap_radius.h