RADIUS_ATTR_HEXDUMP },
{ RADIUS_ATTR_ACCT_INTERIM_INTERVAL, "Acct-Interim-Interval",
RADIUS_ATTR_INT32 },
+ { RADIUS_ATTR_CHARGEABLE_USER_IDENTITY, "Chargable-User-Identity",
+ RADIUS_ATTR_TEXT },
{ RADIUS_ATTR_NAS_IPV6_ADDRESS, "NAS-IPv6-Address", RADIUS_ATTR_IPV6 },
};
#define RADIUS_ATTRS (sizeof(radius_attrs) / sizeof(radius_attrs[0]))
RADIUS_ATTR_MESSAGE_AUTHENTICATOR = 80,
RADIUS_ATTR_TUNNEL_PRIVATE_GROUP_ID = 81,
RADIUS_ATTR_ACCT_INTERIM_INTERVAL = 85,
+ RADIUS_ATTR_CHARGEABLE_USER_IDENTITY = 89,
RADIUS_ATTR_NAS_IPV6_ADDRESS = 95
};
char *connect_info;
u8 own_addr[ETH_ALEN];
+ int cui_flag;
+ char *cui_str;
};
static struct eapol_test_data eapol_test;
goto fail;
}
+ if (e->cui_flag) {
+ int l = 0;
+ if (e->cui_flag == 1) {
+ l = 1;
+ buf[0] = '\0';
+ } else if (e->cui_flag == 2) {
+ os_snprintf(buf, sizeof(buf), "%s", e->cui_str);
+ l = os_strlen(buf);
+ }
+ if (!radius_msg_add_attr(msg,
+ RADIUS_ATTR_CHARGEABLE_USER_IDENTITY,
+ (u8 *) buf, l)) {
+ printf("Could not add Chargeable-User-Identity\n");
+ goto fail;
+ }
+ }
+
if (eap && !radius_msg_add_eap(msg, eap, len)) {
printf("Could not add EAP-Message\n");
goto fail;
"eapol_test [-nWS] -c<conf> [-a<AS IP>] [-p<AS port>] "
"[-s<AS secret>] \\\n"
" [-r<count>] [-t<timeout>] [-C<Connect-Info>] \\\n"
- " [-M<client MAC address>]\n"
+ " [-M<client MAC address>] \\\n"
+ " [-I<CUI>] [-i]\n"
"eapol_test scard\n"
"eapol_test sim <PIN> <num triplets> [debug]\n"
"\n");
"CONNECT 11Mbps 802.11b)\n"
" -M<client MAC address> = Set own MAC address "
"(Calling-Station-Id,\n"
- " default: 02:00:00:00:00:01)\n");
+ " default: 02:00:00:00:00:01)\n"
+ " -I<CUI> = send Chargeable-User-Identity containing the "
+ "value of CUI\n"
+ " -i = send NUL value in Chargeable-User-Identity\n");
}
wpa_debug_show_keys = 1;
for (;;) {
- c = getopt(argc, argv, "a:c:C:M:np:r:s:St:W");
+ c = getopt(argc, argv, "a:c:C:iI:M:np:r:s:St:W");
if (c < 0)
break;
switch (c) {
case 'C':
eapol_test.connect_info = optarg;
break;
+ case 'i':
+ eapol_test.cui_flag = 1;
+ break;
+ case 'I':
+ eapol_test.cui_flag = 2;
+ eapol_test.cui_str = optarg;
+ break;
case 'M':
if (hwaddr_aton(optarg, eapol_test.own_addr)) {
usage();