]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Overwrite digest da *after* packing the TLV
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 26 Feb 2013 00:49:39 +0000 (19:49 -0500)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 26 Feb 2013 00:49:39 +0000 (19:49 -0500)
src/main/radclient.c

index 3c599dcaae0be446ba8e76789a3ace33996bc1ce..252137fe9ba662f2c7f7ff2e9c63d4e8b3bb92d7 100644 (file)
@@ -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;