TrustCore SDK NanoSec API reference  version 7.0
EAP-SIM & EAP-AKA Functions

Provides EAP-SIM (EAP-subscriber identity module) and EAP-AKA (EAP-authentication and key agreement) authentication. More...

Functions

MOC_EXTERN MSTATUS EAP_AKAProcessPkt (eapSimCb *eapSim, ubyte *pkt, ubyte2 pktLen, ubyte **resp, ubyte4 *respLen, eapSimStatus *state)
 Process received EAP-AKA packet. More...
 
MOC_EXTERN MSTATUS EAP_AKASendChallengeReq (eapSimCb *eapSim, ubyte **pkt, ubyte4 *pktLen, ubyte *rand, ubyte *autn, ubyte *ck, ubyte *ik, ubyte *res, ubyte2 resLen, ubyte *at_next_psuedo, ubyte2 at_psuedo_len, ubyte *at_next_reauthid, ubyte2 at_reauthid_len, ubyte id)
 Send EAP-AKA Challenge Request. More...
 
MOC_EXTERN MSTATUS EAP_AKASendIdentityReq (eapSimCb *eapSim, ubyte **pkt, ubyte4 *pktLen, ubyte id_type, ubyte id)
 Send EAP-AKA Start Request. More...
 
MOC_EXTERN MSTATUS EAP_SIMDeleteSession (eapSimCb *eapSim)
 Delete an EAP-SIM connection. More...
 
MOC_EXTERN MSTATUS EAP_SIMGetClientErrorCode (eapSimCb *eapSim, ubyte2 *clCode)
 Get the client error code returned by the peer. More...
 
MOC_EXTERN MSTATUS EAP_SIMGetIdentity (eapSimCb *eapSim, ubyte **identity, ubyte4 *len)
 Get the EAP-SIM session ID returned by the peer. More...
 
MOC_EXTERN MSTATUS EAP_SIMgetKey (eapSimCb *eapSim, eapSimKeyType keyType, ubyte **key, ubyte4 *keyLen)
 Get an EAP-SIM session key. More...
 
MOC_EXTERN MSTATUS EAP_SIMGetNotification (eapSimCb *eapSim, ubyte2 *notifCode)
 Get the authenticator's notification code. More...
 
MOC_EXTERN MSTATUS EAP_SIMGetResultInd (void *eap_sim, ubyte *rInd)
 Determine whether a challenge negotiation included a RESULT_IND attribute. More...
 
MOC_EXTERN MSTATUS EAP_SIMGetSelectedVersion (void *eap_sim, ubyte2 *rVer)
 Get the version selected during negotiation. More...
 
MOC_EXTERN MSTATUS EAP_SIMGetSessionStatus (void *eap_sim, eapSimStatus *status)
 Get an EAP-SIM session's session status. More...
 
MOC_EXTERN MSTATUS EAP_SIMGetSuccessNotifCode (void *eap_sim, ubyte *rCode)
 Determine whether an authenticator Notification's S Bit is set. More...
 
MOC_EXTERN MSTATUS EAP_SIMInitSession (void *appCb, void **eapSim, eapSimConfig eapSimCfg)
 Create and initialize an EAP-SIM or EAP-AKA session. More...
 
MOC_EXTERN MSTATUS EAP_SIMProcessPkt (eapSimCb *eapSim, ubyte *pkt, ubyte2 pktLen, ubyte **resp, ubyte4 *respLen, eapSimStatus *state)
 Process a received packet and build a response. More...
 
MOC_EXTERN MSTATUS EAP_SIMSendChallengeReq (eapSimCb *eapSim, ubyte **pkt, ubyte4 *pktLen, ubyte *rand, ubyte2 num_rand, ubyte *kC, ubyte *sRes, ubyte *at_next_psuedo, ubyte2 at_psuedo_len, ubyte *at_next_reauthid, ubyte2 at_reauthid_len, ubyte id)
 Build a Sim Challenge Request packet. More...
 
MOC_EXTERN MSTATUS EAP_SIMSendNotificationReq (eapSimCb *eapSim, ubyte **pkt, ubyte4 *pktLen, ubyte2 at_counter, ubyte4 notification_code, ubyte id)
 Build a Sim Notification Request packet. More...
 
MSTATUS EAP_SIMSendReauthReq (eapSimCb *eapSim, ubyte **pkt, ubyte4 *pktLen, ubyte *at_next_reauthid, ubyte2 at_reauthid_len, ubyte id)
 Build a SIM FAST Reauthentication Request packet. More...
 
