aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/eapol_test.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2009-12-19 16:40:11 (GMT)
committerJouni Malinen <j@w1.fi>2009-12-19 16:40:11 (GMT)
commitf5d4a8ead4103da3e499e4236964ac654529f1f2 (patch)
treedf650d10f30181b3fd41ff90040f4dea2387cb3a /wpa_supplicant/eapol_test.c
parent1489e11a9442929c96a00c0090c8912577fd2315 (diff)
downloadhostap-f5d4a8ead4103da3e499e4236964ac654529f1f2.zip
hostap-f5d4a8ead4103da3e499e4236964ac654529f1f2.tar.gz
hostap-f5d4a8ead4103da3e499e4236964ac654529f1f2.tar.bz2
eapol_test: Fix build after RADIUS msg API changes
Diffstat (limited to 'wpa_supplicant/eapol_test.c')
-rw-r--r--wpa_supplicant/eapol_test.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/wpa_supplicant/eapol_test.c b/wpa_supplicant/eapol_test.c
index a1710e2..c73ec85 100644
--- a/wpa_supplicant/eapol_test.c
+++ b/wpa_supplicant/eapol_test.c
@@ -263,7 +263,8 @@ static void ieee802_1x_encapsulate_radius(struct eapol_test_data *e,
/* State attribute must be copied if and only if this packet is
* Access-Request reply to the previous Access-Challenge */
- if (e->last_recv_radius && e->last_recv_radius->hdr->code ==
+ if (e->last_recv_radius &&
+ radius_msg_get_hdr(e->last_recv_radius)->code ==
RADIUS_CODE_ACCESS_CHALLENGE) {
int res = radius_msg_copy_attr(msg, e->last_recv_radius,
RADIUS_ATTR_STATE);
@@ -664,10 +665,11 @@ ieee802_1x_receive_auth(struct radius_msg *msg, struct radius_msg *req,
void *data)
{
struct eapol_test_data *e = data;
+ struct radius_hdr *hdr = radius_msg_get_hdr(msg);
/* RFC 2869, Ch. 5.13: valid Message-Authenticator attribute MUST be
* present when packet contains an EAP-Message attribute */
- if (msg->hdr->code == RADIUS_CODE_ACCESS_REJECT &&
+ if (hdr->code == RADIUS_CODE_ACCESS_REJECT &&
radius_msg_get_attr(msg, RADIUS_ATTR_MESSAGE_AUTHENTICATOR, NULL,
0) < 0 &&
radius_msg_get_attr(msg, RADIUS_ATTR_EAP_MESSAGE, NULL, 0) < 0) {
@@ -681,9 +683,9 @@ ieee802_1x_receive_auth(struct radius_msg *msg, struct radius_msg *req,
return RADIUS_RX_UNKNOWN;
}
- if (msg->hdr->code != RADIUS_CODE_ACCESS_ACCEPT &&
- msg->hdr->code != RADIUS_CODE_ACCESS_REJECT &&
- msg->hdr->code != RADIUS_CODE_ACCESS_CHALLENGE) {
+ if (hdr->code != RADIUS_CODE_ACCESS_ACCEPT &&
+ hdr->code != RADIUS_CODE_ACCESS_REJECT &&
+ hdr->code != RADIUS_CODE_ACCESS_CHALLENGE) {
printf("Unknown RADIUS message code\n");
return RADIUS_RX_UNKNOWN;
}
@@ -694,7 +696,7 @@ ieee802_1x_receive_auth(struct radius_msg *msg, struct radius_msg *req,
radius_msg_free(e->last_recv_radius);
e->last_recv_radius = msg;
- switch (msg->hdr->code) {
+ switch (hdr->code) {
case RADIUS_CODE_ACCESS_ACCEPT:
e->radius_access_accept_received = 1;
ieee802_1x_get_keys(e, msg, req, shared_secret,
@@ -707,9 +709,9 @@ ieee802_1x_receive_auth(struct radius_msg *msg, struct radius_msg *req,
ieee802_1x_decapsulate_radius(e);
- if ((msg->hdr->code == RADIUS_CODE_ACCESS_ACCEPT &&
+ if ((hdr->code == RADIUS_CODE_ACCESS_ACCEPT &&
e->eapol_test_num_reauths < 0) ||
- msg->hdr->code == RADIUS_CODE_ACCESS_REJECT) {
+ hdr->code == RADIUS_CODE_ACCESS_REJECT) {
eloop_terminate();
}