TrustCore SDK NanoSec API reference  version 7.0
EAP-GTC Functions

Provides EAP-GTC (EAP-generic token card) authentication. More...

Functions

MOC_EXTERN MSTATUS EAP_GTCProcessAuth (ubyte *appSessionHdl, ubyte *data, ubyte4 len, ubyte *passwordString, ubyte4 passLen, sbyte4 *cmp)
 Validate a token response. More...
 
MOC_EXTERN MSTATUS EAP_GTCProcessPeer (ubyte *appSessionHdl, ubyte *passwordString, ubyte4 passLen, ubyte **eapRespData, ubyte4 *eapRespLen)
 Generate a token response. More...
 
MOC_EXTERN MSTATUS EAP_GTCstartRequest (ubyte *appSessionHdl, ubyte *msgString, ubyte4 msgLen, ubyte **eapReqData, ubyte4 *eapReqLen)
 Builds an EAP request. More...
 

Detailed Description

Function Documentation

◆ EAP_GTCProcessAuth()

MOC_EXTERN MSTATUS EAP_GTCProcessAuth ( ubyte *  appSessionHdl,
ubyte *  data,
ubyte4  len,
ubyte *  passwordString,
ubyte4  passLen,
sbyte4 *  cmp 
)

This function validates a token response, indicating the result by its function return: OK, ERR_EAP_GTC_INVALID_TOKEN_LENGTH, or ERR_EAP_GTC_AUTH_FAILURE. Your application should use this function to process responses received from peers.

Since
1.41
Version
1.41 and later

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

  • __ENABLE_MOCANA_EAP_GTC__

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

  • __ENABLE_MOCANA_EAP_PEER__
  • __ENABLE_MOCANA_EAP_AUTH__

eap_gtc.h

Parameters
appSessionHdlCookie given by the application to identify the session.
dataEAP request payload, in the following format: <Type, Chlg Len, Challenge>.
lenNumber of bytes in EAP request payload.
passwordStringSession password for the response.
passLenNumber of bytes in passwordString.
cmpOn return, pointer to challenge comparison result (0 indicates a match).
Returns
One of the following:

  • OK (0) if successful.
  • ERR_EAP_GTC_INVALID_TOKEN_LENGTH if the EAP request's Chlg Len doesn't match the length of the previously sent challenge (as specified by the passLen parameter value).
  • ERR_EAP_GTC_AUTH_FAILURE if the token is invalid.
See also
EAP_GTCstartRequest
EAP_GTCProcessAuth

eap_gtc.h

◆ EAP_GTCProcessPeer()

MOC_EXTERN MSTATUS EAP_GTCProcessPeer ( ubyte *  appSessionHdl,
ubyte *  passwordString,
ubyte4  passLen,
ubyte **  eapRespData,
ubyte4 *  eapRespLen 
)

This function generates a token response and returns the resultant EAP payload. Your application should use this function for GTC peer packet processing.

Since
1.41
Version
1.41 and later

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

  • __ENABLE_MOCANA_EAP_GTC__

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

  • __ENABLE_MOCANA_EAP_PEER__
  • __ENABLE_MOCANA_EAP_AUTH__

eap_gtc.h

Parameters
appSessionHdlCookie given by the application to identify the session.
passwordStringSession password for the response.
passLenNumber of bytes in passwordString.
eapRespDataOn return, pointer to EAP response payload.
eapRespLenOn return, pointer to number of bytes in 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.
See also
EAP_GTCstartRequest
EAP_GTCProcessAuth

eap_gtc.h

◆ EAP_GTCstartRequest()

MOC_EXTERN MSTATUS EAP_GTCstartRequest ( ubyte *  appSessionHdl,
ubyte *  msgString,
ubyte4  msgLen,
ubyte **  eapReqData,
ubyte4 *  eapReqLen 
)

This function builds an EAP request based on the specified data.

Since
1.41
Version
1.41 and later

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

  • __ENABLE_MOCANA_EAP_GTC__

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

  • __ENABLE_MOCANA_EAP_PEER__
  • __ENABLE_MOCANA_EAP_AUTH__

eap_gtc.h

Parameters
appSessionHdlCookie given by the application to identify the session.
msgStringPointer to message data.
msgLenNumber of bytes in msgString.
eapReqDataOn return, pointer to EAP request payload.
eapReqLenOn return, pointer to number of bytes in eapReqData.
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_GTCProcessAuth
EAP_GTCProcessPeer

eap_gtc.h