From: Arran Cudbard-Bell Date: Tue, 26 Feb 2013 00:49:39 +0000 (-0500) Subject: Overwrite digest da *after* packing the TLV X-Git-Tag: release_3_0_0_beta1~928 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bd6e9b5e2c299d64c685ffd586bd50325f2ed58f;p=thirdparty%2Ffreeradius-server.git Overwrite digest da *after* packing the TLV --- diff --git a/src/main/radclient.c b/src/main/radclient.c index 3c599dcaae0..252137fe9ba 100644 --- a/src/main/radclient.c +++ b/src/main/radclient.c @@ -343,13 +343,7 @@ 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); @@ -357,6 +351,13 @@ static int radclient_init(const char *filename) 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;