MOC_EXTERN MSTATUS EAP_SIMSendStartReq (eapSimCb *eapSim, ubyte **pkt, ubyte4 *pktLen, ubyte id_type, ubyte id)
 Build a Sim Start Request packet. More...
 
MOC_EXTERN MSTATUS EAP_SIMSetIdentity (eapSimCb *eapSim, ubyte *id, ubyte2 idLen)
 Set the EAP-SIM session's final identity. More...
 
MOC_EXTERN MSTATUS EAP_SIMSetImplementedVersion (eapSimCb *eapSim, ubyte2 *versionList, ubyte2 numVersion)
 Add version(s) to an EAP-SIM session's supported versions list. More...
 
MOC_EXTERN MSTATUS EAP_SIMSetPermIdentity (eapSimCb *eapSim, ubyte *id, ubyte2 idLen)
 Set the EAP-SIM session's permanent identity. More...
 

Detailed Description

Function Documentation

◆ EAP_AKAProcessPkt()

MOC_EXTERN MSTATUS EAP_AKAProcessPkt ( eapSimCb *  eapSim,
ubyte *  pkt,
ubyte2  pktLen,
ubyte **  resp,
ubyte4 *  respLen,
eapSimStatus *  state 
)

Process received packet and do SM functions.

Since
1.41
Version
1.41 and later

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

  • __ENABLE_MOCANA_EAP_SIM__

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

  • __ENABLE_MOCANA_EAP_PEER__
  • __ENABLE_MOCANA_EAP_AUTH__

eap_sim.h

Parameters
eapSimEAP SIM Session Handle.
pktReceived EAP packet.
pktLenReceived EAP packet length.
respPointer to EAP packet formed <EAPHdr,Type,SubType,Payload>.
respLenEAP payload length.
stateEAP SM state returned.
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_SIMSendStartReq
EAP_SIMSendChallengeReq
EAP_SIMSendNotificationReq
EAP_SIMSendReauthReq

eap_sim.h

◆ EAP_AKASendChallengeReq()

MOC_EXTERN MSTATUS EAP_AKASendChallengeReq ( eapSimCb *  eapSim,
ubyte **  pkt,
ubyte4 *  pktLen,
ubyte *  rand,
ubyte *  autn,
ubyte *  ck,
ubyte *  ik,
ubyte *  res,
ubyte2  resLen,
ubyte *  at_next_psuedo,
ubyte2  at_psuedo_len,
ubyte *  at_next_reauthid,
ubyte2  at_reauthid_len,
ubyte  id 
)

Generate EAP-AKA Challenge Request packet to send to the Peer.

Since
1.41
Version
1.41 and later

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

  • __ENABLE_MOCANA_EAP_SIM__

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

  • __ENABLE_MOCANA_EAP_PEER__
  • __ENABLE_MOCANA_EAP_AUTH__

eap_sim.h

Parameters
eapSimEAP SIM Session Handle.
pktPointer to EAP packet formed <EAPHdr,Type,SubType,Payload>.
pktLenEAP payload length.
randRandom bytes 16 bytes received from AuC.
autnAutn value received from AuC 16 Bytes.
ckCK value received from AuC 16 Bytes.
ikIK value received from AuC 16 Bytes.
resRES value received from AuC (32 to 128 Bits).
resLenRES length (32 to 128 Bits).
at_next_psuedoPseudo identity to send to the peer.
at_psuedo_lenNumber of bytes in pseudo identity (at_next_psuedo).
at_next_reauthidNext reauth ID.
at_reauthid_lenNext reauth ID length.
idEAP packet ID.
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_AKASendIdentityReq
EAP_SIMSendChallengeReq
EAP_SIMSendNotificationReq
EAP_SIMSendReauthReq

eap_sim.h

◆ EAP_AKASendIdentityReq()

MOC_EXTERN MSTATUS EAP_AKASendIdentityReq ( eapSimCb *  eapSim,
ubyte **  pkt,
ubyte4 *  pktLen,
ubyte  id_type,
ubyte  id 
)

Generate EAP-AKA Identity Request Packet to send to the Peer.

Since
1.41
Version
1.41 and later

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

  • __ENABLE_MOCANA_EAP_SIM__

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

  • __ENABLE_MOCANA_EAP_PEER__
  • __ENABLE_MOCANA_EAP_AUTH__

eap_sim.h

