~ubuntu-branches/ubuntu/natty/freeradius/natty-updates

« back to all changes in this revision

Viewing changes to src/lib/radius.c

  • Committer: Bazaar Package Importer
  • Author(s): Jeremie Corbier
  • Date: 2006-07-08 19:41:05 UTC
  • mto: (3.1.8 edgy) (4.1.3 sid) (1.1.14 upstream)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20060708194105-bxbr4e6m4dfw2x4x
Tags: upstream-1.1.2
ImportĀ upstreamĀ versionĀ 1.1.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * radius.c     Functions to send/receive radius packets.
3
3
 *
4
 
 * Version:     $Id: radius.c,v 1.125.2.5.2.3 2005/12/19 19:42:38 aland Exp $
 
4
 * Version:     $Id: radius.c,v 1.125.2.5.2.7 2006/05/16 18:26:06 aland Exp $
5
5
 *
6
6
 *   This library is free software; you can redistribute it and/or
7
7
 *   modify it under the terms of the GNU Lesser General Public
15
15
 *
16
16
 *   You should have received a copy of the GNU Lesser General Public
17
17
 *   License along with this library; if not, write to the Free Software
18
 
 *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
 
18
 *   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19
19
 *
20
20
 * Copyright 2000-2003  The FreeRADIUS server project
21
21
 */
22
22
 
23
 
static const char rcsid[] = "$Id: radius.c,v 1.125.2.5.2.3 2005/12/19 19:42:38 aland Exp $";
 
23
static const char rcsid[] = "$Id: radius.c,v 1.125.2.5.2.7 2006/05/16 18:26:06 aland Exp $";
24
24
 
25
25
#include        "autoconf.h"
26
26
#include        "md5.h"
132
132
  "Disconnect-Request",
133
133
  "Disconnect-ACK",
134
134
  "Disconnect-NAK",
135
 
  "CoF-Request",
136
 
  "CoF-ACK",
137
 
  "CoF-NAK",
 
135
  "CoA-Request",
 
136
  "CoA-ACK",
 
137
  "CoA-NAK",
138
138
  "46",
139
139
  "47",
140
140
  "48",
606
606
                 */
607
607
        case PW_ACCOUNTING_REQUEST:
608
608
        case PW_DISCONNECT_REQUEST:
 
609
        case PW_COA_REQUEST:
609
610
                memset(packet->vector, 0, sizeof(packet->vector));
610
611
                break;
611
612
                
753
754
                case PW_DISCONNECT_REQUEST:
754
755
                case PW_DISCONNECT_ACK:
755
756
                case PW_DISCONNECT_NAK:
756
 
                case PW_COF_REQUEST:
757
 
                case PW_COF_ACK:
758
 
                case PW_COF_NAK:
 
757
                case PW_COA_REQUEST:
 
758
                case PW_COA_ACK:
 
759
                case PW_COA_NAK:
759
760
                        memset(hdr->vector, 0, AUTH_VECTOR_LEN);
760
761
                        break;
761
762
 
1355
1356
/*
1356
1357
 *      Verify the signature of a packet.
1357
1358
 */
1358
 
static int rad_verify(RADIUS_PACKET *packet, RADIUS_PACKET *original,
 
1359
int rad_verify(RADIUS_PACKET *packet, RADIUS_PACKET *original,
1359
1360
               const char *secret)
1360
1361
{
1361
1362
        uint8_t                 *ptr;
1397
1398
                        case PW_DISCONNECT_REQUEST:
1398
1399
                        case PW_DISCONNECT_ACK:
1399
1400
                        case PW_DISCONNECT_NAK:
1400
 
                        case PW_COF_REQUEST:
1401
 
                        case PW_COF_ACK:
1402
 
                        case PW_COF_NAK:
 
1401
                        case PW_COA_REQUEST:
 
1402
                        case PW_COA_ACK:
 
1403
                        case PW_COA_NAK:
1403
1404
                                memset(packet->data + 4, 0, AUTH_VECTOR_LEN);
1404
1405
                                break;
1405
1406
 
1593
1594
        switch (vp->type) {
1594
1595
        case PW_TYPE_STRING:
1595
1596
        case PW_TYPE_OCTETS:
 
1597
        case PW_TYPE_ABINARY:
1596
1598
                /* nothing more to do */
1597
1599
                break;
1598
1600
 
1714
1716
        int                     vsa_tlen, vsa_llen;
1715
1717
        DICT_VENDOR             *dv = NULL;
1716
1718
 
1717
 
        if (rad_verify(packet, original, secret) < 0) return -1;
1718
 
 
1719
1719
        /*
1720
1720
         *      Extract attribute-value pairs
1721
1721
         */