]> git.ozlabs.org Git - ppp.git/blob - pppd/chap-new.c
Cleanup pppoe-discovery fatal functions
[ppp.git] / pppd / chap-new.c
1 /*
2  * chap-new.c - New CHAP implementation.
3  *
4  * Copyright (c) 2003 Paul Mackerras. All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  *
10  * 1. Redistributions of source code must retain the above copyright
11  *    notice, this list of conditions and the following disclaimer.
12  *
13  * 2. The name(s) of the authors of this software must not be used to
14  *    endorse or promote products derived from this software without
15  *    prior written permission.
16  *
17  * 3. Redistributions of any form whatsoever must retain the following
18  *    acknowledgment:
19  *    "This product includes software developed by Paul Mackerras
20  *     <paulus@samba.org>".
21  *
22  * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO
23  * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
24  * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
25  * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
26  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
27  * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
28  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
29  */
30
31 #define RCSID   "$Id: chap-new.c,v 1.9 2007/06/19 02:08:35 carlsonj Exp $"
32
33 #include <stdlib.h>
34 #include <string.h>
35 #include "pppd.h"
36 #include "session.h"
37 #include "chap-new.h"
38 #include "chap-md5.h"
39
40 #ifdef CHAPMS
41 #include "chap_ms.h"
42 #define MDTYPE_ALL (MDTYPE_MICROSOFT_V2 | MDTYPE_MICROSOFT | MDTYPE_MD5)
43 #else
44 #define MDTYPE_ALL (MDTYPE_MD5)
45 #endif
46
47 int chap_mdtype_all = MDTYPE_ALL;
48
49 /* Hook for a plugin to validate CHAP challenge */
50 int (*chap_verify_hook)(char *name, char *ourname, int id,
51                         struct chap_digest_type *digest,
52                         unsigned char *challenge, unsigned char *response,
53                         char *message, int message_space) = NULL;
54
55 /*
56  * Option variables.
57  */
58 int chap_server_timeout_time = 3;
59 int chap_max_transmits = 10;
60 int chap_rechallenge_time = 0;
61 int chap_client_timeout_time = 60;
62 int chapms_strip_domain = 0;
63
64 /*
65  * Command-line options.
66  */
67 static option_t chap_option_list[] = {
68         { "chap-restart", o_int, &chap_server_timeout_time,
69           "Set timeout for CHAP (as server)", OPT_PRIO },
70         { "chap-max-challenge", o_int, &chap_max_transmits,
71           "Set max #xmits for challenge", OPT_PRIO },
72         { "chap-interval", o_int, &chap_rechallenge_time,
73           "Set interval for rechallenge", OPT_PRIO },
74         { "chap-timeout", o_int, &chap_client_timeout_time,
75           "Set timeout for CHAP (as client)", OPT_PRIO },
76         { "chapms-strip-domain", o_bool, &chapms_strip_domain,
77           "Strip the domain prefix before the Username", 1 },
78         { NULL }
79 };
80
81 /*
82  * Internal state.
83  */
84 static struct chap_client_state {
85         int flags;
86         char *name;
87         struct chap_digest_type *digest;
88         unsigned char priv[64];         /* private area for digest's use */
89 } client;
90
91 /*
92  * These limits apply to challenge and response packets we send.
93  * The +4 is the +1 that we actually need rounded up.
94  */
95 #define CHAL_MAX_PKTLEN (PPP_HDRLEN + CHAP_HDRLEN + 4 + MAX_CHALLENGE_LEN + MAXNAMELEN)
96 #define RESP_MAX_PKTLEN (PPP_HDRLEN + CHAP_HDRLEN + 4 + MAX_RESPONSE_LEN + MAXNAMELEN)
97
98 static struct chap_server_state {
99         int flags;
100         int id;
101         char *name;
102         struct chap_digest_type *digest;
103         int challenge_xmits;
104         int challenge_pktlen;
105         unsigned char challenge[CHAL_MAX_PKTLEN];
106         char message[256];
107 } server;
108
109 /* Values for flags in chap_client_state and chap_server_state */
110 #define LOWERUP                 1
111 #define AUTH_STARTED            2
112 #define AUTH_DONE               4
113 #define AUTH_FAILED             8
114 #define TIMEOUT_PENDING         0x10
115 #define CHALLENGE_VALID         0x20
116
117 /*
118  * Prototypes.
119  */
120 static void chap_init(int unit);
121 static void chap_lowerup(int unit);
122 static void chap_lowerdown(int unit);
123 static void chap_server_timeout(void *arg);
124 static void chap_client_timeout(void *arg);
125 static void chap_generate_challenge(struct chap_server_state *ss);
126 static void chap_handle_response(struct chap_server_state *ss, int code,
127                 unsigned char *pkt, int len);
128 static int chap_verify_response(char *name, char *ourname, int id,
129                 struct chap_digest_type *digest,
130                 unsigned char *challenge, unsigned char *response,
131                 char *message, int message_space);
132 static void chap_respond(struct chap_client_state *cs, int id,
133                 unsigned char *pkt, int len);
134 static void chap_handle_status(struct chap_client_state *cs, int code, int id,
135                 unsigned char *pkt, int len);
136 static void chap_protrej(int unit);
137 static void chap_input(int unit, unsigned char *pkt, int pktlen);
138 static int chap_print_pkt(unsigned char *p, int plen,
139                 void (*printer)(void *, char *, ...), void *arg);
140
141 /* List of digest types that we know about */
142 static struct chap_digest_type *chap_digests;
143
144 /*
145  * chap_init - reset to initial state.
146  */
147 static void
148 chap_init(int unit)
149 {
150         memset(&client, 0, sizeof(client));
151         memset(&server, 0, sizeof(server));
152
153         chap_md5_init();
154 #ifdef CHAPMS
155         chapms_init();
156 #endif
157 }
158
159 /*
160  * Add a new digest type to the list.
161  */
162 void
163 chap_register_digest(struct chap_digest_type *dp)
164 {
165         dp->next = chap_digests;
166         chap_digests = dp;
167 }
168
169 /*
170  * chap_lowerup - we can start doing stuff now.
171  */
172 static void
173 chap_lowerup(int unit)
174 {
175         struct chap_client_state *cs = &client;
176         struct chap_server_state *ss = &server;
177
178         cs->flags |= LOWERUP;
179         ss->flags |= LOWERUP;
180         if (ss->flags & AUTH_STARTED)
181                 chap_server_timeout(ss);
182 }
183
184 static void
185 chap_lowerdown(int unit)
186 {
187         struct chap_client_state *cs = &client;
188         struct chap_server_state *ss = &server;
189
190         if (cs->flags & TIMEOUT_PENDING)
191                 UNTIMEOUT(chap_client_timeout, cs);
192         cs->flags = 0;
193         if (ss->flags & TIMEOUT_PENDING)
194                 UNTIMEOUT(chap_server_timeout, ss);
195         ss->flags = 0;
196 }
197
198 /*
199  * chap_auth_peer - Start authenticating the peer.
200  * If the lower layer is already up, we start sending challenges,
201  * otherwise we wait for the lower layer to come up.
202  */
203 void
204 chap_auth_peer(int unit, char *our_name, int digest_code)
205 {
206         struct chap_server_state *ss = &server;
207         struct chap_digest_type *dp;
208
209         if (ss->flags & AUTH_STARTED) {
210                 error("CHAP: peer authentication already started!");
211                 return;
212         }
213         for (dp = chap_digests; dp != NULL; dp = dp->next)
214                 if (dp->code == digest_code)
215                         break;
216         if (dp == NULL)
217                 fatal("CHAP digest 0x%x requested but not available",
218                       digest_code);
219
220         ss->digest = dp;
221         ss->name = our_name;
222         /* Start with a random ID value */
223         ss->id = (unsigned char)(drand48() * 256);
224         ss->flags |= AUTH_STARTED;
225         if (ss->flags & LOWERUP)
226                 chap_server_timeout(ss);
227 }
228
229 /*
230  * chap_auth_with_peer - Prepare to authenticate ourselves to the peer.
231  * There isn't much to do until we receive a challenge.
232  */
233 void
234 chap_auth_with_peer(int unit, char *our_name, int digest_code)
235 {
236         struct chap_client_state *cs = &client;
237         struct chap_digest_type *dp;
238
239         if (cs->flags & AUTH_STARTED) {
240                 error("CHAP: authentication with peer already started!");
241                 return;
242         }
243         for (dp = chap_digests; dp != NULL; dp = dp->next)
244                 if (dp->code == digest_code)
245                         break;
246         if (dp == NULL)
247                 fatal("CHAP digest 0x%x requested but not available",
248                       digest_code);
249
250         cs->digest = dp;
251         cs->name = our_name;
252         cs->flags |= AUTH_STARTED | TIMEOUT_PENDING;
253         TIMEOUT(chap_client_timeout, cs, chap_client_timeout_time);
254 }
255
256 /*
257  * chap_server_timeout - It's time to send another challenge to the peer.
258  * This could be either a retransmission of a previous challenge,
259  * or a new challenge to start re-authentication.
260  */
261 static void
262 chap_server_timeout(void *arg)
263 {
264         struct chap_server_state *ss = arg;
265
266         ss->flags &= ~TIMEOUT_PENDING;
267         if ((ss->flags & CHALLENGE_VALID) == 0) {
268                 ss->challenge_xmits = 0;
269                 chap_generate_challenge(ss);
270                 ss->flags |= CHALLENGE_VALID;
271         } else if (ss->challenge_xmits >= chap_max_transmits) {
272                 ss->flags &= ~CHALLENGE_VALID;
273                 ss->flags |= AUTH_DONE | AUTH_FAILED;
274                 auth_peer_fail(0, PPP_CHAP);
275                 return;
276         }
277
278         output(0, ss->challenge, ss->challenge_pktlen);
279         ++ss->challenge_xmits;
280         ss->flags |= TIMEOUT_PENDING;
281         TIMEOUT(chap_server_timeout, arg, chap_server_timeout_time);
282 }
283
284 /* chap_client_timeout - Authentication with peer timed out. */
285 static void
286 chap_client_timeout(void *arg)
287 {
288         struct chap_client_state *cs = arg;
289
290         cs->flags &= ~TIMEOUT_PENDING;
291         cs->flags |= AUTH_DONE | AUTH_FAILED;
292         error("CHAP authentication timed out");
293         auth_withpeer_fail(0, PPP_CHAP);
294 }
295
296 /*
297  * chap_generate_challenge - generate a challenge string and format
298  * the challenge packet in ss->challenge_pkt.
299  */
300 static void
301 chap_generate_challenge(struct chap_server_state *ss)
302 {
303         int clen = 1, nlen, len;
304         unsigned char *p;
305
306         p = ss->challenge;
307         MAKEHEADER(p, PPP_CHAP);
308         p += CHAP_HDRLEN;
309         ss->digest->generate_challenge(p);
310         clen = *p;
311         nlen = strlen(ss->name);
312         memcpy(p + 1 + clen, ss->name, nlen);
313
314         len = CHAP_HDRLEN + 1 + clen + nlen;
315         ss->challenge_pktlen = PPP_HDRLEN + len;
316
317         p = ss->challenge + PPP_HDRLEN;
318         p[0] = CHAP_CHALLENGE;
319         p[1] = ++ss->id;
320         p[2] = len >> 8;
321         p[3] = len;
322 }
323
324 /*
325  * chap_handle_response - check the response to our challenge.
326  */
327 static void
328 chap_handle_response(struct chap_server_state *ss, int id,
329                      unsigned char *pkt, int len)
330 {
331         int response_len, ok, mlen;
332         unsigned char *response, *p;
333         char *name = NULL;      /* initialized to shut gcc up */
334         int (*verifier)(char *, char *, int, struct chap_digest_type *,
335                 unsigned char *, unsigned char *, char *, int);
336         char rname[MAXNAMELEN+1];
337
338         if ((ss->flags & LOWERUP) == 0)
339                 return;
340         if (id != ss->challenge[PPP_HDRLEN+1] || len < 2)
341                 return;
342         if (ss->flags & CHALLENGE_VALID) {
343                 response = pkt;
344                 GETCHAR(response_len, pkt);
345                 len -= response_len + 1;        /* length of name */
346                 name = (char *)pkt + response_len;
347                 if (len < 0)
348                         return;
349
350                 if (ss->flags & TIMEOUT_PENDING) {
351                         ss->flags &= ~TIMEOUT_PENDING;
352                         UNTIMEOUT(chap_server_timeout, ss);
353                 }
354
355                 if (explicit_remote) {
356                         name = remote_name;
357                 } else {
358                         /* Null terminate and clean remote name. */
359                         slprintf(rname, sizeof(rname), "%.*v", len, name);
360                         name = rname;
361
362                         /* strip the MS domain name */
363                         if (chapms_strip_domain && strrchr(rname, '\\')) {
364                                 char tmp[MAXNAMELEN+1];
365
366                                 strcpy(tmp, strrchr(rname, '\\') + 1);
367                                 strcpy(rname, tmp);
368                         }
369                 }
370
371                 if (chap_verify_hook)
372                         verifier = chap_verify_hook;
373                 else
374                         verifier = chap_verify_response;
375                 ok = (*verifier)(name, ss->name, id, ss->digest,
376                                  ss->challenge + PPP_HDRLEN + CHAP_HDRLEN,
377                                  response, ss->message, sizeof(ss->message));
378                 if (!ok || !auth_number()) {
379                         ss->flags |= AUTH_FAILED;
380                         warn("Peer %q failed CHAP authentication", name);
381                 }
382         } else if ((ss->flags & AUTH_DONE) == 0)
383                 return;
384
385         /* send the response */
386         p = outpacket_buf;
387         MAKEHEADER(p, PPP_CHAP);
388         mlen = strlen(ss->message);
389         len = CHAP_HDRLEN + mlen;
390         p[0] = (ss->flags & AUTH_FAILED)? CHAP_FAILURE: CHAP_SUCCESS;
391         p[1] = id;
392         p[2] = len >> 8;
393         p[3] = len;
394         if (mlen > 0)
395                 memcpy(p + CHAP_HDRLEN, ss->message, mlen);
396         output(0, outpacket_buf, PPP_HDRLEN + len);
397
398         if (ss->flags & CHALLENGE_VALID) {
399                 ss->flags &= ~CHALLENGE_VALID;
400                 if (!(ss->flags & AUTH_DONE) && !(ss->flags & AUTH_FAILED)) {
401                     /*
402                      * Auth is OK, so now we need to check session restrictions
403                      * to ensure everything is OK, but only if we used a
404                      * plugin, and only if we're configured to check.  This
405                      * allows us to do PAM checks on PPP servers that
406                      * authenticate against ActiveDirectory, and use AD for
407                      * account info (like when using Winbind integrated with
408                      * PAM).
409                      */
410                     if (session_mgmt &&
411                         session_check(name, NULL, devnam, NULL) == 0) {
412                         ss->flags |= AUTH_FAILED;
413                         warn("Peer %q failed CHAP Session verification", name);
414                     }
415                 }
416                 if (ss->flags & AUTH_FAILED) {
417                         auth_peer_fail(0, PPP_CHAP);
418                 } else {
419                         if ((ss->flags & AUTH_DONE) == 0)
420                                 auth_peer_success(0, PPP_CHAP,
421                                                   ss->digest->code,
422                                                   name, strlen(name));
423                         if (chap_rechallenge_time) {
424                                 ss->flags |= TIMEOUT_PENDING;
425                                 TIMEOUT(chap_server_timeout, ss,
426                                         chap_rechallenge_time);
427                         }
428                 }
429                 ss->flags |= AUTH_DONE;
430         }
431 }
432
433 /*
434  * chap_verify_response - check whether the peer's response matches
435  * what we think it should be.  Returns 1 if it does (authentication
436  * succeeded), or 0 if it doesn't.
437  */
438 static int
439 chap_verify_response(char *name, char *ourname, int id,
440                      struct chap_digest_type *digest,
441                      unsigned char *challenge, unsigned char *response,
442                      char *message, int message_space)
443 {
444         int ok;
445         unsigned char secret[MAXSECRETLEN];
446         int secret_len;
447
448         /* Get the secret that the peer is supposed to know */
449         if (!get_secret(0, name, ourname, (char *)secret, &secret_len, 1)) {
450                 error("No CHAP secret found for authenticating %q", name);
451                 return 0;
452         }
453
454         ok = digest->verify_response(id, name, secret, secret_len, challenge,
455                                      response, message, message_space);
456         memset(secret, 0, sizeof(secret));
457
458         return ok;
459 }
460
461 /*
462  * chap_respond - Generate and send a response to a challenge.
463  */
464 static void
465 chap_respond(struct chap_client_state *cs, int id,
466              unsigned char *pkt, int len)
467 {
468         int clen, nlen;
469         int secret_len;
470         unsigned char *p;
471         unsigned char response[RESP_MAX_PKTLEN];
472         char rname[MAXNAMELEN+1];
473         char secret[MAXSECRETLEN+1];
474
475         if ((cs->flags & (LOWERUP | AUTH_STARTED)) != (LOWERUP | AUTH_STARTED))
476                 return;         /* not ready */
477         if (len < 2 || len < pkt[0] + 1)
478                 return;         /* too short */
479         clen = pkt[0];
480         nlen = len - (clen + 1);
481
482         /* Null terminate and clean remote name. */
483         slprintf(rname, sizeof(rname), "%.*v", nlen, pkt + clen + 1);
484
485         /* Microsoft doesn't send their name back in the PPP packet */
486         if (explicit_remote || (remote_name[0] != 0 && rname[0] == 0))
487                 strlcpy(rname, remote_name, sizeof(rname));
488
489         /* get secret for authenticating ourselves with the specified host */
490         if (!get_secret(0, cs->name, rname, secret, &secret_len, 0)) {
491                 secret_len = 0; /* assume null secret if can't find one */
492                 warn("No CHAP secret found for authenticating us to %q", rname);
493         }
494
495         p = response;
496         MAKEHEADER(p, PPP_CHAP);
497         p += CHAP_HDRLEN;
498
499         cs->digest->make_response(p, id, cs->name, pkt,
500                                   secret, secret_len, cs->priv);
501         memset(secret, 0, secret_len);
502
503         clen = *p;
504         nlen = strlen(cs->name);
505         memcpy(p + clen + 1, cs->name, nlen);
506
507         p = response + PPP_HDRLEN;
508         len = CHAP_HDRLEN + clen + 1 + nlen;
509         p[0] = CHAP_RESPONSE;
510         p[1] = id;
511         p[2] = len >> 8;
512         p[3] = len;
513
514         output(0, response, PPP_HDRLEN + len);
515 }
516
517 static void
518 chap_handle_status(struct chap_client_state *cs, int code, int id,
519                    unsigned char *pkt, int len)
520 {
521         const char *msg = NULL;
522
523         if ((cs->flags & (AUTH_DONE|AUTH_STARTED|LOWERUP))
524             != (AUTH_STARTED|LOWERUP))
525                 return;
526         cs->flags |= AUTH_DONE;
527
528         UNTIMEOUT(chap_client_timeout, cs);
529         cs->flags &= ~TIMEOUT_PENDING;
530
531         if (code == CHAP_SUCCESS) {
532                 /* used for MS-CHAP v2 mutual auth, yuck */
533                 if (cs->digest->check_success != NULL) {
534                         if (!(*cs->digest->check_success)(id, pkt, len))
535                                 code = CHAP_FAILURE;
536                 } else
537                         msg = "CHAP authentication succeeded";
538         } else {
539                 if (cs->digest->handle_failure != NULL)
540                         (*cs->digest->handle_failure)(pkt, len);
541                 else
542                         msg = "CHAP authentication failed";
543         }
544         if (msg) {
545                 if (len > 0)
546                         info("%s: %.*v", msg, len, pkt);
547                 else
548                         info("%s", msg);
549         }
550         if (code == CHAP_SUCCESS)
551                 auth_withpeer_success(0, PPP_CHAP, cs->digest->code);
552         else {
553                 cs->flags |= AUTH_FAILED;
554                 error("CHAP authentication failed");
555                 auth_withpeer_fail(0, PPP_CHAP);
556         }
557 }
558
559 static void
560 chap_input(int unit, unsigned char *pkt, int pktlen)
561 {
562         struct chap_client_state *cs = &client;
563         struct chap_server_state *ss = &server;
564         unsigned char code, id;
565         int len;
566
567         if (pktlen < CHAP_HDRLEN)
568                 return;
569         GETCHAR(code, pkt);
570         GETCHAR(id, pkt);
571         GETSHORT(len, pkt);
572         if (len < CHAP_HDRLEN || len > pktlen)
573                 return;
574         len -= CHAP_HDRLEN;
575
576         switch (code) {
577         case CHAP_CHALLENGE:
578                 chap_respond(cs, id, pkt, len);
579                 break;
580         case CHAP_RESPONSE:
581                 chap_handle_response(ss, id, pkt, len);
582                 break;
583         case CHAP_FAILURE:
584         case CHAP_SUCCESS:
585                 chap_handle_status(cs, code, id, pkt, len);
586                 break;
587         }
588 }
589
590 static void
591 chap_protrej(int unit)
592 {
593         struct chap_client_state *cs = &client;
594         struct chap_server_state *ss = &server;
595
596         if (ss->flags & TIMEOUT_PENDING) {
597                 ss->flags &= ~TIMEOUT_PENDING;
598                 UNTIMEOUT(chap_server_timeout, ss);
599         }
600         if (ss->flags & AUTH_STARTED) {
601                 ss->flags = 0;
602                 auth_peer_fail(0, PPP_CHAP);
603         }
604         if ((cs->flags & (AUTH_STARTED|AUTH_DONE)) == AUTH_STARTED) {
605                 cs->flags &= ~AUTH_STARTED;
606                 error("CHAP authentication failed due to protocol-reject");
607                 auth_withpeer_fail(0, PPP_CHAP);
608         }
609 }
610
611 /*
612  * chap_print_pkt - print the contents of a CHAP packet.
613  */
614 static char *chap_code_names[] = {
615         "Challenge", "Response", "Success", "Failure"
616 };
617
618 static int
619 chap_print_pkt(unsigned char *p, int plen,
620                void (*printer)(void *, char *, ...), void *arg)
621 {
622         int code, id, len;
623         int clen, nlen;
624         unsigned char x;
625
626         if (plen < CHAP_HDRLEN)
627                 return 0;
628         GETCHAR(code, p);
629         GETCHAR(id, p);
630         GETSHORT(len, p);
631         if (len < CHAP_HDRLEN || len > plen)
632                 return 0;
633
634         if (code >= 1 && code <= sizeof(chap_code_names) / sizeof(char *))
635                 printer(arg, " %s", chap_code_names[code-1]);
636         else
637                 printer(arg, " code=0x%x", code);
638         printer(arg, " id=0x%x", id);
639         len -= CHAP_HDRLEN;
640         switch (code) {
641         case CHAP_CHALLENGE:
642         case CHAP_RESPONSE:
643                 if (len < 1)
644                         break;
645                 clen = p[0];
646                 if (len < clen + 1)
647                         break;
648                 ++p;
649                 nlen = len - clen - 1;
650                 printer(arg, " <");
651                 for (; clen > 0; --clen) {
652                         GETCHAR(x, p);
653                         printer(arg, "%.2x", x);
654                 }
655                 printer(arg, ">, name = ");
656                 print_string((char *)p, nlen, printer, arg);
657                 break;
658         case CHAP_FAILURE:
659         case CHAP_SUCCESS:
660                 printer(arg, " ");
661                 print_string((char *)p, len, printer, arg);
662                 break;
663         default:
664                 for (clen = len; clen > 0; --clen) {
665                         GETCHAR(x, p);
666                         printer(arg, " %.2x", x);
667                 }
668         }
669
670         return len + CHAP_HDRLEN;
671 }
672
673 struct protent chap_protent = {
674         PPP_CHAP,
675         chap_init,
676         chap_input,
677         chap_protrej,
678         chap_lowerup,
679         chap_lowerdown,
680         NULL,           /* open */
681         NULL,           /* close */
682         chap_print_pkt,
683         NULL,           /* datainput */
684         1,              /* enabled_flag */
685         "CHAP",         /* name */
686         NULL,           /* data_name */
687         chap_option_list,
688         NULL,           /* check_options */
689 };