Home | History | Annotate | Download | only in radius

Lines Matching refs:attr

280 	const struct radius_attr_type *attr;
285 attr = radius_get_attr_type(hdr->type);
288 hdr->type, attr ? attr->name : "?Unknown?", hdr->length);
290 if (attr == NULL || hdr->length < sizeof(struct radius_attr_hdr))
296 switch (attr->data_type) {
359 struct radius_attr_hdr *attr = radius_get_attr_hdr(msg, i);
360 radius_msg_dump_attr(attr);
370 struct radius_attr_hdr *attr;
373 attr = radius_msg_add_attr(msg,
376 if (attr == NULL) {
383 wpabuf_len(msg->buf), (u8 *) (attr + 1));
400 struct radius_attr_hdr *attr;
405 attr = radius_msg_add_attr(msg, RADIUS_ATTR_MESSAGE_AUTHENTICATOR,
407 if (attr == NULL) {
415 wpabuf_len(msg->buf), (u8 *) (attr + 1));
444 struct radius_attr_hdr *attr;
447 attr = radius_msg_add_attr(msg, RADIUS_ATTR_MESSAGE_AUTHENTICATOR,
449 if (attr == NULL) {
457 wpabuf_len(msg->buf), (u8 *) (attr + 1));
550 struct radius_attr_hdr *attr = NULL, *tmp;
569 if (attr != NULL) {
575 attr = tmp;
579 if (attr == NULL) {
584 os_memcpy(orig, attr + 1, MD5_MAC_LEN);
585 os_memset(attr + 1, 0, MD5_MAC_LEN);
592 os_memcpy(attr + 1, orig, MD5_MAC_LEN);
601 struct radius_attr_hdr *attr)
617 (unsigned char *) attr - wpabuf_head_u8(msg->buf);
627 struct radius_attr_hdr *attr;
635 buf_needed = sizeof(*attr) + data_len;
644 attr = wpabuf_put(msg->buf, sizeof(struct radius_attr_hdr));
645 attr->type = type;
646 attr->length = sizeof(*attr) + data_len;
649 if (radius_msg_add_attr_to_array(msg, attr))
652 return attr;
669 struct radius_attr_hdr *attr;
704 if ((size_t) (end - pos) < sizeof(*attr))
707 attr = (struct radius_attr_hdr *) pos;
709 if (attr->length > end - pos || attr->length < sizeof(*attr))
712 /* TODO: check that attr->length is suitable for attr->type */
714 if (radius_msg_add_attr_to_array(msg, attr))
717 pos += attr->length;
756 struct radius_attr_hdr *attr;
763 attr = radius_get_attr_hdr(msg, i);
764 if (attr->type == RADIUS_ATTR_EAP_MESSAGE &&
765 attr->length > sizeof(struct radius_attr_hdr))
766 len += attr->length - sizeof(struct radius_attr_hdr);
777 attr = radius_get_attr_hdr(msg, i);
778 if (attr->type == RADIUS_ATTR_EAP_MESSAGE &&
779 attr->length > sizeof(struct radius_attr_hdr)) {
780 int flen = attr->length - sizeof(*attr);
781 wpabuf_put_data(eap, attr + 1, flen);
794 struct radius_attr_hdr *attr = NULL, *tmp;
800 if (attr != NULL) {
804 attr = tmp;
808 if (attr == NULL) {
813 os_memcpy(orig, attr + 1, MD5_MAC_LEN);
814 os_memset(attr + 1, 0, MD5_MAC_LEN);
823 os_memcpy(attr + 1, orig, MD5_MAC_LEN);
878 struct radius_attr_hdr *attr;
883 attr = radius_get_attr_hdr(src, i);
884 if (attr->type == type && attr->length >= sizeof(*attr)) {
885 if (!radius_msg_add_attr(dst, type, (u8 *) (attr + 1),
886 attr->length - sizeof(*attr)))
922 struct radius_attr_hdr *attr = radius_get_attr_hdr(msg, i);
927 if (attr->type != RADIUS_ATTR_VENDOR_SPECIFIC ||
928 attr->length < sizeof(*attr))
931 left = attr->length - sizeof(*attr);
935 pos = (u8 *) (attr + 1);
1180 struct radius_attr_hdr *attr;
1211 attr = radius_msg_add_attr(msg, RADIUS_ATTR_VENDOR_SPECIFIC,
1214 if (attr == NULL) {
1236 attr = radius_msg_add_attr(msg, RADIUS_ATTR_VENDOR_SPECIFIC,
1239 if (attr == NULL) {
1250 struct radius_attr_hdr *attr;
1264 attr = radius_msg_add_attr(msg, RADIUS_ATTR_VENDOR_SPECIFIC,
1267 if (attr == NULL)
1347 struct radius_attr_hdr *attr = NULL, *tmp;
1353 attr = tmp;
1358 if (!attr || attr->length < sizeof(*attr))
1361 dlen = attr->length - sizeof(*attr);
1363 os_memcpy(buf, (attr + 1), dlen > len ? len : dlen);
1372 struct radius_attr_hdr *attr = NULL, *tmp;
1378 attr = tmp;
1383 if (!attr || attr->length < sizeof(*attr))
1386 *buf = (u8 *) (attr + 1);
1387 *len = attr->length - sizeof(*attr);
1398 struct radius_attr_hdr *attr = radius_get_attr_hdr(msg, i);
1399 if (attr->type == type &&
1400 attr->length >= sizeof(struct radius_attr_hdr) + min_len)
1443 struct radius_attr_hdr *attr = NULL;
1455 attr = radius_get_attr_hdr(msg, i);
1456 if (attr->length < sizeof(*attr))
1458 data = (const u8 *) (attr + 1);
1459 dlen = attr->length - sizeof(*attr);
1460 if (attr->length < 3)
1467 switch (attr->type) {
1469 if (attr->length != 6)
1475 if (attr->length != 6)
1496 if (attr->length != 6)
1554 struct radius_attr_hdr *attr;
1563 attr = radius_get_attr_hdr(msg, i);
1564 if (attr == NULL ||
1565 attr->type != RADIUS_ATTR_TUNNEL_PASSWORD) {
1568 if (attr->length <= 5)
1570 data = (const u8 *) (attr + 1);
1571 dlen = attr->length - sizeof(*attr);
1654 os_free(c->attr[i].data);
1655 os_free(c->attr);
1656 c->attr = NULL;
1666 if (src->attr == NULL)
1669 dst->attr = os_calloc(src->count, sizeof(struct radius_attr_data));
1670 if (dst->attr == NULL)
1676 dst->attr[i].data = os_malloc(src->attr[i].len);
1677 if (dst->attr[i].data == NULL)
1680 os_memcpy(dst->attr[i].data, src->attr[i].data,
1681 src->attr[i].len);
1682 dst->attr[i].len = src->attr[i].len;
1692 struct radius_attr_hdr *attr;
1695 attr = radius_get_attr_hdr(msg, i);
1698 if (attr->type == attrs[j])
1703 return attr->type; /* unlisted attr */