TrustCore SDK NanoSec API reference  version 7.0
EAP-SRP Functions

Provides EAP-SRP (EAP-secure remote password) authentication. More...

Functions

MOC_EXTERN MSTATUS EAP_SRPbuildChallenge (ubyte *eapSessionHdl, ubyte4 instanceId, ubyte *username, ubyte4 usernameLen, ubyte *password, ubyte4 passwordLen, eapMethodType *method_type, ubyte **reqData, ubyte4 *reqLen)
 Generate an SRP challenge packet. More...
 
MOC_EXTERN MSTATUS EAP_SRPbuildLightweightChallenge (ubyte *eapSessionHdl, ubyte4 instanceId, eapMethodType *method_type, ubyte **reqData, ubyte4 *reqLen)
 Build an EAP-SRP lightweight challenge packet for reauthentication. More...
 
MOC_EXTERN MSTATUS EAP_SRPprocessAuth (ubyte *appSessionHdl, ubyte *eapSessionHdl, ubyte4 instanceId, ubyte id, ubyte *data, ubyte4 len, ubyte *passwordString, ubyte4 passLen, ubyte **eapRespData, ubyte4 *eapRespLen, ubyte *code)
 Get the EAP payload from a message received by an SRP authenticator. More...
 
MOC_EXTERN MSTATUS EAP_SRPprocessPeer (ubyte *appSessionHdl, ubyte *eapSessionHdl, ubyte4 instanceId, ubyte id, ubyte *data, ubyte4 len, ubyte *username, ubyte4 usernameLen, ubyte *passwordString, ubyte4 passLen, ubyte **eapRespData, ubyte4 *eapRespLen)
 Get the EAP payload from an SRP-SHA1 message received by an SRP peer. More...
 

Detailed Description

Function Documentation

◆ EAP_SRPbuildChallenge()

MOC_EXTERN MSTATUS EAP_SRPbuildChallenge ( ubyte *  eapSessionHdl,
ubyte4  instanceId,
ubyte *  username,
ubyte4  usernameLen,
ubyte *  password,
ubyte4  passwordLen,
eapMethodType *  method_type,
ubyte **  reqData,
ubyte4 *  reqLen 
)

This function generates an SRP challenge and builds an EAP_SRP_CHALLENGE packet (which is returned through the reqData parameter). The SRP authenticator uses this function after it receives an identity response 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_SRP__

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

  • __ENABLE_MOCANA_EAP_PEER__
  • __ENABLE_MOCANA_EAP_AUTH__

eap_srp.h

Parameters
eapSessionHdlEAP session handle returned from EAP_sessionCreate.
instanceIdEAP instance ID returned from EAP_initInstance.
usernameUser name.
usernameLenNumber of bytes in user name.
passwordSession password for the response.
passwordLenNumber of bytes in password.
method_typeOn return, pointer to method type to include in response packet (see eapMethodType enumerated values in eap_proto.h).
reqDataOn return, pointer to generated EAP packet.
reqLenOn return, pointer to number of bytes in generated EAP packet (reqData).
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_srp.h

◆ EAP_SRPbuildLightweightChallenge()

MOC_EXTERN MSTATUS EAP_SRPbuildLightweightChallenge ( ubyte *  eapSessionHdl,
ubyte4  instanceId,
eapMethodType *  method_type,
ubyte **  reqData,
ubyte4 *  reqLen 
)

This function builds an EAP-SRP lightweight challenge packet at the authenticator for reauthentication. (For information about lightweight challenges, refer to the following RFC Draft: http://www3.ietf.org/proceedings/01dec/I-D/draft-ietf-pppext-eap-srp-03.txt )

Since
1.41
Version
1.41 and later

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

  • __ENABLE_MOCANA_EAP_SRP__

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

  • __ENABLE_MOCANA_EAP_PEER__
  • __ENABLE_MOCANA_EAP_AUTH__

eap_srp.h

Parameters
eapSessionHdlEAP session handle returned from EAP_sessionCreate.
instanceIdEAP instance ID returned from EAP_initInstance.
method_typeOn return, pointer to method type to include in response packet (see eapMethodType enumerated values in eap_proto.h).
reqDataOn return, pointer to generated EAP packet.
reqLenOn return, pointer to number of bytes in generated EAP packet (reqData).
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_srp.h

◆ EAP_SRPprocessAuth()

MOC_EXTERN MSTATUS EAP_SRPprocessAuth ( ubyte *  appSessionHdl,
ubyte *  eapSessionHdl,
ubyte4  instanceId,
ubyte  id,
ubyte *  data,
ubyte4  len,
ubyte *  passwordString,
ubyte4  passLen,
ubyte **  eapRespData,
ubyte4 *  eapRespLen,
ubyte *  code 
)

This function processes a message received by an SRP authenticator and returns the resultant EAP payload through the eapRespData parameter. Additionally, the response status is returned (through the code parameter), which your application should use to update the EAP processing state machine variables, methodState and decision, according to application requirements.

Since
1.41
Version
1.41 and later

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

  • __ENABLE_MOCANA_EAP_SRP__

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

  • __ENABLE_MOCANA_EAP_PEER__
  • __ENABLE_MOCANA_EAP_AUTH__

eap_srp.h

Parameters
appSessionHdlCookie given by the application to identify the session.
eapSessionHdlEAP session handle returned from EAP_sessionCreate.
instanceIdEAP instance ID returned from EAP_initInstance.
idEAP packet ID.
dataEAP payload to process.
lenNumber of bytes in EAP payload (data).
passwordStringSession password for the response.
passLenNumber of bytes in session password (passwordString).
eapRespDataOn return, pointer to EAP response payload.
eapRespLenOn return, pointer to number of bytes in EAP response payload (eapRespData).
codeOn return, pointer to response status to include in response packet (one of the eapCode enumerated values in eap_proto.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_srp.h

◆ EAP_SRPprocessPeer()

MOC_EXTERN MSTATUS EAP_SRPprocessPeer ( ubyte *  appSessionHdl,
ubyte *  eapSessionHdl,
ubyte4  instanceId,
ubyte  id,
ubyte *  data,
ubyte4  len,
ubyte *  username,
ubyte4  usernameLen,
ubyte *  passwordString,
ubyte4  passLen,
ubyte **  eapRespData,
ubyte4 *  eapRespLen 
)

This function processes a message received by an SRP peer and returns the resultant EAP payload through the eapRespData parameter.

Since
1.41
Version
1.41 and later

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

  • __ENABLE_MOCANA_EAP_SRP__

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

  • __ENABLE_MOCANA_EAP_PEER__
  • __ENABLE_MOCANA_EAP_AUTH__

eap_srp.h

Parameters
appSessionHdlCookie given by the application to identify the session.
eapSessionHdlEAP session handle returned from EAP_sessionCreate.
instanceIdEAP instance ID returned from EAP_initInstance.
idEAP packet ID.
dataEAP payload to process.
lenNumber of bytes in EAP payload (data).
usernameUser name.
usernameLenNumber of bytes in user name (username).
passwordStringSession password for the response.
passLenNumber of bytes in session password (passwordString).
eapRespDataOn return, pointer to EAP response payload.
eapRespLenOn return, pointer to number of bytes in EAP response payload (eapRespData).
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_srp.h