Pull fix from branch_1_1
[freeradius.git] / src / modules / rlm_eap / libeap / eapcommon.c
index 03223ef..d918f1a 100644 (file)
@@ -17,9 +17,9 @@
  *
  *   You should have received a copy of the GNU General Public License
  *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  *
- * Copyright 2000-2003  The FreeRADIUS server project
+ * Copyright 2000-2003,2006  The FreeRADIUS server project
  * Copyright 2001  hereUare Communications, Inc. <raghud@hereuare.com>
  * Copyright 2003  Alan DeKok <aland@freeradius.org>
  * Copyright 2003  Michael Richardson <mcr@sandelman.ottawa.on.ca>
  *
  */
 
-#include "libradius.h"
-#include "eap_types.h"
+#include <freeradius-devel/ident.h>
+RCSID("$Id$")
 
-static const char rcsid[] = "$Id$";
+#include <freeradius-devel/autoconf.h>
+#include <freeradius-devel/missing.h>
+#include <freeradius-devel/libradius.h>
+#include "eap_types.h"
 
 static const char *eap_types[] = {
   "",
@@ -262,7 +265,7 @@ int eap_basic_compose(RADIUS_PACKET *packet, EAP_PACKET *reply)
                 * This memory gets freed up when packet is freed up
                 */
                eap_msg = paircreate(PW_EAP_MESSAGE, PW_TYPE_OCTETS);
-               memcpy(eap_msg->strvalue, ptr, len);
+               memcpy(eap_msg->vp_strvalue, ptr, len);
                eap_msg->length = len;
                pairadd(&(packet->vps), eap_msg);
                ptr += len;
@@ -279,7 +282,7 @@ int eap_basic_compose(RADIUS_PACKET *packet, EAP_PACKET *reply)
        vp = pairfind(packet->vps, PW_MESSAGE_AUTHENTICATOR);
        if (!vp) {
                vp = paircreate(PW_MESSAGE_AUTHENTICATOR, PW_TYPE_OCTETS);
-               memset(vp->strvalue, 0, AUTH_VECTOR_LEN);
+               memset(vp->vp_strvalue, 0, AUTH_VECTOR_LEN);
                vp->length = AUTH_VECTOR_LEN;
                pairadd(&(packet->vps), vp);
        }
@@ -386,7 +389,7 @@ void map_eap_types(RADIUS_PACKET *req)
                ep.type.type = eap_type;
                ep.type.length = vp->length;
                ep.type.data = malloc(vp->length);
-               memcpy(ep.type.data,vp->strvalue, vp->length);
+               memcpy(ep.type.data,vp->vp_octets, vp->length);
                eap_basic_compose(req, &ep);
        }
 }
@@ -427,7 +430,7 @@ eap_packet_t *eap_attribute(VALUE_PAIR *vps)
         *      Get the Actual length from the EAP packet
         *      First EAP-Message contains the EAP packet header
         */
-       memcpy(&len, first->strvalue + 2, sizeof(len));
+       memcpy(&len, first->vp_strvalue + 2, sizeof(len));
        len = ntohs(len);
 
        /*
@@ -475,7 +478,7 @@ eap_packet_t *eap_attribute(VALUE_PAIR *vps)
 
        /* RADIUS ensures order of attrs, so just concatenate all */
        for (vp = first; vp; vp = pairfind(vp->next, PW_EAP_MESSAGE)) {
-               memcpy(ptr, vp->strvalue, vp->length);
+               memcpy(ptr, vp->vp_strvalue, vp->length);
                ptr += vp->length;
        }
 
@@ -543,7 +546,7 @@ void unmap_eap_types(RADIUS_PACKET *rep)
                }
 
                eap1 = paircreate(type, PW_TYPE_OCTETS);
-               memcpy(eap1->strvalue, &e->data[1], len);
+               memcpy(eap1->vp_strvalue, &e->data[1], len);
                eap1->length = len;
                pairadd(&(rep->vps), eap1);
                break;