~ubuntu-branches/ubuntu/hardy/freeradius/hardy-proposed

« back to all changes in this revision

Viewing changes to src/modules/rlm_eap/eap.c

  • Committer: Bazaar Package Importer
  • Author(s): Mark Hymers
  • Date: 2006-12-16 20:45:11 UTC
  • mfrom: (3.1.10 feisty)
  • Revision ID: james.westby@ubuntu.com-20061216204511-3pbbsu4s8jtehsor
Tags: 1.1.3-3
Fix POSIX compliance problem in init script.  Closes: #403384. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * eap.c    rfc2284 & rfc2869 implementation
3
3
 *
4
 
 * Version:     $Id: eap.c,v 1.52 2004/05/05 16:20:40 aland Exp $
 
4
 * Version:     $Id: eap.c,v 1.52.4.1 2006/02/06 16:23:49 nbk Exp $
5
5
 *
6
6
 *   This program is free software; you can redistribute it and/or modify
7
7
 *   it under the terms of the GNU General Public License as published by
56
56
 
57
57
#include "rlm_eap.h"
58
58
 
59
 
static const char rcsid[] = "$Id: eap.c,v 1.52 2004/05/05 16:20:40 aland Exp $";
 
59
static const char rcsid[] = "$Id: eap.c,v 1.52.4.1 2006/02/06 16:23:49 nbk Exp $";
60
60
 
61
61
static const char *eap_codes[] = {
62
62
  "",                           /* 0 is invalid */
268
268
 
269
269
        case PW_EAP_NAK:
270
270
                /*
271
 
                 *      The one byte of NAK data is the preferred EAP type
272
 
                 *      of the client.
 
271
                 *      The NAK data is the preferred EAP type(s) of
 
272
                 *      the client.
 
273
                 *
 
274
                 *      RFC 3748 says to list one or more proposed
 
275
                 *      alternative types, one per octet, or to use
 
276
                 *      0 for no alternative.
273
277
                 */
274
278
                DEBUG2("  rlm_eap: EAP NAK");
275
279
 
291
295
                        return EAP_INVALID;
292
296
                }
293
297
 
 
298
                /*
 
299
                 *      FIXME: Pick one type out of the one they asked
 
300
                 *      for, as they may have asked for many.
 
301
                 */
294
302
                if ((eaptype->data[0] < PW_EAP_MD5) ||
295
303
                    (eaptype->data[0] > PW_EAP_MAX_TYPES)) {
296
304
                        DEBUG2(" rlm_eap: NAK asked for bad type %d",
466
474
                        /*
467
475
                         *      The Id is a simple "ack" for success
468
476
                         *      and failure.
 
477
                         *
 
478
                         *      RFC 3748 section 4.2 says
 
479
                         *
 
480
                         *      ... The Identifier field MUST match
 
481
                         *      the Identifier field of the Response
 
482
                         *      packet that it is sent in response
 
483
                         *      to.
469
484
                         */
470
485
                case PW_EAP_SUCCESS:
471
486
                case PW_EAP_FAILURE:
773
788
         *      asking for one which we don't support.
774
789
         *
775
790
         *      NAK is code + id + length1 + length + NAK
776
 
         *             + requested EAP type.
 
791
         *             + requested EAP type(s).
777
792
         *
778
793
         *      We know at this point that we can't handle the
779
794
         *      request.  We could either return an EAP-Fail here, but
1056
1071
                        radlog(L_ERR, "rlm_eap: Identity Unknown, authentication failed");
1057
1072
                        free(*eap_packet_p);
1058
1073
                        *eap_packet_p = NULL;
1059
 
                        eap_handler_free(&handler);
 
1074
                        eap_handler_free(handler);
1060
1075
                        return NULL;
1061
1076
                }
1062
1077
 
1091
1106
                               radlog(L_ERR, "rlm_eap: Identity does not match User-Name, setting from EAP Identity.");
1092
1107
                               free(*eap_packet_p);
1093
1108
                               *eap_packet_p = NULL;
1094
 
                               eap_handler_free(&handler);
 
1109
                               eap_handler_free(handler);
1095
1110
                               return NULL;
1096
1111
                       }
1097
1112
               }
1101
1116
        if (handler->eap_ds == NULL) {
1102
1117
                free(*eap_packet_p);
1103
1118
                *eap_packet_p = NULL;
1104
 
                eap_handler_free(&handler);
 
1119
                eap_handler_free(handler);
1105
1120
                return NULL;
1106
1121
        }
1107
1122