Parameters
eapSimEAP SIM Session Handle.
pktPointer to EAP packet formed <EAPHdr,Type,SubType,Payload>.
pktLenEAP payload length.
id_typeID type to send (PERM,FULL,ANY ID)
idEAP packet ID.
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_SIMSendChallengeReq
EAP_SIMSendNotificationReq
EAP_SIMSendReauthReq

eap_sim.h

◆ EAP_SIMDeleteSession()

MOC_EXTERN MSTATUS EAP_SIMDeleteSession ( eapSimCb *  eapSim)

This function deletes an EAP-SIM connection.

Since
1.41
Version
1.41 and later

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

  • __ENABLE_MOCANA_EAP_SIM__

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

  • __ENABLE_MOCANA_EAP_PEER__
  • __ENABLE_MOCANA_EAP_AUTH__

eap_sim.h

Parameters
eapSimEAP-SIM session handle returned from EAP_SIMInitSession.
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_sim.h

◆ EAP_SIMGetClientErrorCode()

MOC_EXTERN MSTATUS EAP_SIMGetClientErrorCode ( eapSimCb *  eapSim,
ubyte2 *  clCode 
)

This function (typically called by the authenticator) retrieves the client error code returned by the peer for the specified EAP-SIM session.

Since
1.41
Version
1.41 and later

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

  • __ENABLE_MOCANA_EAP_SIM__

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

  • __ENABLE_MOCANA_EAP_PEER__
  • __ENABLE_MOCANA_EAP_AUTH__

eap_sim.h

Parameters
eapSimEAP-SIM session handle returned from EAP_SIMInitSession.
clCodeOn return, pointer to the client error code value.
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_sim.h

◆ EAP_SIMGetIdentity()

MOC_EXTERN MSTATUS EAP_SIMGetIdentity ( eapSimCb *  eapSim,
ubyte **  identity,
ubyte4 *  len 
)

This function (typically called by the authenticator) retrieves the identity returned by the peer for the specified EAP-SIM session. That returned identity can then be used by the authenticator's application-specific logic to decide whether to process the identity, to get the tuple (the RAND, SRES and Kc), or to ask for a different identity from the peer.

Since
1.41
Version
1.41 and later

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

  • __ENABLE_MOCANA_EAP_SIM__

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

  • __ENABLE_MOCANA_EAP_PEER__
  • __ENABLE_MOCANA_EAP_AUTH__

eap_sim.h

Parameters
eapSimEAP-SIM session handle returned from EAP_SIMInitSession.
identityOn return, pointer to peer's identity.
lenOn return, pointer to number of bytes in peer's ideneity (identity).
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_sim.h

◆ EAP_SIMgetKey()

MOC_EXTERN MSTATUS EAP_SIMgetKey ( eapSimCb *  eapSim,
eapSimKeyType  keyType,
ubyte **  key,
ubyte4 *  keyLen 
)

This function (called by the authenticator or peer) retrieves the specified type of EAP-SIM session key.

Since
2.02
Version
2.02 and later

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

  • __ENABLE_MOCANA_EAP_SIM__

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

  • __ENABLE_MOCANA_EAP_PEER__
  • __ENABLE_MOCANA_EAP_AUTH__

eap_sim.h

Parameters
eapSimEAP-SIM session handle returned from EAP_SIMInitSession.
keyTypeAny of the eapSimKeyType enumerated values (defined in eap_sim.h).
keyOn return, pointer to the key.
keyLenOn return, pointer to the number of bytes in the key (key).
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_sim.h

◆ EAP_SIMGetNotification()

MOC_EXTERN MSTATUS EAP_SIMGetNotification ( eapSimCb *  eapSim,
ubyte2 *  notifCode 
)

This function (typically called by the peer) retrieves the notification code received from the authenticator for the specified EAP-SIM session.

Since
1.41
Version
1.41 and later

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

  • __ENABLE_MOCANA_EAP_SIM__

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

  • __ENABLE_MOCANA_EAP_PEER__
  • __ENABLE_MOCANA_EAP_AUTH__

eap_sim.h

Parameters
eapSimEAP-SIM session handle returned from EAP_SIMInitSession.
notifCodeOn return, pointer to notification code value.
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_sim.h

◆ EAP_SIMGetResultInd()

MOC_EXTERN MSTATUS EAP_SIMGetResultInd ( void *  eap_sim,
ubyte *  rInd 
)

This function, called by the authenticator or peer, determines whether the peer or authenticator, respectively, sent the RESULT_IND attribute during challenge negotiation. If the result indication attribute is sent by either side, SUCCESS/FALURE is sent by the authenticator in a Notification Request.

