summaryrefslogtreecommitdiff
path: root/pppd
diff options
context:
space:
mode:
Diffstat (limited to 'pppd')
-rw-r--r--pppd/Makefile.am4
-rw-r--r--pppd/auth.c7
-rw-r--r--pppd/cbcp.h13
-rw-r--r--pppd/ccp.h8
-rw-r--r--pppd/chap.h8
-rw-r--r--pppd/chap_ms.h8
-rw-r--r--pppd/crypto.h8
-rw-r--r--pppd/crypto_ms.h8
-rw-r--r--pppd/ecp.h8
-rw-r--r--pppd/eui64.h8
-rw-r--r--pppd/fsm.h9
-rw-r--r--pppd/ipcp.h8
-rw-r--r--pppd/ipv6cp.h8
-rw-r--r--pppd/lcp.h10
-rw-r--r--pppd/magic.h8
-rw-r--r--pppd/main.c2
-rw-r--r--pppd/mppe.h10
-rw-r--r--pppd/multilink.h9
-rw-r--r--pppd/options.h9
-rw-r--r--pppd/plugins/radius/clientid.c2
-rw-r--r--pppd/plugins/radius/config.c6
-rw-r--r--pppd/pppd.h22
-rw-r--r--pppd/session.h8
-rw-r--r--pppd/upap.h9
24 files changed, 183 insertions, 17 deletions
diff --git a/pppd/Makefile.am b/pppd/Makefile.am
index c93a86a..e5bedf2 100644
--- a/pppd/Makefile.am
+++ b/pppd/Makefile.am
@@ -87,6 +87,10 @@ pppd_CPPFLAGS = -DSYSCONFDIR=\"${sysconfdir}\" -DLOCALSTATEDIR=\"${localstatedir
pppd_LDFLAGS =
pppd_LIBS =
+if PPP_WITH_SYSTEM_CA_PATH
+pppd_CPPFLAGS += -DSYSTEM_CA_PATH='"@SYSTEM_CA_PATH@"'
+endif
+
if LINUX
pppd_SOURCES += sys-linux.c
noinst_HEADERS += termios_linux.h
diff --git a/pppd/auth.c b/pppd/auth.c
index 202d557..cee847e 100644
--- a/pppd/auth.c
+++ b/pppd/auth.c
@@ -1334,6 +1334,13 @@ auth_check_options(void)
if (user[0] == 0 && !explicit_user)
strlcpy(user, our_name, sizeof(user));
+#if defined(SYSTEM_CA_PATH) && (defined(PPP_WITH_EAPTLS) || defined(PPP_WITH_PEAP))
+ /* Use system default for CA Path if not specified */
+ if (!ca_path) {
+ ca_path = SYSTEM_CA_PATH;
+ }
+#endif
+
/*
* If we have a default route, require the peer to authenticate
* unless the noauth option was given or the real user is root.
diff --git a/pppd/cbcp.h b/pppd/cbcp.h
index e317cae..4bd106b 100644
--- a/pppd/cbcp.h
+++ b/pppd/cbcp.h
@@ -30,11 +30,15 @@
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#ifndef CBCP_H
-#define CBCP_H
+#ifndef PPP_CBCP_H
+#define PPP_CBCP_H
#include "pppdconf.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct cbcp_state {
int us_unit; /* Interface unit number */
u_char us_id; /* Current id */
@@ -57,4 +61,9 @@ extern struct protent cbcp_protent;
#define CB_CONF_USER 2
#define CB_CONF_ADMIN 3
#define CB_CONF_LIST 4
+
+#ifdef __cplusplus
+}
#endif
+
+#endif // PPP_CBCP_H
diff --git a/pppd/ccp.h b/pppd/ccp.h
index 3f00056..d60cdca 100644
--- a/pppd/ccp.h
+++ b/pppd/ccp.h
@@ -34,6 +34,10 @@
#include "pppdconf.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct ccp_options {
bool bsd_compress; /* do BSD Compress? */
bool deflate; /* do Deflate? */
@@ -55,4 +59,8 @@ extern ccp_options ccp_hisoptions[];
extern struct protent ccp_protent;
+#ifdef __cplusplus
+}
#endif
+
+#endif // PPP_CCP_H
diff --git a/pppd/chap.h b/pppd/chap.h
index e693fc9..21373bd 100644
--- a/pppd/chap.h
+++ b/pppd/chap.h
@@ -33,6 +33,10 @@
#include "pppdconf.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* CHAP packets begin with a standard header with code, id, len (2 bytes).
*/
@@ -165,4 +169,8 @@ extern void chap_auth_with_peer(int unit, char *our_name, int digest_code);
/* Represents the CHAP protocol to the main pppd code */
extern struct protent chap_protent;
+#ifdef __cplusplus
+}
#endif
+
+#endif // PPP_CHAP_NEW_H
diff --git a/pppd/chap_ms.h b/pppd/chap_ms.h
index e5f4c28..b3fdae6 100644
--- a/pppd/chap_ms.h
+++ b/pppd/chap_ms.h
@@ -35,6 +35,10 @@
#include "pppdconf.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define MAX_NT_PASSWORD 256 /* Max (Unicode) chars in an NT pass */
#define MS_CHAP_RESPONSE_LEN 49 /* Response length for MS-CHAP */
@@ -95,4 +99,8 @@ void GenerateAuthenticatorResponse(unsigned char *PasswordHashHash,
void chapms_init(void);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* PPP_CHAPMS_H */
diff --git a/pppd/crypto.h b/pppd/crypto.h
index af85179..c559d0c 100644
--- a/pppd/crypto.h
+++ b/pppd/crypto.h
@@ -30,6 +30,10 @@
#ifndef PPP_CRYPTO_H
#define PPP_CRYPTO_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#ifndef MD5_DIGEST_LENGTH
#define MD5_DIGEST_LENGTH 16
#endif
@@ -152,4 +156,8 @@ int PPP_crypto_init();
*/
int PPP_crypto_deinit();
+#ifdef __cplusplus
+}
#endif
+
+#endif // PPP_CRYPTO_H
diff --git a/pppd/crypto_ms.h b/pppd/crypto_ms.h
index e9a039c..38111fd 100644
--- a/pppd/crypto_ms.h
+++ b/pppd/crypto_ms.h
@@ -36,6 +36,10 @@
#include "pppdconf.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* This is the DES encrypt functions as described by RFC2759.
*
@@ -72,4 +76,8 @@ int DesEncrypt(const unsigned char *clear, const unsigned char *key,
int DesDecrypt(const unsigned char *cipher, const unsigned char *key,
unsigned char *clear);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* PPP_PPPCRYPT_H */
diff --git a/pppd/ecp.h b/pppd/ecp.h
index 5a0df4d..975d79b 100644
--- a/pppd/ecp.h
+++ b/pppd/ecp.h
@@ -35,6 +35,10 @@
#include "pppdconf.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#ifndef PPP_ECP
#define PPP_ECP 0x8053
#endif
@@ -53,4 +57,8 @@ extern ecp_options ecp_hisoptions[];
extern struct protent ecp_protent;
+#ifdef __cplusplus
+}
#endif
+
+#endif // PPP_ECP_H
diff --git a/pppd/eui64.h b/pppd/eui64.h
index f809342..c24733d 100644
--- a/pppd/eui64.h
+++ b/pppd/eui64.h
@@ -38,6 +38,10 @@
#include "pppdconf.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#if defined(SOL2)
#include <netinet/in.h>
@@ -106,4 +110,8 @@ typedef union
char *eui64_ntoa(eui64_t); /* Returns ascii representation of id */
+#ifdef __cplusplus
+}
+#endif
+
#endif /* PPP_EUI64_H */
diff --git a/pppd/fsm.h b/pppd/fsm.h
index 071b844..50f75e6 100644
--- a/pppd/fsm.h
+++ b/pppd/fsm.h
@@ -46,12 +46,15 @@
#include "pppdconf.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* Packet header = Code, id, length.
*/
#define HEADERLEN 4
-
/*
* CP (LCP, IPCP, etc.) codes.
*/
@@ -163,4 +166,8 @@ void fsm_sdata (fsm *, int, int, unsigned char *, int);
*/
extern int peer_mru[]; /* currently negotiated peer MRU (per unit) */
+#ifdef __cplusplus
+}
#endif
+
+#endif // PPP_FSM_H
diff --git a/pppd/ipcp.h b/pppd/ipcp.h
index 97b5e6b..b3f6e28 100644
--- a/pppd/ipcp.h
+++ b/pppd/ipcp.h
@@ -44,6 +44,10 @@
#include "pppdconf.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* Options.
*/
@@ -118,4 +122,8 @@ extern ip_down_hook_fn *ip_down_hook;
typedef void (ip_choose_hook_fn)(uint32_t *);
extern ip_choose_hook_fn *ip_choose_hook;
+#ifdef __cplusplus
+}
+#endif
+
#endif /* PPP_IPCP_H */
diff --git a/pppd/ipv6cp.h b/pppd/ipv6cp.h
index d6e626e..3be5885 100644
--- a/pppd/ipv6cp.h
+++ b/pppd/ipv6cp.h
@@ -39,6 +39,10 @@
#include "pppdconf.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Original version, based on RFC2023 :
Copyright (c) 1995, 1996, 1997 Francis.Dupont@inria.fr, INRIA Rocquencourt,
@@ -186,4 +190,8 @@ extern ipv6_up_hook_fn *ipv6_up_hook;
typedef void (ipv6_down_hook_fn)(void);
extern ipv6_down_hook_fn *ipv6_down_hook;
+#ifdef __cplusplus
+}
+#endif
+
#endif
diff --git a/pppd/lcp.h b/pppd/lcp.h
index 4cb77c8..bdf18d0 100644
--- a/pppd/lcp.h
+++ b/pppd/lcp.h
@@ -44,6 +44,11 @@
#include "pppdconf.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/*
* Options.
*/
@@ -144,4 +149,9 @@ extern struct protent lcp_protent;
before deciding the link is looped-back. */
#define DEFLOOPBACKFAIL 10
+
+#ifdef __cplusplus
+}
#endif
+
+#endif // PPP_LCP_H
diff --git a/pppd/magic.h b/pppd/magic.h
index 70e4ce5..68cbf9b 100644
--- a/pppd/magic.h
+++ b/pppd/magic.h
@@ -44,10 +44,18 @@
#include "pppdconf.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void magic_init (void); /* Initialize the magic number generator */
u_int32_t magic (void); /* Returns the next magic number */
/* Fill buffer with random bytes */
void random_bytes (unsigned char *buf, int len);
+#ifdef __cplusplus
+}
#endif
+
+#endif // PPP_MAGIC_H
diff --git a/pppd/main.c b/pppd/main.c
index 932855e..4455199 100644
--- a/pppd/main.c
+++ b/pppd/main.c
@@ -2038,8 +2038,10 @@ struct notifier **get_notifier_by_type(ppp_notify_t type)
[NF_SIGNALED ] = &sigreceived,
[NF_IP_UP ] = &ip_up_notifier,
[NF_IP_DOWN ] = &ip_down_notifier,
+#ifdef PPP_WITH_IPV6CP
[NF_IPV6_UP ] = &ipv6_up_notifier,
[NF_IPV6_DOWN ] = &ipv6_down_notifier,
+#endif
[NF_AUTH_UP ] = &auth_up_notifier,
[NF_LINK_DOWN ] = &link_down_notifier,
[NF_FORK ] = &fork_notifier,
diff --git a/pppd/mppe.h b/pppd/mppe.h
index 9292fe8..32fcb20 100644
--- a/pppd/mppe.h
+++ b/pppd/mppe.h
@@ -37,6 +37,11 @@
#include "pppdconf.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
#define MPPE_PAD 4 /* MPPE growth per frame */
#define MPPE_MAX_KEY_SIZE 32 /* Largest key length */
#define MPPE_MAX_KEY_LEN 16 /* Largest key size accepted by the kernel */
@@ -175,4 +180,9 @@ void mppe_set_chapv2(unsigned char *PasswordHashHash,
unsigned char *NTResponse, int IsServer);
#endif // #ifdef PPP_WITH_MPPE
+
+#ifdef __cplusplus
+}
+#endif
+
#endif // #ifdef PPP_MPPE_H
diff --git a/pppd/multilink.h b/pppd/multilink.h
index e4639bb..acf448a 100644
--- a/pppd/multilink.h
+++ b/pppd/multilink.h
@@ -33,6 +33,10 @@
#include "pppdconf.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* values for epdisc.class
*/
@@ -109,4 +113,9 @@ static inline bool mp_master() {
}
#endif // PPP_WITH_MULTILINK
+
+#ifdef __cplusplus
+}
+#endif
+
#endif // PPP_MULTILINK_H
diff --git a/pppd/options.h b/pppd/options.h
index 61d2bab..564a851 100644
--- a/pppd/options.h
+++ b/pppd/options.h
@@ -31,6 +31,10 @@
#ifndef PPP_OPTIONS_H
#define PPP_OPTIONS_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
enum opt_type {
o_special_noarg,
o_special,
@@ -111,4 +115,9 @@ int ppp_int_option(char *name, int *value);
/* Print an error message about an option */
void ppp_option_error(char *fmt, ...);
+
+#ifdef __cplusplus
+}
#endif
+
+#endif // PPP_OPTIONS_H
diff --git a/pppd/plugins/radius/clientid.c b/pppd/plugins/radius/clientid.c
index b1bbc47..eea5165 100644
--- a/pppd/plugins/radius/clientid.c
+++ b/pppd/plugins/radius/clientid.c
@@ -68,6 +68,7 @@ int rc_read_mapfile(char *filename)
if ((p = (struct map2id_s *)malloc(sizeof(*p))) == NULL) {
novm("rc_read_mapfile");
+ fclose(mapfd);
return (-1);
}
@@ -79,6 +80,7 @@ int rc_read_mapfile(char *filename)
} else {
error("rc_read_mapfile: malformed line in %s, line %d", filename, lnr);
+ fclose(mapfd);
return (-1);
}
diff --git a/pppd/plugins/radius/config.c b/pppd/plugins/radius/config.c
index 47c172c..39744fc 100644
--- a/pppd/plugins/radius/config.c
+++ b/pppd/plugins/radius/config.c
@@ -212,6 +212,7 @@ int rc_read_config(char *filename)
if ((pos = strcspn(p, "\t ")) == 0) {
error("%s: line %d: bogus format: %s", filename, line, p);
+ fclose(configfd);
return (-1);
}
@@ -224,6 +225,7 @@ int rc_read_config(char *filename)
if (option->status != ST_UNDEF) {
error("%s: line %d: duplicate option line: %s", filename, line, p);
+ fclose(configfd);
return (-1);
}
@@ -234,18 +236,22 @@ int rc_read_config(char *filename)
switch (option->type) {
case OT_STR:
if (set_option_str(filename, line, option, p) < 0)
+ fclose(configfd);
return (-1);
break;
case OT_INT:
if (set_option_int(filename, line, option, p) < 0)
+ fclose(configfd);
return (-1);
break;
case OT_SRV:
if (set_option_srv(filename, line, option, p) < 0)
+ fclose(configfd);
return (-1);
break;
case OT_AUO:
if (set_option_auo(filename, line, option, p) < 0)
+ fclose(configfd);
return (-1);
break;
default:
diff --git a/pppd/pppd.h b/pppd/pppd.h
index 135fd35..ed50f9b 100644
--- a/pppd/pppd.h
+++ b/pppd/pppd.h
@@ -43,28 +43,18 @@
#ifndef PPP_PPPD_H
#define PPP_PPPD_H
-#ifdef HAVE_STDARG_H
#include <stdarg.h>
-#endif
-
-#ifdef HAVE_STDBOOL_H
#include <stdbool.h>
-#endif
-
-#ifdef HAVE_STDDEF_H
#include <stddef.h>
-#endif
-
-#ifdef HAVE_STDINT_H
#include <stdint.h>
-#endif
-
-#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
-#endif
#include "pppdconf.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* Limits
*/
@@ -574,4 +564,8 @@ extern int (*allowed_address_hook)(uint32_t addr);
extern void (*snoop_recv_hook)(unsigned char *p, int len);
extern void (*snoop_send_hook)(unsigned char *p, int len);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* PPP_PPPD_H */
diff --git a/pppd/session.h b/pppd/session.h
index 0b91a03..499549c 100644
--- a/pppd/session.h
+++ b/pppd/session.h
@@ -32,6 +32,10 @@
#include "pppdconf.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define SESS_AUTH 1 /* Check User Authentication */
#define SESS_ACCT 2 /* Check Account Validity */
@@ -89,4 +93,8 @@ session_start(const int flags, const char* user, const char* passwd, const char*
void
session_end(const char* tty);
+#ifdef __cplusplus
+}
+#endif
+
#endif // PPP_SESSION_H
diff --git a/pppd/upap.h b/pppd/upap.h
index 061f60e..c86e520 100644
--- a/pppd/upap.h
+++ b/pppd/upap.h
@@ -44,6 +44,11 @@
#include "pppdconf.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/*
* Packet header = Code, id, length.
*/
@@ -144,4 +149,8 @@ extern pap_logout_hook_fn *pap_logout_hook;
*/
extern pap_passwd_hook_fn *pap_passwd_hook;
+#ifdef __cplusplus
+}
+#endif
+
#endif // PPP_UPAP_H