Pull fix from branch_1_1
authoraland <aland>
Fri, 23 Feb 2007 10:07:09 +0000 (10:07 +0000)
committeraland <aland>
Fri, 23 Feb 2007 10:07:09 +0000 (10:07 +0000)
1  2 
src/modules/rlm_eap/libeap/eapcommon.c

@@@ -17,9 -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[] = {
    "",
@@@ -265,7 -262,7 +265,7 @@@ int eap_basic_compose(RADIUS_PACKET *pa
                 * 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;
        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);
        }
@@@ -388,7 -385,8 +388,8 @@@ void map_eap_types(RADIUS_PACKET *req
                ep.id   = id;
                ep.type.type = eap_type;
                ep.type.length = vp->length;
-               ep.type.data = vp->vp_octets;
+               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);
        }
  }
@@@ -429,7 -427,7 +430,7 @@@ eap_packet_t *eap_attribute(VALUE_PAIR 
         *      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);
  
        /*
  
        /* 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;
        }
  
@@@ -545,7 -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;