Since
1.41
Version
1.41 and later

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

  • __ENABLE_MOCANA_EAP_SIM__

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

  • __ENABLE_MOCANA_EAP_PEER__
  • __ENABLE_MOCANA_EAP_AUTH__

eap_sim.h

Parameters
eap_simEAP-SIM session handle returned from EAP_SIMInitSession.
rIndOn return, pointer to determination value: 1 if the other side sent a RESULT_IND attribute; otherwise 0.
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_sim.h

◆ EAP_SIMGetSelectedVersion()

MOC_EXTERN MSTATUS EAP_SIMGetSelectedVersion ( void *  eap_sim,
ubyte2 *  rVer 
)

This function (called by the peer) retrieves the version that was selected during authenticator-peer version negotiation for the specified EAP-SIM session.

Since
1.41
Version
1.41 and later

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

  • __ENABLE_MOCANA_EAP_SIM__

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

  • __ENABLE_MOCANA_EAP_PEER__
  • __ENABLE_MOCANA_EAP_AUTH__

eap_sim.h

Parameters
eap_simEAP-SIM session handle returned from EAP_SIMInitSession.
rVerOn return, pointer to selected version value.
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_sim.h

◆ EAP_SIMGetSessionStatus()

MOC_EXTERN MSTATUS EAP_SIMGetSessionStatus ( void *  eap_sim,
eapSimStatus *  status 
)

This function retrieves an EAP-SIM session's session status.

Since
1.41
Version
1.41 and later

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

  • __ENABLE_MOCANA_EAP_SIM__

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

  • __ENABLE_MOCANA_EAP_PEER__
  • __ENABLE_MOCANA_EAP_AUTH__

eap_sim.h

Parameters
eap_simEAP-SIM session handle returned from EAP_SIMInitSession.
statusOn return, pointer to the session's status: an eapSimStatus enumeration (see eap_sim.h).
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_sim.h

◆ EAP_SIMGetSuccessNotifCode()

MOC_EXTERN MSTATUS EAP_SIMGetSuccessNotifCode ( void *  eap_sim,
ubyte *  rCode 
)

This function (called by the peer) determines whether the Notification received from the authenticator has the S Bit set (which indicates a Success Notification).

Since
1.41
Version
1.41 and later

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

  • __ENABLE_MOCANA_EAP_SIM__

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

  • __ENABLE_MOCANA_EAP_PEER__
  • __ENABLE_MOCANA_EAP_AUTH__

eap_sim.h

Parameters
eap_simEAP-SIM session handle returned from EAP_SIMInitSession.
rCodeOn return, pointer to determination value: 1 if the S Bit is set; otherwise 0.
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_sim.h

◆ EAP_SIMInitSession()

MOC_EXTERN MSTATUS EAP_SIMInitSession ( void *  appCb,
void **  eapSim,
eapSimConfig  eapSimCfg 
)

This function creates and initializes an EAP-SIM or EAP-AKA session.

Since
1.41
Version
1.41 and later

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

  • __ENABLE_MOCANA_EAP_SIM__

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

  • __ENABLE_MOCANA_EAP_PEER__
  • __ENABLE_MOCANA_EAP_AUTH__

eap_sim.h

Parameters
appCbApplication session handle (cookie given by the application to identify the session).
eapSimOn return, pointer to EAP-SIM/EAP-AKA session handle.
eapSimCfgParameters for the SIM/AKA session to be created.
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_sim.h

◆ EAP_SIMProcessPkt()

MOC_EXTERN MSTATUS EAP_SIMProcessPkt ( eapSimCb *  eapSim,
ubyte *  pkt,
ubyte2  pktLen,
ubyte **  resp,
ubyte4 *  respLen,
eapSimStatus *  state 
)

