aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/eapol_test.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2013-01-12 10:39:27 (GMT)
committerJouni Malinen <j@w1.fi>2013-01-12 10:39:27 (GMT)
commitd03f1e5d631145f1d0ffc42abd4faefd6bc98a78 (patch)
tree5124b3c9ab38498bc8ee505851225c7c50b1f387 /wpa_supplicant/eapol_test.c
parent42ad72029f45ad899274b600874f0ca850989555 (diff)
downloadhostap-d03f1e5d631145f1d0ffc42abd4faefd6bc98a78.zip
hostap-d03f1e5d631145f1d0ffc42abd4faefd6bc98a78.tar.gz
hostap-d03f1e5d631145f1d0ffc42abd4faefd6bc98a78.tar.bz2
eapol_test: Allow full RADIUS attribute length to be used
The -N and -C command line parameters can be used to add arbitrary RADIUS attributes to the messages. However, these were truncated to about 128 bytes when the actually message was constructed. Fix this by using larger buffers to allow the maximum attribute length (253 octets of payload) to be used. [Bug 458] Signed-hostap: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wpa_supplicant/eapol_test.c')
-rw-r--r--wpa_supplicant/eapol_test.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/wpa_supplicant/eapol_test.c b/wpa_supplicant/eapol_test.c
index c1349c9..80fe2c6 100644
--- a/wpa_supplicant/eapol_test.c
+++ b/wpa_supplicant/eapol_test.c
@@ -98,7 +98,7 @@ static int add_extra_attr(struct radius_msg *msg,
size_t len;
char *pos;
u32 val;
- char buf[128];
+ char buf[RADIUS_MAX_ATTR_LEN + 1];
switch (attr->syntax) {
case 's':
@@ -114,7 +114,7 @@ static int add_extra_attr(struct radius_msg *msg,
if (pos[0] == '0' && pos[1] == 'x')
pos += 2;
len = os_strlen(pos);
- if ((len & 1) || (len / 2) > sizeof(buf)) {
+ if ((len & 1) || (len / 2) > RADIUS_MAX_ATTR_LEN) {
printf("Invalid extra attribute hexstring\n");
return -1;
}
@@ -171,7 +171,7 @@ static void ieee802_1x_encapsulate_radius(struct eapol_test_data *e,
const u8 *eap, size_t len)
{
struct radius_msg *msg;
- char buf[128];
+ char buf[RADIUS_MAX_ATTR_LEN + 1];
const struct eap_hdr *hdr;
const u8 *pos;