eap_md5.h
Go to the documentation of this file.
1 /**
2  * @file eap_md5.h
3  * @brief MD5-Challenge authentication method
4  *
5  * @section License
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  *
9  * Copyright (C) 2022-2024 Oryx Embedded SARL. All rights reserved.
10  *
11  * This file is part of CycloneEAP Open.
12  *
13  * This program is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public License
15  * as published by the Free Software Foundation; either version 2
16  * of the License, or (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software Foundation,
25  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26  *
27  * @author Oryx Embedded SARL (www.oryx-embedded.com)
28  * @version 2.4.4
29  **/
30 
31 #ifndef _EAP_MD5_H
32 #define _EAP_MD5_H
33 
34 //Dependencies
35 #include "eap/eap.h"
36 #include "supplicant/supplicant.h"
37 
38 //C++ guard
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42 
43 //CC-RX, CodeWarrior or Win32 compiler?
44 #if defined(__CCRX__)
45  #pragma pack
46 #elif defined(__CWCC__) || defined(_WIN32)
47  #pragma pack(push, 1)
48 #endif
49 
50 
51 /**
52  * @brief EAP-MD5 packet
53  **/
54 
56 {
57  uint8_t code; //0
58  uint8_t identifier; //1
59  uint16_t length; //2-3
60  uint8_t type; //4
61  uint8_t valueSize; //5
62  uint8_t value[]; //6
64 
65 
66 //CC-RX, CodeWarrior or Win32 compiler?
67 #if defined(__CCRX__)
68  #pragma unpack
69 #elif defined(__CWCC__) || defined(_WIN32)
70  #pragma pack(pop)
71 #endif
72 
73 //EAP-MD5 related functions
75  const EapMd5Packet *request, size_t length);
76 
78  const EapMd5Packet *request, size_t length);
79 
81 
82 //C++ guard
83 #ifdef __cplusplus
84 }
85 #endif
86 
87 #endif
uint8_t code
Definition: coap_common.h:179
uint8_t type
Definition: eap_md5.h:60
uint8_t valueSize
Definition: eap_md5.h:61
typedef __packed_struct
EAP-MD5 packet.
Definition: eap_md5.h:56
802.1X supplicant
EapMd5Packet
Definition: eap_md5.h:63
uint16_t length
Definition: eap_md5.h:59
#define SupplicantContext
Definition: supplicant.h:36
error_t eapMd5CheckRequest(SupplicantContext *context, const EapMd5Packet *request, size_t length)
Check incoming MD5 challenge request.
Definition: eap_md5.c:52
uint8_t value[]
Definition: eap_md5.h:62
error_t
Error codes.
Definition: error.h:43
uint8_t identifier
Definition: eap_md5.h:58
void eapMd5ProcessRequest(SupplicantContext *context, const EapMd5Packet *request, size_t length)
Process incoming MD5 challenge request.
Definition: eap_md5.c:75
void eapMd5BuildResponse(SupplicantContext *context)
Build MD5 challenge response.
Definition: eap_md5.c:102
EAP (Extensible Authentication Protocol)