This function processes a packet received by the specified EAP-SIM session, builds a response (which is returned through the resp parameter), and informs the calling application of the current state (the EAP-SIM state machine's state).

Since
1.41
Version
1.41 and later

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

  • __ENABLE_MOCANA_EAP_SIM__

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

  • __ENABLE_MOCANA_EAP_PEER__
  • __ENABLE_MOCANA_EAP_AUTH__

eap_sim.h

Parameters
eapSimEAP-SIM session handle returned from EAP_SIMInitSession.
pktPointer to packet to process.
pktLenNumber of bytes in packet to process (pkt).
respOn return, pointer to response packet to be transmitted.
respLenOn return, pointer to number of bytes in response packet (resp).
stateOn return, pointer to eapSimStatus enumerated value (refer to eap_sim.h).
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_sim.h

◆ EAP_SIMSendChallengeReq()

MOC_EXTERN MSTATUS EAP_SIMSendChallengeReq ( eapSimCb *  eapSim,
ubyte **  pkt,
ubyte4 *  pktLen,
ubyte *  rand,
ubyte2  num_rand,
ubyte *  kC,
ubyte *  sRes,
ubyte *  at_next_psuedo,
ubyte2  at_psuedo_len,
ubyte *  at_next_reauthid,
ubyte2  at_reauthid_len,
ubyte  id 
)

This function (typically called by the authenticator) builds a Sim Challenge Request packet based on the specified parameters. (For details about how the random numbers and keys are used, refer to the following Web page: http://www.gsm-security.net/faq/gsm-ki-kc-rand-sres.shtml .)

Since
1.41
Version
1.41 and later

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

  • __ENABLE_MOCANA_EAP_SIM__

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

  • __ENABLE_MOCANA_EAP_PEER__
  • __ENABLE_MOCANA_EAP_AUTH__

eap_sim.h

Parameters
eapSimEAP-SIM session handle returned from EAP_SIMInitSession.
pktOn return, pointer to generated EAP-SIM Challenge Request packet.
pktLenOn return, pointer to umber of bytes in generated packet (pkt).
randPointer to 16-byte random number to send to the peer.
num_randNumber of 16-byte random numbers to send, from 1 to 3. (Recommended values are 2 or 3.)
kC64-bit ciphering key used as a session key.
sRes32-bit SRES (signed response) generated by the SIM device.
at_next_psuedoPseudo identity to send to the peer.
at_psuedo_lenNumber of bytes in pseudo identity (at_next_psuedo).
at_next_reauthidReauthorization ID to send to the peer.
at_reauthid_lenNumber of bytes in reauthorization ID (at_next_reauthid).
idEAP request header ID (unique to this session).
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_SIMSendStartReq
EAP_SIMSendNotificationReq
EAP_SIMSendReauthReq

eap_sim.h

◆ EAP_SIMSendNotificationReq()

MOC_EXTERN MSTATUS EAP_SIMSendNotificationReq ( eapSimCb *  eapSim,
ubyte **  pkt,
ubyte4 *  pktLen,
ubyte2  at_counter,
ubyte4  notification_code,
ubyte  id 
)

This function (typically called by the authenticator) builds a Sim Notification Request packet based on the specified parameters.

Since
1.41
Version
1.41 and later

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

  • __ENABLE_MOCANA_EAP_SIM__

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

  • __ENABLE_MOCANA_EAP_PEER__
  • __ENABLE_MOCANA_EAP_AUTH__

eap_sim.h

Parameters
eapSimEAP-SIM session handle returned from EAP_SIMInitSession.
pktOn return, pointer to generated EAP-SIM Notification Request packet.
pktLenOn return, pointer to umber of bytes in generated packet (pkt).
at_counterAT_COUNTER value to send to the peer; once the counter reaches the configurable maximum value, a full authentication instead of a FAST reauthentication is required.
notification_codeNotification code as defined in RFC 4186 (refer to sections 6 and 10.18).
idEAP request header ID (unique to this session).
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_SIMSendStartReq
EAP_SIMSendChallengeReq
EAP_SIMSendReauthReq

eap_sim.h

◆ EAP_SIMSendReauthReq()

MSTATUS EAP_SIMSendReauthReq ( eapSimCb *  eapSim,
ubyte **  pkt,
ubyte4 *  pktLen,
ubyte *  at_next_reauthid,
ubyte2  at_reauthid_len,
ubyte  id 
)

This function builds a SIM FAST Reauthentication Request packet based on the specified parameters. It is used by the SIM authenticator for fast (quick) reauthentication.

Since
2.02
Version
2.02 and later

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

  • __ENABLE_MOCANA_EAP_SIM__

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

  • __ENABLE_MOCANA_EAP_PEER__
  • __ENABLE_MOCANA_EAP_AUTH__

eap_sim.h

Parameters
eapSimEAP-SIM session handle returned from EAP_SIMInitSession.
pktOn return, pointer to generated EAP-SIM Reauthorization Request packet.
pktLenOn return, pointer to umber of bytes in generated packet (pkt).
at_next_reauthidPointer to reauthorization ID to send to the peer.
at_reauthid_lenNumber of bytes in reauthorization ID (at_next_reauthid).
idEAP request header ID (unique to this session).
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_SIMSendStartReq
EAP_SIMSendChallengeReq
EAP_SIMSendNotificationReq

eap_sim.h

◆ EAP_SIMSendStartReq()

MOC_EXTERN MSTATUS EAP_SIMSendStartReq ( eapSimCb *  eapSim,
ubyte **  pkt,
ubyte4 *  pktLen,
ubyte  id_type,
ubyte  id 
)

This function (typically called by the authenticator) builds a Sim Start Request packet based on the specified identity. The resultant packet, returned through the pkt parameter, can then be transmitted by making a call to EAP_ulTransmit.

Since
1.41
Version
1.41 and later

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

  • __ENABLE_MOCANA_EAP_SIM__
  • __ENABLE_MOCANA_EAP_AUTH__

eap_sim.h

Parameters
eapSimEAP-SIM session handle returned from EAP_SIMInitSession.
pktOn return, pointer to generated EAP-SIM Notification Request packet.
pktLenOn return, pointer to umber of bytes in generated packet (pkt).
id_typeAny of the eapSimIdType enumeration values (defined in eap_sim.h):

  • EAP_SIM_PERMANENT_ID_TYPE
  • EAP_SIM_FULLAUTH_ID_TYPE
  • EAP_SIM_FASTREAUTH_ID_TYPE
idEAP request header ID (unique to this session).
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_SIMSendChallengeReq
EAP_SIMSendNotificationReq
EAP_SIMSendReauthReq

eap_sim.h

◆ EAP_SIMSetIdentity()

MOC_EXTERN MSTATUS EAP_SIMSetIdentity ( eapSimCb *  eapSim,
ubyte *  id,
ubyte2  idLen 
)

This function (called by the authenticator or peer) assigns the specified identity value to the specified EAP-SIM session's final identity (used after identity negotiation is complete). The final identity is typically the IMSI (International Mobile Subscriber Identity) or the reauthorization ID negotiated between the peer and authenticator.

Since
1.41
Version
1.41 and later

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

  • __ENABLE_MOCANA_EAP_SIM__

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

  • __ENABLE_MOCANA_EAP_PEER__
  • __ENABLE_MOCANA_EAP_AUTH__

eap_sim.h

Parameters
eapSimEAP-SIM session handle returned from EAP_SIMInitSession.
idPointer to desired final identity.
idLenNumber of bytes in final identity (id).
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.
Remarks
The }final} identity is different from the }permanent} identity, which is typically the IMSI (see EAP_SIMSetPermIdentity).

