Skip to content

Commit

Permalink
Decode EVS data types correctly.
Browse files Browse the repository at this point in the history
  • Loading branch information
alandekok committed Jun 12, 2015
1 parent efad6c4 commit 5412eab
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions src/lib/radius.c
Expand Up @@ -3370,7 +3370,6 @@ ssize_t data2vp(TALLOC_CTX *ctx,
ssize_t rcode;
uint32_t vendor;
DICT_ATTR const *child;
DICT_VENDOR *dv;
VALUE_PAIR *vp;
uint8_t const *data = start;
char *p;
Expand Down Expand Up @@ -3674,16 +3673,19 @@ ssize_t data2vp(TALLOC_CTX *ctx,

memcpy(&vendor, data, 4);
vendor = ntohl(vendor);
dv = dict_vendorbyvalue(vendor);
if (!dv) {
child = dict_unknown_afrom_fields(ctx, data[4], da->vendor | vendor);
} else {
child = dict_attrbyparent(da, data[4], vendor);
if (!child) {
child = dict_unknown_afrom_fields(ctx, data[4], da->vendor | vendor);
}
vendor |= da->vendor;

child = dict_attrbyvalue(data[4], vendor);
if (!child) {
/*
* Create a "raw" attribute from the
* contents of the EVS VSA.
*/
da = dict_unknown_afrom_fields(ctx, data[4], vendor);
data += 5;
datalen -= 5;
break;
}
if (!child) goto raw;

rcode = data2vp(ctx, packet, original, secret, child,
data + 5, attrlen - 5, attrlen - 5, pvp);
Expand Down

0 comments on commit 5412eab

Please sign in to comment.