802.1X authenticator More...
#include "eap/eap.h"
#include "eap/eap_full_auth_fsm.h"
#include "authenticator/authenticator_pae_fsm.h"
#include "authenticator/authenticator_backend_fsm.h"
#include "authenticator/authenticator_reauth_timer_fsm.h"
#include "mac/hmac.h"
Go to the source code of this file.
Data Structures | |
struct | AuthenticatorStats |
Statistics information. More... | |
struct | AuthenticatorSessionStats |
Session statistics information. More... | |
struct | _AuthenticatorPort |
Port context. More... | |
struct | AuthenticatorSettings |
802.1X authenticator settings More... | |
struct | _AuthenticatorContext |
802.1X authenticator context More... | |
Typedefs | |
typedef void(* | AuthenticatorPaeStateChangeCallback) (AuthenticatorPort *port, AuthenticatorPaeState state) |
Authenticator PAE state change callback function. More... | |
typedef void(* | AuthenticatorBackendStateChangeCallback) (AuthenticatorPort *port, AuthenticatorBackendState state) |
Backend authentication state change callback function. More... | |
typedef void(* | AuthenticatorReauthTimerStateChangeCallback) (AuthenticatorPort *port, AuthenticatorReauthTimerState state) |
Reauthentication timer state change callback function. More... | |
typedef void(* | EapFullAuthStateChangeCallback) (AuthenticatorPort *port, EapFullAuthState state) |
EAP full authenticator state change callback function. More... | |
typedef void(* | AuthenticatorTickCallback) (AuthenticatorContext *context) |
Tick callback function. More... | |
Functions | |
void | authenticatorGetDefaultSettings (AuthenticatorSettings *settings) |
Initialize settings with default values. More... | |
error_t | authenticatorInit (AuthenticatorContext *context, const AuthenticatorSettings *settings) |
Initialize 802.1X authenticator context. More... | |
error_t | authenticatorSetServerAddr (AuthenticatorContext *context, const IpAddr *serverIpAddr, uint16_t serverPort) |
Specify the IP address of the RADIUS server. More... | |
error_t | authenticatorSetServerKey (AuthenticatorContext *context, const uint8_t *key, size_t keyLen) |
Set RADIUS server's key. More... | |
error_t | authenticatorInitPort (AuthenticatorContext *context, uint_t portIndex) |
Reinitialize the specified port. More... | |
error_t | authenticatorReauthenticate (AuthenticatorContext *context, uint_t portIndex) |
Force the authenticator to reauthenticate the supplicant. More... | |
error_t | authenticatorSetPortControl (AuthenticatorContext *context, uint_t portIndex, AuthenticatorPortMode portControl) |
Set the value of the AuthControlledPortControl parameter. More... | |
error_t | authenticatorSetQuietPeriod (AuthenticatorContext *context, uint_t portIndex, uint_t quietPeriod) |
Set the value of the quietPeriod parameter. More... | |
error_t | authenticatorSetServerTimeout (AuthenticatorContext *context, uint_t portIndex, uint_t serverTimeout) |
Set the value of the serverTimeout parameter. More... | |
error_t | authenticatorSetReAuthEnabled (AuthenticatorContext *context, uint_t portIndex, bool_t reAuthEnabled) |
Set the value of the reAuthEnabled parameter. More... | |
error_t | authenticatorSetReAuthPeriod (AuthenticatorContext *context, uint_t portIndex, uint_t reAuthPeriod) |
Set the value of the reAuthPeriod parameter. More... | |
error_t | authenticatorGetPortControl (AuthenticatorContext *context, uint_t portIndex, AuthenticatorPortMode *portControl) |
Get the current value of the AuthControlledPortControl parameter. More... | |
error_t | authenticatorGetQuietPeriod (AuthenticatorContext *context, uint_t portIndex, uint_t *quietPeriod) |
Get the current value of the quietPeriod parameter. More... | |
error_t | authenticatorGetServerTimeout (AuthenticatorContext *context, uint_t portIndex, uint_t *serverTimeout) |
Get the current value of the serverTimeout parameter. More... | |
error_t | authenticatorGetReAuthEnabled (AuthenticatorContext *context, uint_t portIndex, bool_t *reAuthEnabled) |
Get the current value of the reAuthEnabled parameter. More... | |
error_t | authenticatorGetReAuthPeriod (AuthenticatorContext *context, uint_t portIndex, uint_t *reAuthPeriod) |
Get the current value of the reAuthPeriod parameter. More... | |
error_t | authenticatorGetPortStatus (AuthenticatorContext *context, uint_t portIndex, AuthenticatorPortStatus *portStatus) |
Get the current value of the AuthControlledPortStatus variable. More... | |
error_t | authenticatorGetPaeState (AuthenticatorContext *context, uint_t portIndex, AuthenticatorPaeState *paeState) |
Get the current state of the authenticator PAE state state machine. More... | |
error_t | authenticatorGetBackendState (AuthenticatorContext *context, uint_t portIndex, AuthenticatorBackendState *backendState) |
Get the current state of the backend authentication state machine. More... | |
error_t | authenticatorGetReauthTimerState (AuthenticatorContext *context, uint_t portIndex, AuthenticatorReauthTimerState *reauthTimerState) |
Get the current state of the reauthentication timer state machine. More... | |
error_t | authenticatorGetEapFullAuthState (AuthenticatorContext *context, uint_t portIndex, EapFullAuthState *eapFullAuthState) |
Get the current state of the EAP full authenticator state machine. More... | |
error_t | authenticatorStart (AuthenticatorContext *context) |
Start 802.1X authenticator. More... | |
error_t | authenticatorStop (AuthenticatorContext *context) |
Stop 802.1X authenticator. More... | |
void | authenticatorTask (AuthenticatorContext *context) |
802.1X authenticator task More... | |
void | authenticatorDeinit (AuthenticatorContext *context) |
Release 802.1X authenticator context. More... | |
Detailed Description
802.1X authenticator
License
SPDX-License-Identifier: GPL-2.0-or-later
Copyright (C) 2022-2024 Oryx Embedded SARL. All rights reserved.
This file is part of CycloneEAP Open.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- Version
- 2.4.4
Definition in file authenticator.h.
Macro Definition Documentation
◆ AUTHENTICATOR_DEFAULT_MAX_RETRANS
#define AUTHENTICATOR_DEFAULT_MAX_RETRANS 4 |
Definition at line 141 of file authenticator.h.
◆ AUTHENTICATOR_DEFAULT_METHOD_TIMEOUT
#define AUTHENTICATOR_DEFAULT_METHOD_TIMEOUT 5 |
Definition at line 183 of file authenticator.h.
◆ AUTHENTICATOR_DEFAULT_QUIET_PERIOD
#define AUTHENTICATOR_DEFAULT_QUIET_PERIOD 60 |
Definition at line 99 of file authenticator.h.
◆ AUTHENTICATOR_DEFAULT_REAUTH_MAX
#define AUTHENTICATOR_DEFAULT_REAUTH_MAX 2 |
Definition at line 113 of file authenticator.h.
◆ AUTHENTICATOR_DEFAULT_REAUTH_PERIOD
#define AUTHENTICATOR_DEFAULT_REAUTH_PERIOD 3600 |
Definition at line 155 of file authenticator.h.
◆ AUTHENTICATOR_DEFAULT_SERVER_TIMEOUT
#define AUTHENTICATOR_DEFAULT_SERVER_TIMEOUT 30 |
Definition at line 127 of file authenticator.h.
◆ AUTHENTICATOR_MAX_ID_LEN
#define AUTHENTICATOR_MAX_ID_LEN 64 |
Definition at line 169 of file authenticator.h.
◆ AUTHENTICATOR_MAX_QUIET_PERIOD
#define AUTHENTICATOR_MAX_QUIET_PERIOD 65535 |
Definition at line 106 of file authenticator.h.
◆ AUTHENTICATOR_MAX_RADIUS_RETRANS
#define AUTHENTICATOR_MAX_RADIUS_RETRANS 4 |
Definition at line 190 of file authenticator.h.
◆ AUTHENTICATOR_MAX_REAUTH_PERIOD
#define AUTHENTICATOR_MAX_REAUTH_PERIOD 86400 |
Definition at line 162 of file authenticator.h.
◆ AUTHENTICATOR_MAX_SERVER_KEY_LEN
#define AUTHENTICATOR_MAX_SERVER_KEY_LEN 64 |
Definition at line 92 of file authenticator.h.
◆ AUTHENTICATOR_MAX_SERVER_TIMEOUT
#define AUTHENTICATOR_MAX_SERVER_TIMEOUT 3600 |
Definition at line 134 of file authenticator.h.
◆ AUTHENTICATOR_MAX_STATE_SIZE
#define AUTHENTICATOR_MAX_STATE_SIZE 64 |
Definition at line 176 of file authenticator.h.
◆ AUTHENTICATOR_MIN_REAUTH_PERIOD
#define AUTHENTICATOR_MIN_REAUTH_PERIOD 10 |
Definition at line 148 of file authenticator.h.
◆ AUTHENTICATOR_MIN_SERVER_TIMEOUT
#define AUTHENTICATOR_MIN_SERVER_TIMEOUT 1 |
Definition at line 120 of file authenticator.h.
◆ AUTHENTICATOR_PRIORITY
#define AUTHENTICATOR_PRIORITY OS_TASK_PRIORITY_NORMAL |
Definition at line 66 of file authenticator.h.
◆ AUTHENTICATOR_RADIUS_TIMEOUT
#define AUTHENTICATOR_RADIUS_TIMEOUT 5 |
Definition at line 197 of file authenticator.h.
◆ AUTHENTICATOR_RX_BUFFER_SIZE
#define AUTHENTICATOR_RX_BUFFER_SIZE 1500 |
Definition at line 85 of file authenticator.h.
◆ AUTHENTICATOR_STACK_SIZE
#define AUTHENTICATOR_STACK_SIZE 750 |
Definition at line 59 of file authenticator.h.
◆ AUTHENTICATOR_SUPPORT
#define AUTHENTICATOR_SUPPORT ENABLED |
Definition at line 52 of file authenticator.h.
◆ AUTHENTICATOR_TICK_INTERVAL
#define AUTHENTICATOR_TICK_INTERVAL 1000 |
Definition at line 71 of file authenticator.h.
◆ AUTHENTICATOR_TX_BUFFER_SIZE
#define AUTHENTICATOR_TX_BUFFER_SIZE 1500 |
Definition at line 78 of file authenticator.h.
◆ AuthenticatorContext
#define AuthenticatorContext struct _AuthenticatorContext |
Definition at line 36 of file authenticator.h.
◆ AuthenticatorPort
#define AuthenticatorPort struct _AuthenticatorPort |
Definition at line 40 of file authenticator.h.
Typedef Documentation
◆ AuthenticatorBackendStateChangeCallback
typedef void(* AuthenticatorBackendStateChangeCallback) (AuthenticatorPort *port, AuthenticatorBackendState state) |
Backend authentication state change callback function.
Definition at line 237 of file authenticator.h.
◆ AuthenticatorPaeStateChangeCallback
typedef void(* AuthenticatorPaeStateChangeCallback) (AuthenticatorPort *port, AuthenticatorPaeState state) |
Authenticator PAE state change callback function.
Definition at line 229 of file authenticator.h.
◆ AuthenticatorReauthTimerStateChangeCallback
typedef void(* AuthenticatorReauthTimerStateChangeCallback) (AuthenticatorPort *port, AuthenticatorReauthTimerState state) |
Reauthentication timer state change callback function.
Definition at line 245 of file authenticator.h.
◆ AuthenticatorTickCallback
typedef void(* AuthenticatorTickCallback) (AuthenticatorContext *context) |
Tick callback function.
Definition at line 261 of file authenticator.h.
◆ EapFullAuthStateChangeCallback
typedef void(* EapFullAuthStateChangeCallback) (AuthenticatorPort *port, EapFullAuthState state) |
EAP full authenticator state change callback function.
Definition at line 253 of file authenticator.h.
Enumeration Type Documentation
◆ AuthenticatorTerminateCause
Session terminate cause.
Definition at line 212 of file authenticator.h.
Function Documentation
◆ authenticatorDeinit()
void authenticatorDeinit | ( | AuthenticatorContext * | context | ) |
Release 802.1X authenticator context.
- Parameters
-
[in] context Pointer to the 802.1X authenticator context
Definition at line 1151 of file authenticator.c.
◆ authenticatorGetBackendState()
error_t authenticatorGetBackendState | ( | AuthenticatorContext * | context, |
uint_t | portIndex, | ||
AuthenticatorBackendState * | backendState | ||
) |
Get the current state of the backend authentication state machine.
- Parameters
-
[in] context Pointer to the 802.1X authenticator context [in] portIndex Port index [out] backendState Current state of the backend authentication state machine
- Returns
- Error code
Definition at line 780 of file authenticator.c.
◆ authenticatorGetDefaultSettings()
void authenticatorGetDefaultSettings | ( | AuthenticatorSettings * | settings | ) |
Initialize settings with default values.
- Parameters
-
[out] settings Structure that contains 802.1X authenticator settings
Definition at line 51 of file authenticator.c.
◆ authenticatorGetEapFullAuthState()
error_t authenticatorGetEapFullAuthState | ( | AuthenticatorContext * | context, |
uint_t | portIndex, | ||
EapFullAuthState * | eapFullAuthState | ||
) |
Get the current state of the EAP full authenticator state machine.
- Parameters
-
[in] context Pointer to the 802.1X authenticator context [in] portIndex Port index [out] eapFullAuthState Current state of the EAP full authenticator state machine
- Returns
- Error code
Definition at line 844 of file authenticator.c.
◆ authenticatorGetPaeState()
error_t authenticatorGetPaeState | ( | AuthenticatorContext * | context, |
uint_t | portIndex, | ||
AuthenticatorPaeState * | paeState | ||
) |
Get the current state of the authenticator PAE state state machine.
- Parameters
-
[in] context Pointer to the 802.1X authenticator context [in] portIndex Port index [out] paeState Current state of the authenticator PAE state machine
- Returns
- Error code
Definition at line 748 of file authenticator.c.
◆ authenticatorGetPortControl()
error_t authenticatorGetPortControl | ( | AuthenticatorContext * | context, |
uint_t | portIndex, | ||
AuthenticatorPortMode * | portControl | ||
) |
Get the current value of the AuthControlledPortControl parameter.
- Parameters
-
[in] context Pointer to the 802.1X authenticator context [in] portIndex Port index [out] portControl value of the AuthControlledPortControl parameter
- Returns
- Error code
Definition at line 562 of file authenticator.c.
◆ authenticatorGetPortStatus()
error_t authenticatorGetPortStatus | ( | AuthenticatorContext * | context, |
uint_t | portIndex, | ||
AuthenticatorPortStatus * | portStatus | ||
) |
Get the current value of the AuthControlledPortStatus variable.
- Parameters
-
[in] context Pointer to the 802.1X authenticator context [in] portIndex Port index [out] portStatus Current value of the AuthControlledPortStatus variable
- Returns
- Error code
Definition at line 717 of file authenticator.c.
◆ authenticatorGetQuietPeriod()
error_t authenticatorGetQuietPeriod | ( | AuthenticatorContext * | context, |
uint_t | portIndex, | ||
uint_t * | quietPeriod | ||
) |
Get the current value of the quietPeriod parameter.
- Parameters
-
[in] context Pointer to the 802.1X authenticator context [in] portIndex Port index [out] quietPeriod value of the quietPeriod parameter
- Returns
- Error code
Definition at line 593 of file authenticator.c.
◆ authenticatorGetReAuthEnabled()
error_t authenticatorGetReAuthEnabled | ( | AuthenticatorContext * | context, |
uint_t | portIndex, | ||
bool_t * | reAuthEnabled | ||
) |
Get the current value of the reAuthEnabled parameter.
- Parameters
-
[in] context Pointer to the 802.1X authenticator context [in] portIndex Port index [out] reAuthEnabled value of the reAuthEnabled parameter
- Returns
- Error code
Definition at line 655 of file authenticator.c.
◆ authenticatorGetReAuthPeriod()
error_t authenticatorGetReAuthPeriod | ( | AuthenticatorContext * | context, |
uint_t | portIndex, | ||
uint_t * | reAuthPeriod | ||
) |
Get the current value of the reAuthPeriod parameter.
- Parameters
-
[in] context Pointer to the 802.1X authenticator context [in] portIndex Port index [out] reAuthPeriod value of the reAuthPeriod parameter
- Returns
- Error code
Definition at line 686 of file authenticator.c.
◆ authenticatorGetReauthTimerState()
error_t authenticatorGetReauthTimerState | ( | AuthenticatorContext * | context, |
uint_t | portIndex, | ||
AuthenticatorReauthTimerState * | reauthTimerState | ||
) |
Get the current state of the reauthentication timer state machine.
- Parameters
-
[in] context Pointer to the 802.1X authenticator context [in] portIndex Port index [out] reauthTimerState Current state of the reauthentication timer state machine
- Returns
- Error code
Definition at line 812 of file authenticator.c.
◆ authenticatorGetServerTimeout()
error_t authenticatorGetServerTimeout | ( | AuthenticatorContext * | context, |
uint_t | portIndex, | ||
uint_t * | serverTimeout | ||
) |
Get the current value of the serverTimeout parameter.
- Parameters
-
[in] context Pointer to the 802.1X authenticator context [in] portIndex Port index [out] serverTimeout value of the serverTimeout parameter
- Returns
- Error code
Definition at line 624 of file authenticator.c.
◆ authenticatorInit()
error_t authenticatorInit | ( | AuthenticatorContext * | context, |
const AuthenticatorSettings * | settings | ||
) |
Initialize 802.1X authenticator context.
- Parameters
-
[in] context Pointer to the 802.1X authenticator context [in] settings 802.1X authenticator specific settings
- Returns
- Error code
Definition at line 100 of file authenticator.c.
◆ authenticatorInitPort()
error_t authenticatorInitPort | ( | AuthenticatorContext * | context, |
uint_t | portIndex | ||
) |
Reinitialize the specified port.
- Parameters
-
[in] context Pointer to the 802.1X authenticator context [in] portIndex Port index
- Returns
- Error code
Definition at line 304 of file authenticator.c.
◆ authenticatorReauthenticate()
error_t authenticatorReauthenticate | ( | AuthenticatorContext * | context, |
uint_t | portIndex | ||
) |
Force the authenticator to reauthenticate the supplicant.
- Parameters
-
[in] context Pointer to the 802.1X authenticator context [in] portIndex Port index
- Returns
- Error code
Definition at line 340 of file authenticator.c.
◆ authenticatorSetPortControl()
error_t authenticatorSetPortControl | ( | AuthenticatorContext * | context, |
uint_t | portIndex, | ||
AuthenticatorPortMode | portControl | ||
) |
Set the value of the AuthControlledPortControl parameter.
- Parameters
-
[in] context Pointer to the 802.1X authenticator context [in] portIndex Port index [in] portControl Value of the AuthControlledPortControl parameter
- Returns
- Error code
Definition at line 377 of file authenticator.c.
◆ authenticatorSetQuietPeriod()
error_t authenticatorSetQuietPeriod | ( | AuthenticatorContext * | context, |
uint_t | portIndex, | ||
uint_t | quietPeriod | ||
) |
Set the value of the quietPeriod parameter.
- Parameters
-
[in] context Pointer to the 802.1X authenticator context [in] portIndex Port index [in] quietPeriod Value of the quietPeriod parameter
- Returns
- Error code
Definition at line 414 of file authenticator.c.
◆ authenticatorSetReAuthEnabled()
error_t authenticatorSetReAuthEnabled | ( | AuthenticatorContext * | context, |
uint_t | portIndex, | ||
bool_t | reAuthEnabled | ||
) |
Set the value of the reAuthEnabled parameter.
- Parameters
-
[in] context Pointer to the 802.1X authenticator context [in] portIndex Port index [in] reAuthEnabled Value of the reAuthEnabled parameter
- Returns
- Error code
Definition at line 488 of file authenticator.c.
◆ authenticatorSetReAuthPeriod()
error_t authenticatorSetReAuthPeriod | ( | AuthenticatorContext * | context, |
uint_t | portIndex, | ||
uint_t | reAuthPeriod | ||
) |
Set the value of the reAuthPeriod parameter.
- Parameters
-
[in] context Pointer to the 802.1X authenticator context [in] portIndex Port index [in] reAuthPeriod Value of the reAuthPeriod parameter
- Returns
- Error code
Definition at line 525 of file authenticator.c.
◆ authenticatorSetServerAddr()
error_t authenticatorSetServerAddr | ( | AuthenticatorContext * | context, |
const IpAddr * | serverIpAddr, | ||
uint16_t | serverPort | ||
) |
Specify the IP address of the RADIUS server.
- Parameters
-
[in] context Pointer to the 802.1X authenticator context [in] serverIpAddr IP address of the RADIUS server [in] serverPort Port number
- Returns
- Error code
Definition at line 236 of file authenticator.c.
◆ authenticatorSetServerKey()
error_t authenticatorSetServerKey | ( | AuthenticatorContext * | context, |
const uint8_t * | key, | ||
size_t | keyLen | ||
) |
Set RADIUS server's key.
- Parameters
-
[in] context Pointer to the 802.1X authenticator context [in] key Pointer to the key [in] keyLen Length of the key, in bytes
- Returns
- Error code
Definition at line 266 of file authenticator.c.
◆ authenticatorSetServerTimeout()
error_t authenticatorSetServerTimeout | ( | AuthenticatorContext * | context, |
uint_t | portIndex, | ||
uint_t | serverTimeout | ||
) |
Set the value of the serverTimeout parameter.
- Parameters
-
[in] context Pointer to the 802.1X authenticator context [in] portIndex Port index [in] serverTimeout Value of the serverTimeout parameter
- Returns
- Error code
Definition at line 451 of file authenticator.c.
◆ authenticatorStart()
error_t authenticatorStart | ( | AuthenticatorContext * | context | ) |
Start 802.1X authenticator.
- Parameters
-
[in] context Pointer to the 802.1X authenticator context
- Returns
- Error code
Definition at line 873 of file authenticator.c.
◆ authenticatorStop()
error_t authenticatorStop | ( | AuthenticatorContext * | context | ) |
Stop 802.1X authenticator.
- Parameters
-
[in] context Pointer to the 802.1X authenticator context
- Returns
- Error code
Definition at line 1005 of file authenticator.c.
◆ authenticatorTask()
void authenticatorTask | ( | AuthenticatorContext * | context | ) |
802.1X authenticator task
- Parameters
-
[in] context Pointer to the 802.1X authenticator context
Definition at line 1052 of file authenticator.c.