36 #ifndef __EAP_TTLS_H__ 37 #define __EAP_TTLS_H__ 43 #if (defined(__ENABLE_MOCANA_EAP_PEER__) || defined(__ENABLE_MOCANA_EAP_AUTH__)) 44 #if (defined(__ENABLE_MOCANA_EAP_TTLS__)) 47 typedef enum eapTTLSMethodType_e
51 EAP_METHOD_TYPE_MSCHAP,
52 EAP_METHOD_TYPE_MSCHAPV2,
80 typedef struct eap_ttls_params
119 MSTATUS (*ulTransmit)(ubyte * appSessionCB,ubyte * eapPkt,ubyte4 eapPktLen,
120 intBoolean encrypted);
159 MSTATUS (*ul2ndStageReceive)(ubyte * app_session_handle, eapMethodType type,
160 eapCode code, ubyte id, ubyte * eap_data,
161 ubyte4 eap_data_len, ubyte * opaque_data);
192 MSTATUS (*ulAuthTransmit)(ubyte *appSessionCB,
193 ubyte *eapTTLSCb, ubyte *pkt, ubyte4 pktLen);
226 MSTATUS (*ulAuthResultTransmit)(ubyte * appSessionCB, eapAuthStatus authStatus);
234 ubyte UserName[EAP_MAX_USER_LEN];
247 ubyte Password[EAP_MAX_PASS_LEN];
260 ubyte radiusSecret[EAP_MAX_PASS_LEN];
426 #if (defined(__ENABLE_MOCANA_EAP_AUTH__)) 512 MOC_EXTERN MSTATUS
EAP_TTLSFormSendPacket(
void *eapTTLSCb, ubyte *pkt, ubyte4 pktLen, ubyte **eapResponse, ubyte4 *eapRespLen);
634 MOC_EXTERN MSTATUS
EAP_TTLSgetKey(
void *eapCb,ubyte *key,ubyte2 keyLen);
676 MOC_EXTERN MSTATUS
EAP_TTLSulPeerTransmit(ubyte * eapSessionHdl, ubyte4 instanceId, eapMethodType methodType, eapCode code, eapMethodDecision methodDecision, eapMethodState methodState, ubyte * eap_data, ubyte4 eap_data_len);
678 #if (defined(__ENABLE_MOCANA_INNER_APP__)) 718 MOC_EXTERN MSTATUS
EAP_TTLSsendAlert(ubyte * eapSessionHdl,sbyte4 alertClass,sbyte4 alertId);
764 ubyte *data, ubyte4 len,
765 InnerAppType innerApp,ubyte **eapRespData, ubyte4 *eapRespLen);
sbyte4 connectionInstance
TLS connection's session ID.
Definition: eap_ttls.h:299
MOC_EXTERN MSTATUS EAP_TTLSulPeerTransmit(ubyte *eapSessionHdl, ubyte4 instanceId, eapMethodType methodType, eapCode code, eapMethodDecision methodDecision, eapMethodState methodState, ubyte *eap_data, ubyte4 eap_data_len)
Transmit (send) an EAP response to the authenticator.
MOC_EXTERN MSTATUS EAP_TTLSProcessRadiusAuthResponse(void *eapCb, RADIUS_RqstRecord *pRadiusResp)
Process a received RADIUS packet and respond appropriately.
MOC_EXTERN MSTATUS EAP_TTLSsendAlert(ubyte *eapSessionHdl, sbyte4 alertClass, sbyte4 alertId)
Build a TLS Alert Message to be sent over EAP.
ubyte2 PasswordLen
Number of bytes in the inner method password (Password).
Definition: eap_ttls.h:252
MOC_IP_ADDRESS myaddr
NAS (network authentication server) IP address.
Definition: eap_ttls.h:323
ubyte * tls_con
EAP_TLS connection control block.
Definition: eap_ttls.h:308
ubyte4 authServerId
RADIUS server ID; used by the authenticator to send a RADIUS packet to the RADIUS server...
Definition: eap_ttls.h:316
MOC_EXTERN MSTATUS EAP_TTLSSendData(ubyte *ttls_connection, ubyte *data, ubyte4 len, InnerAppType innerApp, ubyte **eapRespData, ubyte4 *eapRespLen)
Send data using the TLS inner application extension.
ubyte4 instanceId
Phase 1 instance ID.
Definition: eap_ttls.h:272
MOC_EXTERN MSTATUS EAP_TTLSgetSessionStatus(void *eapTTLSCb, ubyte *eapSessionStatus)
Get an EAP-TTLS session's session status.
eapSessionType sessionType
Type of session: EAP_SESSION_TYPE_PEER or EAP_SESSION_TYPE_AUTHENTICATOR.
Definition: eap_ttls.h:284
MOC_EXTERN MSTATUS EAP_TTLSFormSendPacket(void *eapTTLSCb, ubyte *pkt, ubyte4 pktLen, ubyte **eapResponse, ubyte4 *eapRespLen)
Build the second stage payload.
MOC_EXTERN MSTATUS EAP_TTLSreceiveLLPacket(void *eapTTLSCb, ubyte *pkt, ubyte4 pktLen)
Process second stage packets.
ubyte2 UserNameLen
Number of bytes in the inner method user name (UserName).
Definition: eap_ttls.h:239
MOC_EXTERN MSTATUS EAP_TTLSinitSession(ubyte *appSessionCB, ubyte **eapTTLSSession, EAP_TTLS_params *eapTTLSparams)
Create and initialize a second stage TTLS session as a peer or passthrough authenticator.
ubyte version
TTLS version: 0 or 1.
Definition: eap_ttls.h:330
Configuration settings and callback function pointers for EAP-TTLS sessions.
Definition: eap_ttls.h:80
MOC_EXTERN MSTATUS EAP_TTLSgetKey(void *eapCb, ubyte *key, ubyte2 keyLen)
Generate a session key.
ubyte2 radiusSecretLen
Number of bytes in the RADIUS shared secret (radiusSecret).
Definition: eap_ttls.h:266
MOC_EXTERN MSTATUS EAP_TTLSdeleteSession(void *eapTTLSSession)
Delete a second (upper) stage EAP TTLS session.
eapTTLSMethodType methodType
Method type used by a peer.
Definition: eap_ttls.h:291