diff options
author | orbea <orbea@riseup.net> | 2024-10-17 11:45:23 -0700 |
---|---|---|
committer | orbea <orbea@riseup.net> | 2024-10-17 11:45:23 -0700 |
commit | f4f00a12faff472a748434200fb97c94472e1f80 (patch) | |
tree | fca058e552ac0de7e16ad9c20b08cc15d0fce1d1 | |
parent | app-crypt/qca: drop 2.3.8 (diff) | |
download | libressl-f4f00a12faff472a748434200fb97c94472e1f80.tar.gz libressl-f4f00a12faff472a748434200fb97c94472e1f80.tar.bz2 libressl-f4f00a12faff472a748434200fb97c94472e1f80.zip |
net-dialup/ppp: new package, add 2.5.0-r7, 2.5.1
Signed-off-by: orbea <orbea@riseup.net>
18 files changed, 997 insertions, 0 deletions
diff --git a/net-dialup/ppp/Manifest b/net-dialup/ppp/Manifest new file mode 100644 index 0000000..28ffd73 --- /dev/null +++ b/net-dialup/ppp/Manifest @@ -0,0 +1,3 @@ +DIST ppp-2.5.0.tar.gz 1170057 BLAKE2B 6a0e9efcbff3cb499705071cc7d0e3411cf4871fd53b2bfedbb1f2cf3ad80728eb436050cf33b78e36d473be64f15907a21da17f283337455f0af379bc18272d SHA512 094368ea2aa6c6e8dfba4443509857a7c1c7ff839bb6d6657743802477208c01e87db31593cef0932d3725c640e9c103179da6b742825034cda82bd31ddcc2ed +DIST ppp-2.5.1.tar.gz 991639 BLAKE2B e3ece873ea25bde5ddffd0da168ffe6ba890693f20fb9f1d6a48f365331abdb4cf517fd0b3004d26a0c778ad4d750e39e38486544e2771b23223469db13c239c SHA512 57b3bbf918c302dbc621f56b706efa1b35b2fc45b71c3a309c1cfee22c28fcf98d7f8965fbeba9260c124f2afb9e297885007256ee05469adca73fad032902b9 +DIST pppgetpass.8 450 BLAKE2B 4e9805cfecb4d07c302682c1ced42cc5d247d18fae904b909e126874af962cf48bb703cd75b0cefce4e19404f2e757602d3b57f187567fc23d4b93d9598d1486 SHA512 21f6dda908cf73ee27bfa39d2b50e7f76b371e50bd7d5a0586174b30129c119accbd260d7f9e0e6aa6aabfa5ba11a13ba560588a99672c9dd4e9f33254f88836 diff --git a/net-dialup/ppp/files/README.mpls b/net-dialup/ppp/files/README.mpls new file mode 100644 index 0000000..1ae7ae4 --- /dev/null +++ b/net-dialup/ppp/files/README.mpls @@ -0,0 +1,15 @@ +MPLS consists of 3 components: +1. MPLS forwarding +2. MPLS signalling +3. Mapping layer 3 traffic onto MPLS LSPs + +The document mpls-forwarding basics explains item 1. + +Examples of MPLS signalling protocols are: RSVP-TE LDP and CR-LDP. +The package ldp-portable is an implementation of LDP and contains more +information about LDP based MPLS signalling. + +Mapping of layer 3 traffic to MPLS LSPs is accomplised in a couple of +different ways. +-Per FEC where FEC is an entry in the routing table +-Virtual interface that represents an LSP diff --git a/net-dialup/ppp/files/modules.ppp b/net-dialup/ppp/files/modules.ppp new file mode 100644 index 0000000..e936041 --- /dev/null +++ b/net-dialup/ppp/files/modules.ppp @@ -0,0 +1,10 @@ +alias char-major-108 ppp_generic +alias /dev/ppp ppp_generic +alias tty-ldisc-3 ppp_async +alias tty-ldisc-13 n_hdlc +alias tty-ldisc-14 ppp_synctty +alias ppp-compress-18 ppp_mppe +alias ppp-compress-21 bsd_comp +alias ppp-compress-24 ppp_deflate +alias ppp-compress-26 ppp_deflate +alias net-pf-24 pppoe diff --git a/net-dialup/ppp/files/ppp-2.4.9-fix-MPPE-sstpc.patch b/net-dialup/ppp/files/ppp-2.4.9-fix-MPPE-sstpc.patch new file mode 100644 index 0000000..15a1298 --- /dev/null +++ b/net-dialup/ppp/files/ppp-2.4.9-fix-MPPE-sstpc.patch @@ -0,0 +1,25 @@ +https://github.com/ppp-project/ppp/commit/d7e62a8499c4032d79e05afbd8fd3efd51c5b148 +https://bugs.launchpad.net/ubuntu/+source/ppp/+bug/1958196 + +From: =?UTF-8?q?Eivind=20N=C3=A6ss?= <eivnaes@yahoo.com> +Date: Thu, 3 Feb 2022 14:28:22 -0800 +Subject: [PATCH] pppd/eap: Fix bug causing incorrect response length (#334) +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Need to update the esp->ea_client.ea_namelen variable. A plugin can override the +name of the user, and the variable is passed onto the eap_chap2_response generating +the wrong response length. + +Signed-off-by: Eivind Næss <eivnaes@yahoo.com> +--- a/pppd/eap.c ++++ b/pppd/eap.c +@@ -2182,6 +2182,7 @@ eap_request(eap_state *esp, u_char *inp, int id, int len) + eap_send_nak(esp, id, EAPT_SRP); + break; + } ++ esp->es_client.ea_namelen = strlen(esp->es_client.ea_name); + + /* Create the MSCHAPv2 response (and add to cache) */ + unsigned char response[MS_CHAP2_RESPONSE_LEN+1]; // VLEN + VALUE diff --git a/net-dialup/ppp/files/ppp-2.4.9-fix-clang-nested-functions.patch b/net-dialup/ppp/files/ppp-2.4.9-fix-clang-nested-functions.patch new file mode 100644 index 0000000..0a089e9 --- /dev/null +++ b/net-dialup/ppp/files/ppp-2.4.9-fix-clang-nested-functions.patch @@ -0,0 +1,65 @@ +https://github.com/ppp-project/ppp/commit/6e6a48fe628b76ec368277fd52685428e3dc8766 +https://bugs.gentoo.org/831305 + +From: =?UTF-8?q?Eivind=20N=C3=A6ss?= <eivnaes@yahoo.com> +Date: Sun, 11 Jul 2021 14:36:44 -0700 +Subject: [PATCH] Compiling with clang encounters an error in eap-tls.c +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This moves the inline functions to outside the function and declares them static. + +Signed-off-by: Eivind Næss <eivnaes@yahoo.com> +--- a/pppd/eap-tls.c ++++ b/pppd/eap-tls.c +@@ -285,6 +285,23 @@ ENGINE *eaptls_ssl_load_engine( char *engine_name ) + #endif + + ++#ifndef OPENSSL_NO_ENGINE ++static int eaptls_UI_writer(UI *ui, UI_STRING *uis) ++{ ++ PW_CB_DATA* cb_data = (PW_CB_DATA*)UI_get0_user_data(ui); ++ UI_set_result(ui, uis, cb_data->password); ++ return 1; ++} ++ ++static int eaptls_UI_stub(UI* ui) { ++ return 1; ++} ++ ++static int eaptls_UI_reader(UI *ui, UI_STRING *uis) { ++ return 1; ++} ++#endif ++ + /* + * Initialize the SSL stacks and tests if certificates, key and crl + * for client or server use can be loaded. +@@ -578,20 +595,11 @@ SSL_CTX *eaptls_init_ssl(int init_server, char *cacertfile, char *capath, + { + UI_METHOD* transfer_pin = UI_create_method("transfer_pin"); + +- int writer (UI *ui, UI_STRING *uis) +- { +- PW_CB_DATA* cb_data = (PW_CB_DATA*)UI_get0_user_data(ui); +- UI_set_result(ui, uis, cb_data->password); +- return 1; +- }; +- int stub (UI* ui) {return 1;}; +- int stub_reader (UI *ui, UI_STRING *uis) {return 1;}; +- +- UI_method_set_writer(transfer_pin, writer); +- UI_method_set_opener(transfer_pin, stub); +- UI_method_set_closer(transfer_pin, stub); +- UI_method_set_flusher(transfer_pin, stub); +- UI_method_set_reader(transfer_pin, stub_reader); ++ UI_method_set_writer(transfer_pin, eaptls_UI_writer); ++ UI_method_set_opener(transfer_pin, eaptls_UI_stub); ++ UI_method_set_closer(transfer_pin, eaptls_UI_stub); ++ UI_method_set_flusher(transfer_pin, eaptls_UI_stub); ++ UI_method_set_reader(transfer_pin, eaptls_UI_reader); + + dbglog( "Using our private key URI: '%s' in engine", privkeyfile ); + pkey = ENGINE_load_private_key(pkey_engine, privkeyfile, transfer_pin, &cb_data); diff --git a/net-dialup/ppp/files/ppp-2.4.9-fix-openssl-sysroot-clang.patch b/net-dialup/ppp/files/ppp-2.4.9-fix-openssl-sysroot-clang.patch new file mode 100644 index 0000000..2bf8c45 --- /dev/null +++ b/net-dialup/ppp/files/ppp-2.4.9-fix-openssl-sysroot-clang.patch @@ -0,0 +1,14 @@ +https://bugs.gentoo.org/831305 + +Upstream git has merged autotoolsification PR so no need for this. +--- a/pppd/Makefile.linux ++++ b/pppd/Makefile.linux +@@ -155,7 +155,7 @@ endif + + ifdef NEEDDES + ifndef USE_CRYPT +-CFLAGS += -I$(shell $(CC) --print-sysroot)/usr/include/openssl ++CFLAGS += -I$(INSTROOT)/usr/include/openssl + NEEDCRYPTOLIB = y + else + CFLAGS += -DUSE_CRYPT=1 diff --git a/net-dialup/ppp/files/ppp-2.4.9-pppol2tp-ipv6.patch b/net-dialup/ppp/files/ppp-2.4.9-pppol2tp-ipv6.patch new file mode 100644 index 0000000..40773b2 --- /dev/null +++ b/net-dialup/ppp/files/ppp-2.4.9-pppol2tp-ipv6.patch @@ -0,0 +1,28 @@ +https://bugs.gentoo.org/904740 +https://github.com/ppp-project/ppp/pull/319 + +From 44a70d6f9eb6d1843868da1d45de382134a03630 Mon Sep 17 00:00:00 2001 +From: str8fast <52187302+str8fast@users.noreply.github.com> +Date: Thu, 28 Oct 2021 14:55:56 +0000 +Subject: [PATCH] pppol2tp.c add '#ifdef INET6' for optional ipv6 + +Without it, l2tp daemon can't launch ppp, cuz undefined symbol ipv6_up_notifier. +--- + pppd/plugins/pppol2tp/pppol2tp.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/pppd/plugins/pppol2tp/pppol2tp.c b/pppd/plugins/pppol2tp/pppol2tp.c +index ed2d7c79..c9902afe 100644 +--- a/pppd/plugins/pppol2tp/pppol2tp.c ++++ b/pppd/plugins/pppol2tp/pppol2tp.c +@@ -509,8 +509,10 @@ void plugin_init(void) + */ + add_notifier(&ip_up_notifier, pppol2tp_ip_up, NULL); + add_notifier(&ip_down_notifier, pppol2tp_ip_down, NULL); ++#ifdef INET6 + add_notifier(&ipv6_up_notifier, pppol2tp_ip_up, NULL); + add_notifier(&ipv6_down_notifier, pppol2tp_ip_down, NULL); ++#endif + } + + struct channel pppol2tp_channel = { diff --git a/net-dialup/ppp/files/ppp-2.5.0-openssl-pkgconfig.patch b/net-dialup/ppp/files/ppp-2.5.0-openssl-pkgconfig.patch new file mode 100644 index 0000000..893b623 --- /dev/null +++ b/net-dialup/ppp/files/ppp-2.5.0-openssl-pkgconfig.patch @@ -0,0 +1,79 @@ +https://bugs.gentoo.org/905442 +https://github.com/ppp-project/ppp/pull/438 + +From 9b4bdca70081abbad26277b009ef9c4ab7e276d0 Mon Sep 17 00:00:00 2001 +From: Brahmajit Das <brahmajit.xyz@gmail.com> +Date: Thu, 2 Nov 2023 11:26:18 +0530 +Subject: [PATCH] Fix linking error with lld linkers (#438) + +When using lld linker, build fails with + +ld.lld: error: /usr/lib/gcc/x86_64-pc-linux-gnu/12/../../../../lib64/Scrt1.o is incompatible with elf32-i386 +ld.lld: error: /usr/lib/gcc/x86_64-pc-linux-gnu/12/../../../../lib64/crti.o is incompatible with elf32-i386 +ld.lld: error: /usr/lib/llvm/16/bin/../../../../lib/clang/16/lib/linux + +The fix is to check pkg-config first, and not force manual -L /usr/lib. +If pkg-config succeeded, then we don't bother with -L /usr/lib + +Our guess is this what the actual intention was based upon the coments + +if pkg-config is installed and openssl has installed a .pc file, +then use that information and don't search ssldirs + +First found on gentoo linux with llvm profile, please check out Bug: +section of the commit for more info and a complete build log. + +Bug: https://bugs.gentoo.org/905442 + +Signed-off-by: Brahmajit Das <brahmajit.xyz@gmail.com> +Co-authored-by: Sam James <sam@gentoo.org> +--- + m4/ax_check_openssl.m4 | 28 ++++++++++++++-------------- + 1 file changed, 14 insertions(+), 14 deletions(-) + +diff --git a/m4/ax_check_openssl.m4 b/m4/ax_check_openssl.m4 +index 8ae39cae6..39154c856 100644 +--- a/m4/ax_check_openssl.m4 ++++ b/m4/ax_check_openssl.m4 +@@ -55,6 +55,20 @@ AC_DEFUN([AX_CHECK_OPENSSL], [ + ]) + + AS_IF([test "${with_openssl}" != "no"], [ ++ # if pkg-config is installed and openssl has installed a .pc file, ++ # then use that information and don't search ssldirs ++ AC_PATH_PROG([PKG_CONFIG], [pkg-config]) ++ if test x"$PKG_CONFIG" != x""; then ++ OPENSSL_LDFLAGS=`$PKG_CONFIG openssl --libs-only-L 2>/dev/null` ++ if test $? = 0; then ++ OPENSSL_LIBS=`$PKG_CONFIG openssl --libs-only-l 2>/dev/null` ++ OPENSSL_INCLUDES=`$PKG_CONFIG openssl --cflags-only-I 2>/dev/null` ++ found=true ++ fi ++ fi ++ ]) ++ ++ AS_IF([test "${with_openssl}" != "no" && test ! ${found}], [ + OPENSSL_INCLUDES= + for ssldir in $ssldirs; do + AC_MSG_CHECKING([for openssl/ssl.h in $ssldir]) +@@ -69,20 +83,6 @@ AC_DEFUN([AX_CHECK_OPENSSL], [ + AC_MSG_RESULT([no]) + ]) + done]) +- +- AS_IF([test "${with_openssl}" != "no" && test ! ${found}], [ +- # if pkg-config is installed and openssl has installed a .pc file, +- # then use that information and don't search ssldirs +- AC_PATH_PROG([PKG_CONFIG], [pkg-config]) +- if test x"$PKG_CONFIG" != x""; then +- OPENSSL_LDFLAGS=`$PKG_CONFIG openssl --libs-only-L 2>/dev/null` +- if test $? = 0; then +- OPENSSL_LIBS=`$PKG_CONFIG openssl --libs-only-l 2>/dev/null` +- OPENSSL_INCLUDES=`$PKG_CONFIG openssl --cflags-only-I 2>/dev/null` +- found=true +- fi +- fi +- ]) + + AS_IF([test "${with_openssl}" != "no" && test ${found}], [ + diff --git a/net-dialup/ppp/files/ppp-2.5.0-pam-pkgconfig.patch b/net-dialup/ppp/files/ppp-2.5.0-pam-pkgconfig.patch new file mode 100644 index 0000000..40488fe --- /dev/null +++ b/net-dialup/ppp/files/ppp-2.5.0-pam-pkgconfig.patch @@ -0,0 +1,81 @@ +https://github.com/ppp-project/ppp/pull/479 + +From c73498fad415d99aa566b11256938272e62b22dd Mon Sep 17 00:00:00 2001 +From: Mike Gilbert <floppym@gentoo.org> +Date: Tue, 5 Mar 2024 14:41:10 -0500 +Subject: [PATCH] Use pkg-config to detect PAM when possible + +Signed-off-by: Mike Gilbert <floppym@gentoo.org> +--- + m4/ax_check_pam.m4 | 50 ++++++++++++++++++++-------------------------- + 1 file changed, 22 insertions(+), 28 deletions(-) + +diff --git a/m4/ax_check_pam.m4 b/m4/ax_check_pam.m4 +index b17a7573c..7ebd79b61 100644 +--- a/m4/ax_check_pam.m4 ++++ b/m4/ax_check_pam.m4 +@@ -26,34 +26,28 @@ + AC_DEFUN([AX_CHECK_PAM], [ + AC_ARG_WITH([pam], + [AS_HELP_STRING([--with-pam=DIR], +- [With libpam support, see ftp.redhat.com:/pub/pam])], +- [ +- case "$withval" in +- "" | y | ye | yes) +- pamdirs="/usr/local /usr/lib /usr" +- ;; +- n | no) +- with_pam="no" +- ;; +- *) +- pamdirs="$withval" +- ;; +- esac +- ]) ++ [With libpam support, see ftp.redhat.com:/pub/pam])]) + +- if [ test "x${with_pam}" != "xno" ] ; then +- PAM_LIBS="-lpam" +- for pamdir in $pamdirs; do +- AC_MSG_CHECKING([for pam_appl.h in $pamdir]) +- if test -f "$pamdir/include/security/pam_appl.h"; then +- PAM_CFLAGS="-I$pamdir/include" +- PAM_LDFLAGS="-L$pamdir/lib" +- AC_MSG_RESULT([yes]) +- break +- else +- AC_MSG_RESULT([no]) +- fi +- done ++ AS_IF([test "$with_pam" != "no"], [ ++ AS_CASE(["$with_pam"], ++ [""|yes], [PKG_CHECK_MODULES([PAM], [pam], [pamdirs=], ++ [pamdirs="/usr/local /usr/lib /usr"])], ++ [pamdirs="$with_pam"]) ++ ++ AS_IF([test -n "$pamdirs"], [ ++ PAM_LIBS="-lpam" ++ for pamdir in $pamdirs; do ++ AC_MSG_CHECKING([for pam_appl.h in $pamdir]) ++ if test -f "$pamdir/include/security/pam_appl.h"; then ++ PAM_CFLAGS="-I$pamdir/include" ++ PAM_LDFLAGS="-L$pamdir/lib" ++ AC_MSG_RESULT([yes]) ++ break ++ else ++ AC_MSG_RESULT([no]) ++ fi ++ done ++ ]) + + # try the preprocessor and linker with our new flags, + # being careful not to pollute the global LIBS, LDFLAGS, and CPPFLAGS +@@ -87,7 +81,7 @@ AC_DEFUN([AX_CHECK_PAM], [ + AC_SUBST([PAM_CFLAGS]) + AC_SUBST([PAM_LIBS]) + AC_SUBST([PAM_LDFLAGS]) +- fi ++ ]) + AM_CONDITIONAL(WITH_LIBPAM, test "x${with_pam}" != "xno") + ]) + diff --git a/net-dialup/ppp/files/ppp-2.5.0-passwordfd-read-early.patch b/net-dialup/ppp/files/ppp-2.5.0-passwordfd-read-early.patch new file mode 100644 index 0000000..5c7067c --- /dev/null +++ b/net-dialup/ppp/files/ppp-2.5.0-passwordfd-read-early.patch @@ -0,0 +1,101 @@ +https://github.com/ppp-project/ppp/pull/420 + +From df35ecb4ab63e8f89f57aa5d593441765a96ed62 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Alin=20N=C4=83stac?= <mrness@gentoo.org> +Date: Fri, 20 Jun 2008 18:34:06 +0000 +Subject: [PATCH] passwordfd: read password early + +Bug: https://bugs.gentoo.org/209294 +Bug: https://bugs.gentoo.org/905112 +--- + pppd/plugins/passwordfd.c | 54 ++++++++++++++++++--------------------- + 1 file changed, 25 insertions(+), 29 deletions(-) + +diff --git a/pppd/plugins/passwordfd.c b/pppd/plugins/passwordfd.c +index c1f782e..13aec56 100644 +--- a/pppd/plugins/passwordfd.c ++++ b/pppd/plugins/passwordfd.c +@@ -24,11 +24,11 @@ + + char pppd_version[] = PPPD_VERSION; + +-static int passwdfd = -1; + static char save_passwd[MAXSECRETLEN]; + ++static int readpassword (char **); + static struct option options[] = { +- { "passwordfd", o_int, &passwdfd, ++ { "passwordfd", o_special, (void *)readpassword, + "Receive password on this file descriptor" }, + { NULL } + }; +@@ -38,43 +38,39 @@ static int pwfd_check (void) + return 1; + } + +-static int pwfd_passwd (char *user, char *passwd) ++static int readpassword(char **argv) + { +- int readgood, red; +- +- if (passwdfd == -1) +- return -1; ++ char *arg = *argv; ++ int passwdfd = -1; ++ int chunk, len; + +- if (passwd == NULL) +- return 1; +- +- if (passwdfd == -2) { +- strcpy (passwd, save_passwd); +- return 1; ++ if (sscanf(arg, "%d", &passwdfd) != 1 || passwdfd < 0) ++ { ++ error ("\"%s\" is not a valid file descriptor number", arg); ++ return 0; + } + +- readgood = 0; ++ len = 0; + do { +- red = read (passwdfd, passwd + readgood, MAXSECRETLEN - 1 - readgood); +- if (red == 0) +- break; +- if (red < 0) { +- error ("Can't read secret from fd\n"); +- readgood = -1; ++ chunk = read (passwdfd, save_passwd + len, MAXSECRETLEN - 1 - len); ++ if (chunk == 0) + break; ++ if (chunk < 0) { ++ error ("Can't read secret from fd %d", passwdfd); ++ return 0; + } +- readgood += red; +- } while (readgood < MAXSECRETLEN - 1); +- ++ len += chunk; ++ } while (len < MAXSECRETLEN - 1); ++ save_passwd[len] = 0; + close (passwdfd); + +- if (readgood < 0) +- return 0; +- +- passwd[readgood] = 0; +- strcpy (save_passwd, passwd); +- passwdfd = -2; ++ return 1; ++} + ++static int pwfd_passwd (char *user, char *passwd) ++{ ++ if (passwd != NULL) ++ strcpy (passwd, save_passwd); + return 1; + } + +-- +2.40.1 + diff --git a/net-dialup/ppp/files/ppp-2.5.0-pidfile.patch b/net-dialup/ppp/files/ppp-2.5.0-pidfile.patch new file mode 100644 index 0000000..538ddfb --- /dev/null +++ b/net-dialup/ppp/files/ppp-2.5.0-pidfile.patch @@ -0,0 +1,39 @@ +https://github.com/ppp-project/ppp/pull/427 + +From 0c9f2cb93f56d2a14ffcc97f53f4665b7728d8e4 Mon Sep 17 00:00:00 2001 +From: Mike Gilbert <floppym@gentoo.org> +Date: Sun, 28 May 2023 17:01:12 -0400 +Subject: [PATCH] Ensure there is a '/' between PPP_PATH_VARRUN and the PID + filename + +Bug: https://bugs.gentoo.org/907311 +Signed-off-by: Mike Gilbert <floppym@gentoo.org> +--- + pppd/main.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/pppd/main.c b/pppd/main.c +index 4455199..c207d10 100644 +--- a/pppd/main.c ++++ b/pppd/main.c +@@ -888,7 +888,7 @@ create_pidfile(int pid) + { + FILE *pidfile; + +- slprintf(pidfilename, sizeof(pidfilename), "%s%s.pid", ++ slprintf(pidfilename, sizeof(pidfilename), "%s/%s.pid", + PPP_PATH_VARRUN, ifname); + if ((pidfile = fopen(pidfilename, "w")) != NULL) { + fprintf(pidfile, "%d\n", pid); +@@ -907,7 +907,7 @@ create_linkpidfile(int pid) + if (linkname[0] == 0) + return; + ppp_script_setenv("LINKNAME", linkname, 1); +- slprintf(linkpidfile, sizeof(linkpidfile), "%sppp-%s.pid", ++ slprintf(linkpidfile, sizeof(linkpidfile), "%s/ppp-%s.pid", + PPP_PATH_VARRUN, linkname); + if ((pidfile = fopen(linkpidfile, "w")) != NULL) { + fprintf(pidfile, "%d\n", pid); +-- +2.40.1 + diff --git a/net-dialup/ppp/files/ppp-2.5.0-radius-mppe.patch b/net-dialup/ppp/files/ppp-2.5.0-radius-mppe.patch new file mode 100644 index 0000000..7bb63c9 --- /dev/null +++ b/net-dialup/ppp/files/ppp-2.5.0-radius-mppe.patch @@ -0,0 +1,167 @@ +https://github.com/ppp-project/ppp/pull/463 +https://bugs.gentoo.org/915686 + +From 77693b89fed6d4110184789f8e7dfd31710f3190 Mon Sep 17 00:00:00 2001 +From: Jaco Kroon <jaco@uls.co.za> +Date: Thu, 23 Nov 2023 14:54:42 +0200 +Subject: [PATCH] radius: fix the MPPE key decryption for the second-half of + the key block. + +During he refactor in commit 4cb90c1 the key material used to decrypt +the second-half of the encrypted block was accidentally updated from: + +MD5(radius_secret + crypt[0..15]); to: + +MD5(radius_secret + crypt[0..15] + salt) + +Which would obviously mismatch. + +This also refactors back into what I believe to be a more readable block +with lower nesting and more comprehensive error reporting. + +Closes: #453 +Signed-off-by: Jaco Kroon <jaco@uls.co.za> +--- + pppd/plugins/radius/radius.c | 115 +++++++++++++++++------------------ + 1 file changed, 55 insertions(+), 60 deletions(-) + +diff --git a/pppd/plugins/radius/radius.c b/pppd/plugins/radius/radius.c +index c73ca0b53..e99bc7511 100644 +--- a/pppd/plugins/radius/radius.c ++++ b/pppd/plugins/radius/radius.c +@@ -897,80 +897,75 @@ radius_setmppekeys2(VALUE_PAIR *vp, REQUEST_INFO *req_info) + memcpy(plain, crypt, 32); + + ctx = PPP_MD_CTX_new(); +- if (ctx) { +- +- if (PPP_DigestInit(ctx, PPP_md5())) { +- +- if (PPP_DigestUpdate(ctx, req_info->secret, strlen(req_info->secret))) { +- +- if (PPP_DigestUpdate(ctx, req_info->request_vector, AUTH_VECTOR_LEN)) { +- +- if (PPP_DigestUpdate(ctx, salt, 2)) { +- +- buflen = sizeof(buf); +- if (PPP_DigestFinal(ctx, buf, &buflen)) { +- +- status = 1; +- } +- } +- } +- } +- } +- +- PPP_MD_CTX_free(ctx); ++ if (!ctx) { ++ error("RADIUS: Error creating PPP_MD_CTX for MS-MPPE-%s-Key attribute", type); ++ return -1; + } + +- if (status) { +- +- for (i = 0; i < 16; i++) { +- plain[i] ^= buf[i]; +- } ++ buflen = sizeof(buf); ++ if (!PPP_DigestInit(ctx, PPP_md5())) { ++ error("RADIUS: Error setting hash algorithm to MD5 for MS-MPPE-%s-Key attribute", type); ++ } else if (!PPP_DigestUpdate(ctx, req_info->secret, strlen(req_info->secret))) { ++ error("RADIUS: Error mixing in radius secret for MS-MPPE-%s-Key attribute", type); ++ } else if (!PPP_DigestUpdate(ctx, req_info->request_vector, AUTH_VECTOR_LEN)) { ++ error("RADIUS: Error mixing in request vector for MS-MPPE-%s-Key attribute", type); ++ } else if (!PPP_DigestUpdate(ctx, salt, 2)) { ++ error("RADIUS: Error mixing in salt for MS-MPPE-%s-Key attribute", type); ++ } else if (!PPP_DigestFinal(ctx, buf, &buflen)) { ++ error("RADIUS: Error finalizing key buffer for MS-MPPE-%s-Key attribute", type); ++ } else { ++ status = 1; ++ } + +- if (plain[0] != 16) { +- error("RADIUS: Incorrect key length (%d) for MS-MPPE-%s-Key attribute", +- (int) plain[0], type); +- return -1; +- } ++ PPP_MD_CTX_free(ctx); + +- status = 0; +- ctx = PPP_MD_CTX_new(); +- if (ctx) { +- +- if (PPP_DigestInit(ctx, PPP_md5())) { ++ if (!status) ++ return -1; + +- if (PPP_DigestUpdate(ctx, req_info->secret, strlen(req_info->secret))) { ++ for (i = 0; i < 16; i++) { ++ plain[i] ^= buf[i]; ++ } + +- if (PPP_DigestUpdate(ctx, crypt, 16)) { ++ if (plain[0] != 16) { ++ error("RADIUS: Incorrect key length (%d) for MS-MPPE-%s-Key attribute", ++ (int) plain[0], type); ++ return -1; ++ } + +- if (PPP_DigestUpdate(ctx, salt, 2)) { ++ status = 0; ++ ctx = PPP_MD_CTX_new(); ++ if (!ctx) { ++ error("RADIUS: Error creating PPP_MD_CTX for MS-MPPE-%s-Key(2) attribute", type); ++ return -1; ++ } + +- buflen = sizeof(buf); +- if (PPP_DigestFinal(ctx, buf, &buflen)) { ++ buflen = sizeof(buf); + +- status = 1; +- } +- } +- } +- } +- } ++ if (!PPP_DigestInit(ctx, PPP_md5())) { ++ error("RADIUS: Error setting hash algorithm to MD5 for MS-MPPE-%s-Key(2) attribute", type); ++ } else if (!PPP_DigestUpdate(ctx, req_info->secret, strlen(req_info->secret))) { ++ error("RADIUS: Error mixing in radius secret for MS-MPPE-%s-Key(2) attribute", type); ++ } else if (!PPP_DigestUpdate(ctx, crypt, 16)) { ++ error("RADIUS: Error mixing in crypt vector for MS-MPPE-%s-Key(2) attribute", type); ++ } else if (!PPP_DigestFinal(ctx, buf, &buflen)) { ++ error("RADIUS: Error finalizing key buffer for MS-MPPE-%s-Key(2) attribute", type); ++ } else { ++ status = 1; ++ } + +- PPP_MD_CTX_free(ctx); +- } ++ PPP_MD_CTX_free(ctx); + +- if (status) { ++ if (!status) ++ return -1; + +- plain[16] ^= buf[0]; /* only need the first byte */ ++ plain[16] ^= buf[0]; /* only need the first byte */ + +- if (vp->attribute == PW_MS_MPPE_SEND_KEY) { +- mppe_set_keys(plain + 1, NULL, 16); +- } else { +- mppe_set_keys(NULL, plain + 1, 16); +- } +- return 0; +- } ++ if (vp->attribute == PW_MS_MPPE_SEND_KEY) { ++ mppe_set_keys(plain + 1, NULL, 16); ++ } else { ++ mppe_set_keys(NULL, plain + 1, 16); + } +- +- return -1; ++ return 0; + } + #endif /* PPP_WITH_MPPE */ + diff --git a/net-dialup/ppp/files/ppp-2.5.0-radiusclient.conf-parsing.patch b/net-dialup/ppp/files/ppp-2.5.0-radiusclient.conf-parsing.patch new file mode 100644 index 0000000..9916f76 --- /dev/null +++ b/net-dialup/ppp/files/ppp-2.5.0-radiusclient.conf-parsing.patch @@ -0,0 +1,48 @@ +https://github.com/ppp-project/ppp/issues/411 +https://github.com/ppp-project/ppp/commit/7f89208b860ea0c41636410bfdb6a609b2772f47 +https://bugs.gentoo.org/908396 + +From 7f89208b860ea0c41636410bfdb6a609b2772f47 Mon Sep 17 00:00:00 2001 +From: Eivind Naess <eivnaes@yahoo.com> +Date: Sun, 23 Apr 2023 11:37:01 -0700 +Subject: [PATCH] Closes #411, Fixing up parsing in radiusclient.conf + +Adding curly braces to fix the code. + +Signed-off-by: Eivind Naess <eivnaes@yahoo.com> +--- a/pppd/plugins/radius/config.c ++++ b/pppd/plugins/radius/config.c +@@ -235,24 +235,28 @@ int rc_read_config(char *filename) + + switch (option->type) { + case OT_STR: +- if (set_option_str(filename, line, option, p) < 0) ++ 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) ++ 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) ++ 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) ++ if (set_option_auo(filename, line, option, p) < 0) { + fclose(configfd); + return (-1); ++ } + break; + default: + fatal("rc_read_config: impossible case branch!"); + diff --git a/net-dialup/ppp/files/ppp-2.5.1-libressl.patch b/net-dialup/ppp/files/ppp-2.5.1-libressl.patch new file mode 100644 index 0000000..bed1c86 --- /dev/null +++ b/net-dialup/ppp/files/ppp-2.5.1-libressl.patch @@ -0,0 +1,28 @@ +https://github.com/ppp-project/ppp/pull/526 + +From 5c6c77dc314980a1dd8d2ec7b27cea4b77716f86 Mon Sep 17 00:00:00 2001 +From: orbea <orbea@riseup.net> +Date: Thu, 17 Oct 2024 11:38:12 -0700 +Subject: [PATCH] pppd: fix build with LibreSSL 4.0.0 + +Starting with LibreSSL 4.0.0 the OPENSSL_load_builtin_modules() function +was removed. It is obsolete after automatic library initialization and +now an internal API. +--- + pppd/eap-tls.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/pppd/eap-tls.c b/pppd/eap-tls.c +index d70557ee7..4c0b99b33 100644 +--- a/pppd/eap-tls.c ++++ b/pppd/eap-tls.c +@@ -171,7 +171,9 @@ CONF *eaptls_ssl_load_config( void ) + #ifndef OPENSSL_NO_ENGINE + ENGINE_load_builtin_engines(); + #endif ++#if !defined(LIBRESSL_VERSION_NUMBER) || (LIBRESSL_VERSION_NUMBER < 0x4000000fL) + OPENSSL_load_builtin_modules(); ++#endif + + dbglog( "Loading OpenSSL configured modules" ); + if (CONF_modules_load( config, NULL, 0 ) <= 0 ) diff --git a/net-dialup/ppp/files/pppd.tmpfiles b/net-dialup/ppp/files/pppd.tmpfiles new file mode 100644 index 0000000..81b402e --- /dev/null +++ b/net-dialup/ppp/files/pppd.tmpfiles @@ -0,0 +1,2 @@ +d /run/pppd +L /run/pppd/lock - - - - ../lock diff --git a/net-dialup/ppp/metadata.xml b/net-dialup/ppp/metadata.xml new file mode 100644 index 0000000..6ac3bc3 --- /dev/null +++ b/net-dialup/ppp/metadata.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="project"> + <email>base-system@gentoo.org</email> + <name>Gentoo Base System</name> + </maintainer> + <use> + <flag name="activefilter">Enables active filter support</flag> + <flag name="dhcp">Installs PPP DHCP client plugin for IP address allocation + by a DHCP server (see http://www.netservers.co.uk/gpl/)</flag> + <flag name="eap-tls">Enables support for Extensible Authentication + Protocol and Transport Level Security (see + http://www.nikhef.nl/~janjust/ppp/index.html)</flag> + <flag name="gtk">Installs GTK+ password prompting program that can be used + by passprompt.so PPP plugin for reading the password from a X11 input + terminal</flag> + <flag name="radius">Enables RADIUS support</flag> + </use> + <upstream> + <remote-id type="cpe">cpe:/a:samba:ppp</remote-id> + <remote-id type="github">ppp-project/ppp</remote-id> + </upstream> +</pkgmetadata> diff --git a/net-dialup/ppp/ppp-2.5.0-r7.ebuild b/net-dialup/ppp/ppp-2.5.0-r7.ebuild new file mode 100644 index 0000000..3c47f1b --- /dev/null +++ b/net-dialup/ppp/ppp-2.5.0-r7.ebuild @@ -0,0 +1,142 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit autotools linux-info pam tmpfiles + +DESCRIPTION="Point-to-Point Protocol (PPP)" +HOMEPAGE="https://ppp.samba.org/" +SRC_URI=" + https://download.samba.org/pub/ppp/${P}.tar.gz + https://raw.githubusercontent.com/ppp-project/ppp/${P}/contrib/pppgetpass/pppgetpass.8 +" + +LICENSE="BSD GPL-2" +SLOT="0/${PV}" +KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~mips ppc ppc64 ~riscv ~s390 sparc x86" +IUSE="activefilter atm gtk pam selinux systemd" + +DEPEND=" + dev-libs/openssl:0= + virtual/libcrypt:= + activefilter? ( net-libs/libpcap ) + atm? ( net-dialup/linux-atm ) + gtk? ( x11-libs/gtk+:2 ) + pam? ( sys-libs/pam ) + systemd? ( sys-apps/systemd ) +" +RDEPEND=" + ${DEPEND} + !<net-misc/netifrc-0.7.1-r2 + selinux? ( sec-policy/selinux-ppp ) +" +BDEPEND="virtual/pkgconfig" +PDEPEND="net-dialup/ppp-scripts" + +PATCHES=( + "${FILESDIR}"/ppp-2.5.0-passwordfd-read-early.patch + "${FILESDIR}"/ppp-2.5.0-pidfile.patch + "${FILESDIR}"/ppp-2.5.0-radiusclient.conf-parsing.patch + "${FILESDIR}"/ppp-2.5.0-openssl-pkgconfig.patch + "${FILESDIR}"/ppp-2.5.0-pam-pkgconfig.patch + "${FILESDIR}"/ppp-2.5.0-radius-mppe.patch + "${FILESDIR}"/ppp-2.5.1-libressl.patch +) + +pkg_setup() { + local CONFIG_CHECK="~PPP ~PPP_ASYNC ~PPP_SYNC_TTY" + local ERROR_PPP="CONFIG_PPP:\t missing PPP support (REQUIRED)" + local ERROR_PPP_ASYNC="CONFIG_PPP_ASYNC:\t missing asynchronous serial line discipline" + ERROR_PPP_ASYNC+=" (optional, but highly recommended)" + local WARNING_PPP_SYNC_TTY="CONFIG_PPP_SYNC_TTY:\t missing synchronous serial line discipline" + WARNING_PPP_SYNC_TTY+=" (optional; used by 'sync' pppd option)" + if use activefilter ; then + CONFIG_CHECK+=" ~PPP_FILTER" + local ERROR_PPP_FILTER="CONFIG_PPP_FILTER:\t missing PPP filtering support (REQUIRED)" + fi + CONFIG_CHECK+=" ~PPP_DEFLATE ~PPP_BSDCOMP ~PPP_MPPE" + local ERROR_PPP_DEFLATE="CONFIG_PPP_DEFLATE:\t missing Deflate compression (optional, but highly recommended)" + local ERROR_PPP_BSDCOMP="CONFIG_PPP_BSDCOMP:\t missing BSD-Compress compression (optional, but highly recommended)" + local WARNING_PPP_MPPE="CONFIG_PPP_MPPE:\t missing MPPE encryption (optional, mostly used by PPTP links)" + CONFIG_CHECK+=" ~PPPOE ~PACKET" + local WARNING_PPPOE="CONFIG_PPPOE:\t missing PPPoE support (optional, needed by pppoe plugin)" + local WARNING_PACKET="CONFIG_PACKET:\t missing AF_PACKET support (optional, used by pppoe plugin)" + if use atm ; then + CONFIG_CHECK+=" ~PPPOATM" + local WARNING_PPPOATM="CONFIG_PPPOATM:\t missing PPPoA support (optional, needed by pppoatm plugin)" + fi + + linux-info_pkg_setup +} + +src_prepare() { + default + eautoreconf + + # Set the right paths in radiusclient.conf + sed -e "s:/usr/local/etc:/etc:" \ + -e "s:/usr/local/sbin:/usr/sbin:" \ + -i pppd/plugins/radius/etc/radiusclient.conf || die + # Set config dir to /etc/ppp/radius + sed -i -e "s:/etc/radiusclient:/etc/ppp/radius:g" \ + pppd/plugins/radius/{*.8,*.c,*.h} \ + pppd/plugins/radius/etc/* || die +} + +src_configure() { + local args=( + --localstatedir="${EPREFIX}"/var + --runstatedir="${EPREFIX}"/run + $(use_enable systemd) + $(use_with atm) + $(use_with pam) + $(use_with activefilter pcap) + $(use_with gtk) + --enable-cbcp + --enable-multilink + ) + econf "${args[@]}" +} + +src_install() { + default + + find "${ED}" -name '*.la' -type f -delete || die + + if use pam; then + pamd_mimic_system ppp auth account session + fi + + insinto /etc/modprobe.d + newins "${FILESDIR}/modules.ppp" ppp.conf + + dosbin scripts/p{on,off,log} + doman scripts/pon.1 + dosym pon.1 /usr/share/man/man1/poff.1 + dosym pon.1 /usr/share/man/man1/plog.1 + + # Adding misc. specialized scripts to doc dir + dodoc -r scripts + + if use gtk ; then + dosbin contrib/pppgetpass/pppgetpass.{gtk,vt} + newsbin contrib/pppgetpass/pppgetpass.sh pppgetpass + else + newsbin contrib/pppgetpass/pppgetpass.vt pppgetpass + fi + + newtmpfiles "${FILESDIR}/pppd.tmpfiles" pppd.conf + + # Missing from upstream tarball + # https://github.com/ppp-project/ppp/pull/412 + #doman contrib/pppgetpass/pppgetpass.8 + doman "${DISTDIR}/pppgetpass.8" + + insinto /etc/ppp/radius + doins pppd/plugins/radius/etc/{dictionary*,issue,port-id-map,radiusclient.conf,realms,servers} +} + +pkg_postinst() { + tmpfiles_process pppd.conf +} diff --git a/net-dialup/ppp/ppp-2.5.1.ebuild b/net-dialup/ppp/ppp-2.5.1.ebuild new file mode 100644 index 0000000..919941d --- /dev/null +++ b/net-dialup/ppp/ppp-2.5.1.ebuild @@ -0,0 +1,126 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit linux-info pam tmpfiles + +DESCRIPTION="Point-to-Point Protocol (PPP)" +HOMEPAGE="https://ppp.samba.org/" +SRC_URI="https://download.samba.org/pub/ppp/${P}.tar.gz" + +LICENSE="BSD GPL-2" +SLOT="0/${PV}" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" +IUSE="activefilter atm gtk pam selinux systemd" + +DEPEND=" + dev-libs/openssl:0= + virtual/libcrypt:= + activefilter? ( net-libs/libpcap ) + atm? ( net-dialup/linux-atm ) + gtk? ( x11-libs/gtk+:2 ) + pam? ( sys-libs/pam ) + systemd? ( sys-apps/systemd ) +" +RDEPEND=" + ${DEPEND} + selinux? ( sec-policy/selinux-ppp ) +" +BDEPEND="virtual/pkgconfig" +PDEPEND="net-dialup/ppp-scripts" + +PATCHES=( "${FILESDIR}"/${PN}-2.5.1-libressl.patch ) + +pkg_setup() { + local CONFIG_CHECK="~PPP ~PPP_ASYNC ~PPP_SYNC_TTY" + local ERROR_PPP="CONFIG_PPP:\t missing PPP support (REQUIRED)" + local ERROR_PPP_ASYNC="CONFIG_PPP_ASYNC:\t missing asynchronous serial line discipline" + ERROR_PPP_ASYNC+=" (optional, but highly recommended)" + local WARNING_PPP_SYNC_TTY="CONFIG_PPP_SYNC_TTY:\t missing synchronous serial line discipline" + WARNING_PPP_SYNC_TTY+=" (optional; used by 'sync' pppd option)" + if use activefilter ; then + CONFIG_CHECK+=" ~PPP_FILTER" + local ERROR_PPP_FILTER="CONFIG_PPP_FILTER:\t missing PPP filtering support (REQUIRED)" + fi + CONFIG_CHECK+=" ~PPP_DEFLATE ~PPP_BSDCOMP ~PPP_MPPE" + local ERROR_PPP_DEFLATE="CONFIG_PPP_DEFLATE:\t missing Deflate compression (optional, but highly recommended)" + local ERROR_PPP_BSDCOMP="CONFIG_PPP_BSDCOMP:\t missing BSD-Compress compression (optional, but highly recommended)" + local WARNING_PPP_MPPE="CONFIG_PPP_MPPE:\t missing MPPE encryption (optional, mostly used by PPTP links)" + CONFIG_CHECK+=" ~PPPOE ~PACKET" + local WARNING_PPPOE="CONFIG_PPPOE:\t missing PPPoE support (optional, needed by pppoe plugin)" + local WARNING_PACKET="CONFIG_PACKET:\t missing AF_PACKET support (optional, used by pppoe plugin)" + if use atm ; then + CONFIG_CHECK+=" ~PPPOATM" + local WARNING_PPPOATM="CONFIG_PPPOATM:\t missing PPPoA support (optional, needed by pppoatm plugin)" + fi + + linux-info_pkg_setup +} + +src_prepare() { + default + + # Set the right paths in radiusclient.conf + sed -e "s:/usr/local/etc:/etc:" \ + -e "s:/usr/local/sbin:/usr/sbin:" \ + -i pppd/plugins/radius/etc/radiusclient.conf || die + # Set config dir to /etc/ppp/radius + sed -i -e "s:/etc/radiusclient:/etc/ppp/radius:g" \ + pppd/plugins/radius/{*.8,*.c,*.h} \ + pppd/plugins/radius/etc/* || die +} + +src_configure() { + local args=( + --localstatedir="${EPREFIX}"/var + --runstatedir="${EPREFIX}"/run + $(use_enable systemd) + $(use_with atm) + $(use_with pam) + $(use_with activefilter pcap) + $(use_with gtk) + --enable-cbcp + --enable-multilink + ) + econf "${args[@]}" +} + +src_install() { + default + + find "${ED}" -name '*.la' -type f -delete || die + + if use pam; then + pamd_mimic_system ppp auth account session + fi + + insinto /etc/modprobe.d + newins "${FILESDIR}/modules.ppp" ppp.conf + + dosbin scripts/p{on,off,log} + doman scripts/pon.1 + dosym pon.1 /usr/share/man/man1/poff.1 + dosym pon.1 /usr/share/man/man1/plog.1 + + # Adding misc. specialized scripts to doc dir + dodoc -r scripts + + if use gtk ; then + dosbin contrib/pppgetpass/pppgetpass.{gtk,vt} + newsbin contrib/pppgetpass/pppgetpass.sh pppgetpass + else + newsbin contrib/pppgetpass/pppgetpass.vt pppgetpass + fi + + doman contrib/pppgetpass/pppgetpass.8 + + newtmpfiles "${FILESDIR}/pppd.tmpfiles" pppd.conf + + insinto /etc/ppp/radius + doins pppd/plugins/radius/etc/{dictionary*,issue,port-id-map,radiusclient.conf,realms,servers} +} + +pkg_postinst() { + tmpfiles_process pppd.conf +} |