Skip to content

Commit

Permalink
Overwrite digest da *after* packing the TLV
Browse files Browse the repository at this point in the history
  • Loading branch information
arr2036 committed Feb 26, 2013
1 parent 8ec6cce commit bd6e9b5
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/main/radclient.c
Expand Up @@ -343,20 +343,21 @@ static int radclient_init(const char *filename)
/* overlapping! */
{
const DICT_ATTR *da;

da = dict_attrbyvalue(PW_DIGEST_ATTRIBUTES, 0);
if (!da) {
goto oom;
}

vp->da = da;

memmove(&vp->vp_octets[2],
&vp->vp_octets[0],
vp->length);

vp->vp_octets[0] = vp->da->attr - PW_DIGEST_REALM + 1;
vp->length += 2;
vp->vp_octets[1] = vp->length;

da = dict_attrbyvalue(PW_DIGEST_ATTRIBUTES, 0);
if (!da) {
goto oom;
}

vp->da = da;
}

break;
Expand Down

0 comments on commit bd6e9b5

Please sign in to comment.