eap_tls.c File Reference

EAP-TLS authentication protocol. More...

#include "eap/eap.h"
#include "eap/eap_tls.h"
#include "eap/eap_debug.h"
#include "debug.h"

Go to the source code of this file.

Macros

#define TRACE_LEVEL   EAP_TRACE_LEVEL
 

Functions

error_t eapTlsCheckRequest (SupplicantContext *context, const EapTlsPacket *request, size_t length)
 Check incoming EAP-TLS request. More...
 
void eapTlsProcessRequest (SupplicantContext *context, const EapTlsPacket *request, size_t length)
 Process incoming EAP-TLS request. More...
 
void eapTlsBuildResponse (SupplicantContext *context)
 Build EAP-TLS response. More...
 
error_t eapOpenTls (SupplicantContext *context)
 Initialize TLS context. More...
 
void eapCloseTls (SupplicantContext *context)
 Release TLS context. More...
 
error_t eapTlsSendCallback (void *handle, const void *data, size_t length, size_t *written, uint_t flags)
 TLS send callback (I/O abstraction layer) More...
 
error_t eapTlsReceiveCallback (void *handle, void *data, size_t size, size_t *received, uint_t flags)
 TLS receive callback (I/O abstraction layer) More...
 

Detailed Description

EAP-TLS authentication protocol.

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.

Author
Oryx Embedded SARL (www.oryx-embedded.com)
Version
2.4.0

Definition in file eap_tls.c.

Macro Definition Documentation

◆ TRACE_LEVEL

#define TRACE_LEVEL   EAP_TRACE_LEVEL

Definition at line 32 of file eap_tls.c.

Function Documentation

◆ eapCloseTls()

void eapCloseTls ( SupplicantContext context)

Release TLS context.

Parameters
[in]contextPointer to the 802.1X supplicant context

Definition at line 382 of file eap_tls.c.

◆ eapOpenTls()

error_t eapOpenTls ( SupplicantContext context)

Initialize TLS context.

Parameters
[in]contextPointer to the 802.1X supplicant context
Returns
Error code

Definition at line 332 of file eap_tls.c.

◆ eapTlsBuildResponse()

void eapTlsBuildResponse ( SupplicantContext context)

Build EAP-TLS response.

Parameters
[in]contextPointer to the 802.1X supplicant context

Definition at line 234 of file eap_tls.c.

◆ eapTlsCheckRequest()

error_t eapTlsCheckRequest ( SupplicantContext context,
const EapTlsPacket request,
size_t  length 
)

Check incoming EAP-TLS request.

Parameters
[in]contextPointer to the 802.1X supplicant context
[in]requestPointer to the received request
[in]lengthLength of the request, in bytes

Definition at line 51 of file eap_tls.c.

◆ eapTlsProcessRequest()

void eapTlsProcessRequest ( SupplicantContext context,
const EapTlsPacket request,
size_t  length 
)

Process incoming EAP-TLS request.

Parameters
[in]contextPointer to the 802.1X supplicant context
[in]requestPointer to the received request
[in]lengthLength of the request, in bytes

Definition at line 79 of file eap_tls.c.

◆ eapTlsReceiveCallback()

error_t eapTlsReceiveCallback ( void *  handle,
void *  data,
size_t  size,
size_t *  received,
uint_t  flags 
)

TLS receive callback (I/O abstraction layer)

Parameters
[in]handlePointer the 802.1X supplicant context
[out]dataBuffer where to store the incoming data
[in]sizeMaximum number of bytes that can be received
[out]receivedNumber of bytes that have been received
[in]flagsUnused parameter
Returns
Error code

Definition at line 451 of file eap_tls.c.

◆ eapTlsSendCallback()

error_t eapTlsSendCallback ( void *  handle,
const void *  data,
size_t  length,
size_t *  written,
uint_t  flags 
)

TLS send callback (I/O abstraction layer)

Parameters
[in]handlePointer the 802.1X supplicant context
[in]dataPointer to a buffer containing the data to be transmitted
[in]lengthNumber of data bytes to send
[out]writtenNumber of bytes that have been transmitted
[in]flagsUnused parameter
Returns
Error code

Definition at line 403 of file eap_tls.c.