Do not refer to Flags::Version field as 'PEAP version'
This field is also used for EAP-TTLS and EAP-FAST, so it is clearer to use a more generic term for it.
This commit is contained in:
parent
34f564dbd5
commit
3c724cc564
5 changed files with 10 additions and 12 deletions
|
@ -1435,7 +1435,7 @@ static void eap_fast_process(struct eap_sm *sm, void *priv,
|
||||||
"Flags 0x%02x", (unsigned long) wpabuf_len(respData),
|
"Flags 0x%02x", (unsigned long) wpabuf_len(respData),
|
||||||
flags);
|
flags);
|
||||||
|
|
||||||
if (eap_fast_process_version(data, flags & EAP_PEAP_VERSION_MASK))
|
if (eap_fast_process_version(data, flags & EAP_TLS_VERSION_MASK))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ret = eap_server_tls_reassemble(&data->ssl, flags, &pos, &left);
|
ret = eap_server_tls_reassemble(&data->ssl, flags, &pos, &left);
|
||||||
|
|
|
@ -1351,7 +1351,7 @@ static void eap_peap_process(struct eap_sm *sm, void *priv,
|
||||||
wpa_printf(MSG_DEBUG, "EAP-PEAP: Received packet(len=%lu) - "
|
wpa_printf(MSG_DEBUG, "EAP-PEAP: Received packet(len=%lu) - "
|
||||||
"Flags 0x%02x", (unsigned long) wpabuf_len(respData),
|
"Flags 0x%02x", (unsigned long) wpabuf_len(respData),
|
||||||
flags);
|
flags);
|
||||||
data->recv_version = peer_version = flags & EAP_PEAP_VERSION_MASK;
|
data->recv_version = peer_version = flags & EAP_TLS_VERSION_MASK;
|
||||||
if (data->force_version >= 0 && peer_version != data->force_version) {
|
if (data->force_version >= 0 && peer_version != data->force_version) {
|
||||||
wpa_printf(MSG_INFO, "EAP-PEAP: peer did not select the forced"
|
wpa_printf(MSG_INFO, "EAP-PEAP: peer did not select the forced"
|
||||||
" version (forced=%d peer=%d) - reject",
|
" version (forced=%d peer=%d) - reject",
|
||||||
|
|
|
@ -107,7 +107,7 @@ fail:
|
||||||
|
|
||||||
|
|
||||||
struct wpabuf * eap_server_tls_build_msg(struct eap_ssl_data *data,
|
struct wpabuf * eap_server_tls_build_msg(struct eap_ssl_data *data,
|
||||||
int eap_type, int peap_version, u8 id)
|
int eap_type, int version, u8 id)
|
||||||
{
|
{
|
||||||
struct wpabuf *req;
|
struct wpabuf *req;
|
||||||
u8 flags;
|
u8 flags;
|
||||||
|
@ -115,7 +115,7 @@ struct wpabuf * eap_server_tls_build_msg(struct eap_ssl_data *data,
|
||||||
|
|
||||||
wpa_printf(MSG_DEBUG, "SSL: Generating Request");
|
wpa_printf(MSG_DEBUG, "SSL: Generating Request");
|
||||||
|
|
||||||
flags = peap_version;
|
flags = version;
|
||||||
send_len = wpabuf_len(data->out_buf) - data->out_used;
|
send_len = wpabuf_len(data->out_buf) - data->out_used;
|
||||||
if (1 + send_len > data->tls_out_limit) {
|
if (1 + send_len > data->tls_out_limit) {
|
||||||
send_len = data->tls_out_limit - 1;
|
send_len = data->tls_out_limit - 1;
|
||||||
|
@ -163,7 +163,7 @@ struct wpabuf * eap_server_tls_build_msg(struct eap_ssl_data *data,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
struct wpabuf * eap_server_tls_build_ack(u8 id, int eap_type, int peap_version)
|
struct wpabuf * eap_server_tls_build_ack(u8 id, int eap_type, int version)
|
||||||
{
|
{
|
||||||
struct wpabuf *req;
|
struct wpabuf *req;
|
||||||
|
|
||||||
|
@ -172,7 +172,7 @@ struct wpabuf * eap_server_tls_build_ack(u8 id, int eap_type, int peap_version)
|
||||||
if (req == NULL)
|
if (req == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
wpa_printf(MSG_DEBUG, "SSL: Building ACK");
|
wpa_printf(MSG_DEBUG, "SSL: Building ACK");
|
||||||
wpabuf_put_u8(req, peap_version); /* Flags */
|
wpabuf_put_u8(req, version); /* Flags */
|
||||||
return req;
|
return req;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ struct eap_ssl_data {
|
||||||
#define EAP_TLS_FLAGS_LENGTH_INCLUDED 0x80
|
#define EAP_TLS_FLAGS_LENGTH_INCLUDED 0x80
|
||||||
#define EAP_TLS_FLAGS_MORE_FRAGMENTS 0x40
|
#define EAP_TLS_FLAGS_MORE_FRAGMENTS 0x40
|
||||||
#define EAP_TLS_FLAGS_START 0x20
|
#define EAP_TLS_FLAGS_START 0x20
|
||||||
#define EAP_PEAP_VERSION_MASK 0x07
|
#define EAP_TLS_VERSION_MASK 0x07
|
||||||
|
|
||||||
/* could be up to 128 bytes, but only the first 64 bytes are used */
|
/* could be up to 128 bytes, but only the first 64 bytes are used */
|
||||||
#define EAP_TLS_KEY_LEN 64
|
#define EAP_TLS_KEY_LEN 64
|
||||||
|
@ -48,10 +48,8 @@ void eap_server_tls_ssl_deinit(struct eap_sm *sm, struct eap_ssl_data *data);
|
||||||
u8 * eap_server_tls_derive_key(struct eap_sm *sm, struct eap_ssl_data *data,
|
u8 * eap_server_tls_derive_key(struct eap_sm *sm, struct eap_ssl_data *data,
|
||||||
char *label, size_t len);
|
char *label, size_t len);
|
||||||
struct wpabuf * eap_server_tls_build_msg(struct eap_ssl_data *data,
|
struct wpabuf * eap_server_tls_build_msg(struct eap_ssl_data *data,
|
||||||
int eap_type, int peap_version,
|
int eap_type, int version, u8 id);
|
||||||
u8 id);
|
struct wpabuf * eap_server_tls_build_ack(u8 id, int eap_type, int version);
|
||||||
struct wpabuf * eap_server_tls_build_ack(u8 id, int eap_type,
|
|
||||||
int peap_version);
|
|
||||||
int eap_server_tls_phase1(struct eap_sm *sm, struct eap_ssl_data *data);
|
int eap_server_tls_phase1(struct eap_sm *sm, struct eap_ssl_data *data);
|
||||||
int eap_server_tls_reassemble(struct eap_ssl_data *data, u8 flags,
|
int eap_server_tls_reassemble(struct eap_ssl_data *data, u8 flags,
|
||||||
const u8 **pos, size_t *left);
|
const u8 **pos, size_t *left);
|
||||||
|
|
|
@ -1314,7 +1314,7 @@ static void eap_ttls_process(struct eap_sm *sm, void *priv,
|
||||||
"Flags 0x%02x", (unsigned long) wpabuf_len(respData),
|
"Flags 0x%02x", (unsigned long) wpabuf_len(respData),
|
||||||
flags);
|
flags);
|
||||||
|
|
||||||
eap_ttls_process_version(sm, data, flags & EAP_PEAP_VERSION_MASK);
|
eap_ttls_process_version(sm, data, flags & EAP_TLS_VERSION_MASK);
|
||||||
|
|
||||||
ret = eap_server_tls_reassemble(&data->ssl, flags, &pos, &left);
|
ret = eap_server_tls_reassemble(&data->ssl, flags, &pos, &left);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
|
|
Loading…
Reference in a new issue