eap_sim.h

◆ EAP_SIMSetImplementedVersion()

MOC_EXTERN MSTATUS EAP_SIMSetImplementedVersion ( eapSimCb *  eapSim,
ubyte2 *  versionList,
ubyte2  numVersion 
)

This function (called by the authenticator or peer) adds the specified version(s) to the specified EAP-SIM session's list of supported versions. This version information is required during the EAP-SIM Identity phase negotiation, where the first version found to be common to the peer and authenticator is used for communication.

Since
1.41
Version
1.41 and later

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

  • __ENABLE_MOCANA_EAP_SIM__

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

  • __ENABLE_MOCANA_EAP_PEER__
  • __ENABLE_MOCANA_EAP_AUTH__

eap_sim.h

Parameters
eapSimEAP-SIM session handle returned from EAP_SIMInitSession.
versionListPointer to array containing list of versions that the node (calling authenticator or peer) is to support.
numVersionNumber of entries in the versionList array.
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_sim.h

◆ EAP_SIMSetPermIdentity()

MOC_EXTERN MSTATUS EAP_SIMSetPermIdentity ( eapSimCb *  eapSim,
ubyte *  id,
ubyte2  idLen 
)

This function (typically called by the peer) assigns the specified value to the EAP-SIM session's permanent identity. (The IMSI — International Mobile Subscriber Identity — is commonly used as the permanent identity.)

Since
1.41
Version
1.41 and later

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

  • __ENABLE_MOCANA_EAP_SIM__

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

  • __ENABLE_MOCANA_EAP_PEER__
  • __ENABLE_MOCANA_EAP_AUTH__

eap_sim.h

Parameters
eapSimEAP-SIM session handle returned from EAP_SIMInitSession.
idPointer to desired permanent identity.
idLenNumber of bytes in permanent identity (id).
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.
Remarks
The permanent identity is different from the final identity, which is used during identity phase negotiation (see EAP_SIMSetIdentity).

eap_sim.h