![]() |
TrustCore SDK NanoSec API reference
version 7.0
|
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... | |
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.
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__
appSessionHdl | Cookie given by the application to identify the session. |
data | EAP request payload, in the following format: <Type , Chlg Len, Challenge>. |
len | Number of bytes in EAP request payload. |
passwordString | Session password for the response. |
passLen | Number of bytes in passwordString . |
cmp | On return, pointer to challenge comparison result (0 indicates a match). |
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.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.
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__
appSessionHdl | Cookie given by the application to identify the session. |
passwordString | Session password for the response. |
passLen | Number of bytes in passwordString . |
eapRespData | On return, pointer to EAP response payload. |
eapRespLen | On return, pointer to number of bytes in eapRespData . |
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.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.
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__
appSessionHdl | Cookie given by the application to identify the session. |
msgString | Pointer to message data. |
msgLen | Number of bytes in msgString . |
eapReqData | On return, pointer to EAP request payload. |
eapReqLen | On return, pointer to number of bytes in eapReqData . |
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.