Select one of the symbols to view example projects that use it.
 
Outline
#include "includes.h"
#include "common.h"
#include "eap_i.h"
eap_identity_data
eap_identity_init(struct eap_sm *)
eap_identity_initPickUp(struct eap_sm *)
eap_identity_reset(struct eap_sm *, void *)
eap_identity_buildReq(struct eap_sm *, void *, u8)
eap_identity_check(struct eap_sm *, void *, struct wpabuf *)
eap_identity_process(struct eap_sm *, void *, struct wpabuf *)
eap_identity_isDone(struct eap_sm *, void *)
eap_identity_isSuccess(struct eap_sm *, void *)
eap_server_identity_register()
Files
ESP-IDF
components
app_trace
app_update
bootloader_support
bt
cmock
console
cxx
driver
efuse
esp_adc
esp_app_format
esp_bootloader_format
esp_coex
esp_common
esp_driver_ana_cmpr
esp_driver_cam
esp_driver_dac
esp_driver_gpio
esp_driver_gptimer
esp_driver_i2c
esp_driver_i2s
esp_driver_jpeg
esp_driver_ledc
esp_driver_mcpwm
esp_driver_parlio
esp_driver_pcnt
esp_driver_rmt
esp_driver_sdio
esp_driver_sdm
esp_driver_sdmmc
esp_driver_sdspi
esp_driver_spi
esp_driver_tsens
esp_driver_uart
esp_driver_usb_serial_jtag
esp_eth
esp_event
esp_gdbstub
esp_hid
esp_http_client
esp_http_server
esp_https_ota
esp_https_server
esp_hw_support
esp_lcd
esp_local_ctrl
esp_mm
esp_netif
esp_partition
esp_phy
esp_pm
esp_psram
esp_ringbuf
esp_rom
esp_security
esp_system
esp_timer
esp_vfs_console
esp_wifi
esp-tls
espcoredump
hal
heap
http_parser
ieee802154
log
mqtt
newlib
nvs_flash
nvs_sec_provider
openthread
perfmon
protobuf-c
protocomm
pthread
rt
sdmmc
soc
spi_flash
spiffs
tcp_transport
ulp
unity
vfs
wear_levelling
wifi_provisioning
wpa_supplicant
esp_supplicant
include
port
src
ap
common
crypto
drivers
eap_common
eap_peer
eap_server
eapol_auth
rsn_supp
tls
utils
wps
xtensa
examples
lwIP
FreeRTOS
cJSON
mbedTLS
SourceVuESP-IDF Framework and ExamplesESP-IDFcomponents/wpa_supplicant/src/eap_server/eap_server_identity.c
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
/* * hostapd / EAP-Identity * Copyright (c) 2004-2006, Jouni Malinen <j@w1.fi> * * This software may be distributed under the terms of the BSD license. * See README for more details. *//* ... */ #include "includes.h" #include "common.h" #include "eap_i.h" struct eap_identity_data { enum { CONTINUE, SUCCESS, FAILURE } state; int pick_up; }{ ... }; static void * eap_identity_init(struct eap_sm *sm) { struct eap_identity_data *data; data = os_zalloc(sizeof(*data)); if (data == NULL) return NULL; data->state = CONTINUE; return data; }{ ... } static void * eap_identity_initPickUp(struct eap_sm *sm) { struct eap_identity_data *data; data = eap_identity_init(sm); if (data) { data->pick_up = 1; }{...} return data; }{ ... } static void eap_identity_reset(struct eap_sm *sm, void *priv) { struct eap_identity_data *data = priv; os_free(data); }{ ... } static struct wpabuf * eap_identity_buildReq(struct eap_sm *sm, void *priv, u8 id) { struct eap_identity_data *data = priv; struct wpabuf *req; const char *req_data; size_t req_data_len; if (sm->eapol_cb->get_eap_req_id_text) { req_data = sm->eapol_cb->get_eap_req_id_text(sm->eapol_ctx, &req_data_len); }{...} else { req_data = NULL; req_data_len = 0; }{...} req = eap_msg_alloc(EAP_VENDOR_IETF, EAP_TYPE_IDENTITY, req_data_len, EAP_CODE_REQUEST, id); if (req == NULL) { wpa_printf(MSG_ERROR, "EAP-Identity: Failed to allocate " "memory for request"); data->state = FAILURE; return NULL; }{...} wpabuf_put_data(req, req_data, req_data_len); return req; }{ ... } static bool eap_identity_check(struct eap_sm *sm, void *priv, struct wpabuf *respData) { const u8 *pos; size_t len; pos = eap_hdr_validate(EAP_VENDOR_IETF, EAP_TYPE_IDENTITY, respData, &len); if (pos == NULL) { wpa_printf(MSG_INFO, "EAP-Identity: Invalid frame"); return true; }{...} return false; }{ ... } static void eap_identity_process(struct eap_sm *sm, void *priv, struct wpabuf *respData) { struct eap_identity_data *data = priv; const u8 *pos; size_t len; char *buf; if (data->pick_up) { if (eap_identity_check(sm, data, respData)) { wpa_printf(MSG_DEBUG, "EAP-Identity: failed to pick " "up already started negotiation"); data->state = FAILURE; return; }{...} data->pick_up = 0; }{...} pos = eap_hdr_validate(EAP_VENDOR_IETF, EAP_TYPE_IDENTITY, respData, &len); if (pos == NULL) return; /* Should not happen - frame already validated */ wpa_hexdump_ascii(MSG_DEBUG, "EAP-Identity: Peer identity", pos, len); buf = os_malloc(len * 4 + 1); if (buf) { printf_encode(buf, len * 4 + 1, pos, len); wpa_printf(MSG_DEBUG, "EAP-Response/Identity '%s'", buf); os_free(buf); }{...} if (sm->identity) sm->update_user = true; os_free(sm->identity); sm->identity = os_malloc(len ? len : 1); if (sm->identity == NULL) { data->state = FAILURE; }{...} else { os_memcpy(sm->identity, pos, len); sm->identity_len = len; data->state = SUCCESS; }{...} }{ ... } static bool eap_identity_isDone(struct eap_sm *sm, void *priv) { struct eap_identity_data *data = priv; return data->state != CONTINUE; }{ ... } static bool eap_identity_isSuccess(struct eap_sm *sm, void *priv) { struct eap_identity_data *data = priv; return data->state == SUCCESS; }{ ... } int eap_server_identity_register(void) { struct eap_method *eap; eap = eap_server_method_alloc(EAP_SERVER_METHOD_INTERFACE_VERSION, EAP_VENDOR_IETF, EAP_TYPE_IDENTITY, "Identity"); if (eap == NULL) return -1; eap->init = eap_identity_init; eap->initPickUp = eap_identity_initPickUp; eap->reset = eap_identity_reset; eap->buildReq = eap_identity_buildReq; eap->check = eap_identity_check; eap->process = eap_identity_process; eap->isDone = eap_identity_isDone; eap->isSuccess = eap_identity_isSuccess; return eap_server_method_register(eap); }{ ... }
Details
Show:
from
Types: Columns: