X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Fauth.c;h=c6e234417018ba5cb46eb3dd42ee867ee7048bfe;hb=898d3f4b437ca1348abc1bbd036b0106c66a7ba6;hp=013561ae66bb95053753fc6473d9628cea671faa;hpb=2883dd07101bf851e2ea368f0c04c91aea85cff2;p=ppp.git diff --git a/pppd/auth.c b/pppd/auth.c index 013561a..c6e2344 100644 --- a/pppd/auth.c +++ b/pppd/auth.c @@ -125,7 +125,7 @@ #ifdef USE_EAPTLS #include "eap-tls.h" #endif -#ifdef CBCP_SUPPORT +#ifdef PPP_WITH_CBCP #include "cbcp.h" #endif #include "pathnames.h" @@ -210,7 +210,7 @@ int (*null_auth_hook)(struct wordlist **paddrs, int (*allowed_address_hook)(u_int32_t addr) = NULL; -#ifdef HAVE_MULTILINK +#ifdef PPP_WITH_MULTILINK /* Hook for plugin to hear when an interface joins a multilink bundle */ void (*multilink_join_hook)(void) = NULL; #endif @@ -244,7 +244,7 @@ bool cryptpap = 0; /* Passwords in pap-secrets are encrypted */ bool refuse_pap = 0; /* Don't wanna auth. ourselves with PAP */ bool refuse_chap = 0; /* Don't wanna auth. ourselves with CHAP */ bool refuse_eap = 0; /* Don't wanna auth. ourselves with EAP */ -#ifdef CHAPMS +#ifdef PPP_WITH_CHAPMS bool refuse_mschap = 0; /* Don't wanna auth. ourselves with MS-CHAP */ bool refuse_mschap_v2 = 0; /* Don't wanna auth. ourselves with MS-CHAPv2 */ #else @@ -258,18 +258,22 @@ bool explicit_remote = 0; /* User specified explicit remote name */ bool explicit_user = 0; /* Set if "user" option supplied */ bool explicit_passwd = 0; /* Set if "password" option supplied */ char remote_name[MAXNAMELEN]; /* Peer's name for authentication */ -#ifdef USE_EAPTLS -char *cacert_file = NULL; /* CA certificate file (pem format) */ -char *ca_path = NULL; /* directory with CA certificates */ -char *cert_file = NULL; /* client certificate file (pem format) */ -char *privkey_file = NULL; /* client private key file (pem format) */ -char *pkcs12_file = NULL; /* client private key envelope file (pkcs12 format) */ -char *crl_dir = NULL; /* directory containing CRL files */ -char *crl_file = NULL; /* Certificate Revocation List (CRL) file (pem format) */ -char *max_tls_version = NULL; /* Maximum TLS protocol version (default=1.2) */ -char *tls_verify_method = NULL; -bool tls_verify_key_usage = 0; -bool need_peer_eap = 0; /* Require peer to authenticate us */ + +#if defined(USE_EAPTLS) || defined(USE_PEAP) +char *cacert_file = NULL; /* CA certificate file (pem format) */ +char *ca_path = NULL; /* Directory with CA certificates */ +char *crl_dir = NULL; /* Directory containing CRL files */ +char *crl_file = NULL; /* Certificate Revocation List (CRL) file (pem format) */ +char *max_tls_version = NULL; /* Maximum TLS protocol version (default=1.2) */ +char *tls_verify_method = NULL; /* Verify certificate method */ +bool tls_verify_key_usage = 0; /* Verify peer certificate key usage */ +#endif + +#if defined(USE_EAPTLS) +char *cert_file = NULL; /* Client certificate file (pem format) */ +char *privkey_file = NULL; /* Client private key file (pem format) */ +char *pkcs12_file = NULL; /* Client private key envelope file (pkcs12 format) */ +bool need_peer_eap = 0; /* Require peer to authenticate us */ #endif static char *uafname; /* name of most recent +ua file */ @@ -341,7 +345,7 @@ option_t auth_options[] = { "Require CHAP authentication from peer", OPT_ALIAS | OPT_PRIOSUB | OPT_A2OR | MDTYPE_MD5, &lcp_wantoptions[0].chap_mdtype }, -#ifdef CHAPMS +#ifdef PPP_WITH_CHAPMS { "require-mschap", o_bool, &auth_required, "Require MS-CHAP authentication from peer", OPT_PRIOSUB | OPT_A2OR | MDTYPE_MICROSOFT, @@ -372,7 +376,7 @@ option_t auth_options[] = { "Don't allow CHAP authentication with peer", OPT_ALIAS | OPT_A2CLRB | MDTYPE_MD5, &lcp_allowoptions[0].chap_mdtype }, -#ifdef CHAPMS +#ifdef PPP_WITH_CHAPMS { "refuse-mschap", o_bool, &refuse_mschap, "Don't agree to auth to peer with MS-CHAP", OPT_A2CLRB | MDTYPE_MICROSOFT, @@ -445,23 +449,26 @@ option_t auth_options[] = { "Set telephone number(s) which are allowed to connect", OPT_PRIV | OPT_A2LIST }, -#ifdef USE_EAPTLS - { "ca", o_string, &cacert_file, "EAP-TLS CA certificate in PEM format" }, - { "capath", o_string, &ca_path, "EAP-TLS CA certificate directory" }, - { "cert", o_string, &cert_file, "EAP-TLS client certificate in PEM format" }, - { "key", o_string, &privkey_file, "EAP-TLS client private key in PEM format" }, - { "crl-dir", o_string, &crl_dir, "Use CRLs in directory" }, - { "crl", o_string, &crl_file, "Use specific CRL file" }, - { "pkcs12", o_string, &pkcs12_file, "EAP-TLS client credentials in PKCS12 format" }, +#if defined(USE_EAPTLS) || defined(USE_PEAP) + { "ca", o_string, &cacert_file, "CA certificate in PEM format" }, + { "capath", o_string, &ca_path, "TLS CA certificate directory" }, + { "crl-dir", o_string, &crl_dir, "Use CRLs in directory" }, + { "crl", o_string, &crl_file, "Use specific CRL file" }, { "max-tls-version", o_string, &max_tls_version, "Maximum TLS version (1.0/1.1/1.2 (default)/1.3)" }, { "tls-verify-key-usage", o_bool, &tls_verify_key_usage, "Verify certificate type and extended key usage" }, { "tls-verify-method", o_string, &tls_verify_method, "Verify peer by method (none|subject|name|suffix)" }, +#endif + +#if defined(USE_EAPTLS) + { "cert", o_string, &cert_file, "client certificate in PEM format" }, + { "key", o_string, &privkey_file, "client private key in PEM format" }, + { "pkcs12", o_string, &pkcs12_file, "EAP-TLS client credentials in PKCS12 format" }, { "need-peer-eap", o_bool, &need_peer_eap, "Require the peer to authenticate us", 1 }, -#endif /* USE_EAPTLS */ +#endif { NULL } }; @@ -899,7 +906,7 @@ network_phase(int unit) } } -#ifdef CBCP_SUPPORT +#ifdef PPP_WITH_CBCP /* * If we negotiated callback, do it now. */ @@ -930,7 +937,7 @@ start_networks(int unit) new_phase(PHASE_NETWORK); -#ifdef HAVE_MULTILINK +#ifdef PPP_WITH_MULTILINK if (multilink) { if (mp_join_bundle()) { if (multilink_join_hook) @@ -940,7 +947,7 @@ start_networks(int unit) return; } } -#endif /* HAVE_MULTILINK */ +#endif /* PPP_WITH_MULTILINK */ #ifdef PPP_FILTER if (!demand) @@ -1012,7 +1019,7 @@ auth_peer_success(int unit, int protocol, int prot_flavor, case CHAP_MD5: bit |= CHAP_MD5_PEER; break; -#ifdef CHAPMS +#ifdef PPP_WITH_CHAPMS case CHAP_MICROSOFT: bit |= CHAP_MS_PEER; break; @@ -1088,7 +1095,7 @@ auth_withpeer_success(int unit, int protocol, int prot_flavor) case CHAP_MD5: bit |= CHAP_MD5_WITHPEER; break; -#ifdef CHAPMS +#ifdef PPP_WITH_CHAPMS case CHAP_MICROSOFT: bit |= CHAP_MS_WITHPEER; break; @@ -2400,7 +2407,8 @@ auth_script(char *script) argv[3] = user_name; argv[4] = devnam; argv[5] = strspeed; - argv[6] = NULL; + argv[6] = ipparam; + argv[7] = NULL; auth_script_pid = run_program(script, argv, 0, auth_script_done, NULL, 0); }