35 #ifndef __EAP_FAST_H__ 36 #define __EAP_FAST_H__ 42 #if (defined(__ENABLE_MOCANA_EAP_PEER__) || defined(__ENABLE_MOCANA_EAP_AUTH__)) 43 #if (defined(__ENABLE_MOCANA_EAP_FAST__) || defined(__ENABLE_MOCANA_EAP_PEAPV2__)) 45 #define EAP_FAST_LENGTH_INCLUDED_FLAG (0x80) 46 #define EAP_FAST_MORE_FRAGMENTS_FLAG (0x40) 47 #define EAP_FAST_START_FLAG (0x20) 48 #define EAP_FAST_AUTH_ID_TYPE (0x04) 52 #define EAP_FAST_RESULT_TLV_SUCCESS 1 53 #define EAP_FAST_RESULT_TLV_FAILURE 2 55 #define EAP_MAX_USER_LEN (64) 56 #define EAP_MAX_PASS_LEN (64) 57 #define EAP_FAST_PAC_KEY_LENGTH 32 60 typedef enum eap_fast_frag_flag
62 EAP_FAST_FRAG_FLAG_RECV = 1,
63 EAP_FAST_FRAG_FLAG_SEND
65 } eap_fast_frag_flag_e;
68 typedef enum eap_fast_intermediate_result
70 EAP_FAST_INTERMEDIATE_SUCCESS = 1,
71 EAP_FAST_INTERMEDIATE_FAILURE
73 } eap_fast_intermediate_result_e;
76 typedef enum eap_fast_eap_state_e
78 EAP_FAST_EAP_INIT = 0,
79 EAP_FAST_EAP_IDENTITY = 1,
80 EAP_FAST_EAP_METHOD = 2,
81 EAP_FAST_EAP_SUCCESS = 3,
82 EAP_FAST_EAP_FAILURE = 4,
106 typedef struct eap_fast_params
145 MSTATUS (*ulTransmit)(ubyte * appSessionCB,ubyte * eapPkt,ubyte4 eapPktLen,intBoolean encrypted);
184 MSTATUS (*ul2ndStageReceive)(ubyte *appSessionCB, eapMethodType type,
185 eapCode code, ubyte id,
186 ubyte *eap_data, ubyte4 eap_data_len, ubyte *opaque_data);
214 MSTATUS (*ulGetFastCompoundKey)(ubyte *appSessionCB, ubyte *cmk);
244 MSTATUS (*ulGetPeapV2CompoundKey)(ubyte *appSessionCB, ubyte *cmk, ubyte *s_nonce, ubyte *c_nonce);
279 MSTATUS (*ulAuthResultTransmit)(ubyte * appSessionCB,
280 ubyte cryptoBindingVerified,
281 eapAuthStatus authStatus);
307 MSTATUS (*ulTLSclose)(ubyte * appSessionCB);
360 typedef struct eap_fast_pac
362 ubyte pacKey[EAP_FAST_PAC_KEY_LENGTH];
420 ubyte **eapResponse, ubyte4 *eapRespLen);
514 ubyte *compoundKey, ubyte2 result,ubyte *nonce);
632 EAP_FASTAuthInit(ubyte *eapCb);
775 eap_FASTPeerInit(ubyte *eapCb);
924 EAP_FASTGetPAC(ubyte *eapFASTCb, EAP_FAST_pac_t **pac);
1012 eapMethodType methodType,
1014 eapMethodDecision methodDecision,
1015 eapMethodState methodState,
1017 ubyte4 eap_data_len);
1072 eapMethodType methodType,
1074 eapMethodDecision methodDecision,
1075 eapMethodState methodState,
1077 ubyte4 eap_data_len);
1081 EAP_FASTauthGetCryptoBindingStatus(ubyte *eapFastSessionHdl,
1082 ubyte *bindingStatus);
1121 EAP_FASTgetAuthId(ubyte *pkt, ubyte4 pktLen, ubyte **authId, ubyte2 *authIdLen);
1170 ubyte **eapReqData, ubyte4 *eapReqLen);
MOC_EXTERN MSTATUS EAP_FASTinitSession(ubyte *appSessionCB, ubyte **eapFASTSession, EAP_FAST_params *eapFASTparams)
Create and initialize an EAP-FAST session.
MOC_EXTERN MSTATUS EAP_FASTauthSendMethodResult(ubyte *appSessionHdl, ubyte sendCryptoBinding, ubyte *compoundKey, ubyte2 result, ubyte *nonce)
Buld a Method Result packet.
MOC_EXTERN MSTATUS EAP_FASTulPeerTransmit(ubyte *eapSessionHdl, ubyte4 instanceId, eapMethodType methodType, eapCode code, eapMethodDecision methodDecision, eapMethodState methodState, ubyte *eap_data, ubyte4 eap_data_len)
Transmit packets from peer to authenticator during second stage negotiation.
MOC_EXTERN MSTATUS EAP_FASTulAuthTransmit(ubyte *eapSessionHdl, ubyte4 instanceId, eapMethodType methodType, eapCode code, eapMethodDecision methodDecision, eapMethodState methodState, ubyte *eap_data, ubyte4 eap_data_len)
Transmit packets from authenticator to peer during second stage negotiation.
MOC_EXTERN MSTATUS EAP_FASTgetTLVEncapEAPPkt(ubyte *eapPkt, ubyte4 eapPktLen, ubyte **response, ubyte4 *responseLen)
Encapsulate an EAP packet into an EAP payload TLV packet.
MOC_EXTERN MSTATUS EAP_FASTPeerGetSessionHdl(ubyte *eapCb, ubyte **eapSessionHdl)
Get an EAP-FAST session's second stage EAP session handle.
ubyte4 instanceId
Phase 1 instance ID.
Definition: eap_fast.h:355
eapSessionType sessionType
Type of session: EAP_SESSION_TYPE_PEER or EAP_SESSION_TYPE_AUTHENTICATOR.
Definition: eap_fast.h:325
eapMethodType methodType
Method type used by a peer.
Definition: eap_fast.h:332
MOC_EXTERN MSTATUS EAP_FASTProcessTLV(ubyte *fastHdl, ubyte *pPkt, ubyte4 pktLen)
Process a decrypted EAP packet's TLVs.
MOC_EXTERN MSTATUS EAP_FASTEncapEAPPkt(ubyte *eapFastCb, ubyte *eapPkt, ubyte4 eapPktLen)
Build an EAP payload TLV from an input second stage EAP packet and then pass the packet to the first ...
sbyte4 connectionInstance
TLS connection's session ID.
Definition: eap_fast.h:340
MOC_EXTERN MSTATUS EAP_FASTAuthInit2(ubyte *eapCb)
Send an Identity request to the peer.
MOC_EXTERN MSTATUS EAP_FASTbuildAuthId(ubyte flags, ubyte *authId, ubyte2 authIdLen, ubyte **eapReqData, ubyte4 *eapReqLen)
Build an Authority ID Requeest packet.
Configuration settings and callback function pointers for EAP-FAST sessions.
Definition: eap_fast.h:106
ubyte * tls_con
EAP_TLS connection control block.
Definition: eap_fast.h:349
MOC_EXTERN MSTATUS EAP_FASTgetAuthId(ubyte *pkt, ubyte4 pktLen, ubyte **authId, ubyte2 *authIdLen)
Extract the authority ID (if any) from an EAP-FAST packet.
MOC_EXTERN MSTATUS EAP_FASTulAuthSessionDelete(ubyte *eapFASTCb)
Delete an EAP-FAST authenticator second stage stack.
MOC_EXTERN MSTATUS EAP_FASTulPeerSessionDelete(ubyte *eapFASTCb)
Delete an EAP-FAST peer second stage stack.
MOC_EXTERN MSTATUS EAP_FASTauthSendPAC_ResultTlv(ubyte *eapFastSessionHdl, EAP_FAST_pac_t *pac)
Transmits Result and PAC Provisioning TLVs to the peer.
ubyte version
EAP-FAST version.
Definition: eap_fast.h:313
MOC_EXTERN MSTATUS EAP_FASTauthSendCryptoBindingTlv(ubyte *appSessionHdl, ubyte *cmk, ubyte *nonce)
Transmits Result and crypto binding TLVs to the peer.
MOC_EXTERN MSTATUS EAP_FASTFormSendPacket(void *eapFASTCb, ubyte *pkt, ubyte4 pktLen, ubyte **eapResponse, ubyte4 *eapRespLen)
Build an EAP-FAST packet from the specified encrypted second stage payload.
MOC_EXTERN MSTATUS EAP_FASTAuthGetSessionHdl(ubyte *eapCb, ubyte **eapAuthSessionHdl)
Get an EAP-FAST session's second stage EAP session handle.
MOC_EXTERN MSTATUS EAP_FASTreceiveLLPacket(void *eapFASTCb, ubyte *pkt, ubyte4 pktLen)
Process a packet's TLVs, managing fragmentation, and send the packet on for second stage negotiation...
MOC_EXTERN MSTATUS EAP_FASTdeleteSession(ubyte *eapFASTSession)
Delete a second stage EAP-FAST session.