![]() |
TrustCore SDK NanoSec API reference
version 7.0
|
Provides EAP-PSK (EAP-Pre-Shared Key) authentication. More...
Functions | |
MOC_EXTERN MSTATUS | EAP_PSKAuthRequestFirst (ubyte *eapPSKHdl, ubyte *rand_s, ubyte *id_s, ubyte2 id_s_len, ubyte **request, ubyte4 *requestLen) |
Forms the First Packet to be sent by the Authenticator. More... | |
MOC_EXTERN MSTATUS | EAP_PSKAuthRequestThird (ubyte *eapPSKHdl, eapPSKResultInd resultInd, ubyte *ext, ubyte2 extLen, ubyte id, ubyte **request, ubyte4 *requestLen) |
Forms the third request packet to be sent by the Authenticator. More... | |
MOC_EXTERN MSTATUS | EAP_PSKDeleteSession (ubyte *eapPSKHdl) |
Deletes the EAP PSK Session. More... | |
MOC_EXTERN MSTATUS | EAP_PSKgetEXT (ubyte *eapPSKHdl, ubyte **ext, ubyte2 *extLen) |
Returns the EXTENSION data received. More... | |
MOC_EXTERN MSTATUS | EAP_PSKgetID_P (ubyte *eapPSKHdl, ubyte **id_p, ubyte2 *id_p_len) |
Returns the ID_P received from the Peer. More... | |
MOC_EXTERN MSTATUS | EAP_PSKgetID_S (ubyte *eapPSKHdl, ubyte **id_s, ubyte2 *id_s_len) |
Returns the ID_S received from the Authenticator. More... | |
MOC_EXTERN MSTATUS | EAP_PSKgetKeys (ubyte *eapPSKHdl, ubyte **tek, ubyte **msk, ubyte **emsk) |
Returns the generated session keys. More... | |
MOC_EXTERN MSTATUS | EAP_PSKgetResultInd (ubyte *eapPSKHdl, eapPSKResultInd *resInd) |
Returns the result indication received. More... | |
MOC_EXTERN MSTATUS | EAP_PSKInitSession (ubyte *appSessionHdl, ubyte **eapPSKHdl, eapPSKConfig eapPSKCfg) |
Inits the EAP PSK Session. More... | |
MOC_EXTERN MSTATUS | EAP_PSKKeySetup (ubyte *eapPSKHdl, ubyte *psk) |
Generates the AK/KDK Based upon PSK. More... | |
MOC_EXTERN MSTATUS | EAP_PSKPeerReplyFourth (ubyte *eapPSKHdl, eapPSKResultInd resultInd, ubyte *ext, ubyte2 extLen, ubyte id, ubyte **reply, ubyte4 *replyLen) |
Forms the fourth reply packet to be sent by the Peer. More... | |
MOC_EXTERN MSTATUS | EAP_PSKPeerReplySecond (ubyte *eapPSKHdl, ubyte *rand_p, ubyte *id_p, ubyte2 id_p_len, ubyte **reply, ubyte4 *replyLen) |
Forms the Second Packet to be sent by the Peer. More... | |
MOC_EXTERN MSTATUS | EAP_PSKProcessMsg (ubyte *eapPSKHdl, ubyte *data, ubyte4 dataLen, ubyte id) |
Processes the incoming EAP PSK data message. More... | |
MOC_EXTERN MSTATUS EAP_PSKAuthRequestFirst | ( | ubyte * | eapPSKHdl, |
ubyte * | rand_s, | ||
ubyte * | id_s, | ||
ubyte2 | id_s_len, | ||
ubyte ** | request, | ||
ubyte4 * | requestLen | ||
) |
Forms the First Packet to be sent by the Authenticator.
To enable this function, the following flags must be defined in moptions.h:
__ENABLE_MOCANA_EAP_PSK__
__ENABLE_MOCANA_EAP_AUTH__
eapPSKHdl | EAP PSK Session Handle. |
rand_s | 16 Byte Rand Generated by the Authenticator. |
id_s | ID of the Authenticator to be sent. |
id_s_len | Number of bytes in id_s . |
request | Pointer to the buffer where the request is stored. Application needs to delete it after use. |
requestLen | Request buffer length (request ). |
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_PSKAuthRequestThird | ( | ubyte * | eapPSKHdl, |
eapPSKResultInd | resultInd, | ||
ubyte * | ext, | ||
ubyte2 | extLen, | ||
ubyte | id, | ||
ubyte ** | request, | ||
ubyte4 * | requestLen | ||
) |
Forms the Third request to be sent by the Authenticator after receving the second packet from the Peer.
To enable this function, the following flags must be defined in moptions.h:
__ENABLE_MOCANA_EAP_PSK__
__ENABLE_MOCANA_EAP_AUTH__
eapPSKHdl | EAP PSK Session Handle. |
resultInd | Result indication to be sent to the Peer. |
ext | Any EXTENSION data to be sent to the Peer. |
extLen | EXTENSION data Length (ext ). |
id | EAP ID from the received EAP header for calculation of channel. |
request | Pointer to the buffer where the request is stored. Application needs to delete it after use. |
requestLen | Request Buffer Length (request ). |
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_PSKDeleteSession | ( | ubyte * | eapPSKHdl | ) |
Deletes the EAP PSK Session.
To enable this function, the following flag must be defined in moptions.h:
__ENABLE_MOCANA_EAP_PSK__
Additionally, at least one of the following flags must be defined in moptions.h:
__ENABLE_MOCANA_EAP_PEER__
__ENABLE_MOCANA_EAP_AUTH__
eapPSKHdl | Pointer to EAP PSK Session Handle. |
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_PSKgetEXT | ( | ubyte * | eapPSKHdl, |
ubyte ** | ext, | ||
ubyte2 * | extLen | ||
) |
Returns the EXTENSION data received.
To enable this function, the following flag must be defined in moptions.h:
__ENABLE_MOCANA_EAP_PSK__
Additionally, at least one of the following flags must be defined in moptions.h:
__ENABLE_MOCANA_EAP_PEER__
__ENABLE_MOCANA_EAP_AUTH__
eapPSKHdl | EAP PSK Session Handle. |
ext | On return, pointer to the EXTENSION data. |
extLen | On return, pointer to the length of ext . |
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_PSKgetID_P | ( | ubyte * | eapPSKHdl, |
ubyte ** | id_p, | ||
ubyte2 * | id_p_len | ||
) |
Returns the ID_P received from the Peer.
To enable this function, the following flag must be defined in moptions.h:
__ENABLE_MOCANA_EAP_PSK__
Additionally, at least one of the following flags must be defined in moptions.h:
__ENABLE_MOCANA_EAP_PEER__
__ENABLE_MOCANA_EAP_AUTH__
eapPSKHdl | EAP PSK Session Handle. |
id_p | On return, pointer to the ID_P. |
id_p_len | On return, pointer to the length of id_p . |
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_PSKgetID_S | ( | ubyte * | eapPSKHdl, |
ubyte ** | id_s, | ||
ubyte2 * | id_s_len | ||
) |
Returns the ID_S received from the Authenticator.
To enable this function, the following flag must be defined in moptions.h:
__ENABLE_MOCANA_EAP_PSK__
Additionally, at least one of the following flags must be defined in moptions.h:
__ENABLE_MOCANA_EAP_PEER__
__ENABLE_MOCANA_EAP_AUTH__
eapPSKHdl | EAP PSK Session Handle. |
id_s | On return, pointer to the ID_S. |
id_s_len | On return, pointer to the length of id_s . |
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_PSKgetKeys | ( | ubyte * | eapPSKHdl, |
ubyte ** | tek, | ||
ubyte ** | msk, | ||
ubyte ** | emsk | ||
) |
Returns the generated keys for the session.
To enable this function, the following flag must be defined in moptions.h:
__ENABLE_MOCANA_EAP_PSK__
Additionally, at least one of the following flags must be defined in moptions.h:
__ENABLE_MOCANA_EAP_PEER__
__ENABLE_MOCANA_EAP_AUTH__
eapPSKHdl | EAP PSK Session Handle. |
tek | On return, pointer to the TEK (16 bytes). |
msk | On return, pointer to the MSK (64 Bytes). |
emsk | On return, pointer to the EMSK (64bytes). |
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_PSKgetResultInd | ( | ubyte * | eapPSKHdl, |
eapPSKResultInd * | resInd | ||
) |
Returns the result indication received.
To enable this function, the following flag must be defined in moptions.h:
__ENABLE_MOCANA_EAP_PSK__
Additionally, at least one of the following flags must be defined in moptions.h:
__ENABLE_MOCANA_EAP_PEER__
__ENABLE_MOCANA_EAP_AUTH__
eapPSKHdl | EAP PSK Session Handle. |
resInd | On return, pointer to the result indication. |
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_PSKInitSession | ( | ubyte * | appSessionHdl, |
ubyte ** | eapPSKHdl, | ||
eapPSKConfig | eapPSKCfg | ||
) |
Inititializes the EAP PSK Session and Returns the EAP PSK Handle.
To enable this function, the following flag must be defined in moptions.h:
__ENABLE_MOCANA_EAP_PSK__
Additionally, at least one of the following flags must be defined in moptions.h:
__ENABLE_MOCANA_EAP_PEER__
__ENABLE_MOCANA_EAP_AUTH__
appSessionHdl | Application Session Handle. |
eapPSKHdl | Pointer to EAP PSK Session Handle. |
eapPSKCfg | EAP PSK Config params, such as session type, callback function pointer. |
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_PSKKeySetup | ( | ubyte * | eapPSKHdl, |
ubyte * | psk | ||
) |
Generate AK and KDK based upon PSK for the session.
To enable this function, the following flag must be defined in moptions.h:
__ENABLE_MOCANA_EAP_PSK__
Additionally, at least one of the following flags must be defined in moptions.h:
__ENABLE_MOCANA_EAP_PEER__
__ENABLE_MOCANA_EAP_AUTH__
eapPSKHdl | EAP PSK Session Handle. |
psk | Pointer to the 16 Byte PSK. |
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_PSKPeerReplyFourth | ( | ubyte * | eapPSKHdl, |
eapPSKResultInd | resultInd, | ||
ubyte * | ext, | ||
ubyte2 | extLen, | ||
ubyte | id, | ||
ubyte ** | reply, | ||
ubyte4 * | replyLen | ||
) |
Forms the fourth reply to be sent by the Peer after receving the third Packet from the Authenticator.
To enable this function, the following flags must be defined in moptions.h:
__ENABLE_MOCANA_EAP_PSK__
__ENABLE_MOCANA_EAP_PEER__
eapPSKHdl | EAP PSK Session Handle. |
resultInd | Result Indication to be sent to the Authenticator. |
ext | Any EXTENSION data to be sent to the Authenticator. |
extLen | EXTENSION data Length (ext ). |
id | EAP ID from the received EAP header for calculation of channel. |
reply | Pointer to the buffer where the reply is stored. Application needs to delete it after use. |
replyLen | Reply buffer length (reply ). |
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_PSKPeerReplySecond | ( | ubyte * | eapPSKHdl, |
ubyte * | rand_p, | ||
ubyte * | id_p, | ||
ubyte2 | id_p_len, | ||
ubyte ** | reply, | ||
ubyte4 * | replyLen | ||
) |
Forms the Second Reply to be sent by the Peer after receving the first request from the Authenticator.
To enable this function, the following flags must be defined in moptions.h:
__ENABLE_MOCANA_EAP_PSK__
__ENABLE_MOCANA_EAP_PEER__
eapPSKHdl | EAP PSK Session Handle. |
rand_p | 16 Byte random number generated by the Peer. |
id_p | ID of the Peer to be sent. |
id_p_len | Number of bytes in id_p . |
reply | Pointer to the buffer where the reply is stored. Application needs to delete it after use. |
replyLen | Reply buffer length (reply ). |
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_PSKProcessMsg | ( | ubyte * | eapPSKHdl, |
ubyte * | data, | ||
ubyte4 | dataLen, | ||
ubyte | id | ||
) |
Processes the incoming EAP PSK message and verifies the responses and informs the application about the state change and status.
To enable this function, the following flag must be defined in moptions.h:
__ENABLE_MOCANA_EAP_PSK__
Additionally, at least one of the following flags must be defined in moptions.h:
__ENABLE_MOCANA_EAP_PEER__
__ENABLE_MOCANA_EAP_AUTH__
eapPSKHdl | EAP PSK Session Handle. |
data | Incoming PSK data. |
dataLen | Number of bytes in data . |
id | EAP ID from the received EAP header for calculation of channel. |
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.