Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master grimoire by Ismael Luceno (567a369895333988a3b963d256c8cd3459e42398)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Ismael Luceno <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master grimoire by Ismael Luceno (567a369895333988a3b963d256c8cd3459e42398)
  • Date: Mon, 18 Apr 2022 17:36:19 +0000

GIT changes to master grimoire by Ismael Luceno <ismael AT sourcemage.org>:

net/vpnc/DETAILS | 1
net/vpnc/HISTORY | 14 +
net/vpnc/PRE_BUILD | 8
net/vpnc/patches/0001-Fix-build-against-musl-libc.patch | 58 +++++
net/vpnc/patches/0002-Fix-cleanup-of-shared-secret.patch | 39 +++
net/vpnc/patches/0003-Fix-unused-variable-warnings.patch | 122
++++++++++++
net/vpnc/patches/0004-Fix-debug-message-format-string.patch | 26 ++
7 files changed, 260 insertions(+), 8 deletions(-)

New commits:
commit 567a369895333988a3b963d256c8cd3459e42398
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>

vpnc: Cleanup HISTORY

commit 3611040264f1ca57ab75ccad4fd939f385715006
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>

vpnc: Fix debug message format string

commit 5ee12d4d4296d9e92d23a55877d81983730b4ad5
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>

vpnc: Fix unused variable warnings

commit ac34d123a1fdfc27988022a0f486a9af0c40fabe
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>

vpnc: Fix shared secret cleanup, SECURITY_PATCH++

commit dc9f06448eb4895ceacdb1aa9d0979aa47103d31
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>

vpnc: Fix build against musl

commit f7f5423ec2e27fa907ab83c831bb73c34b92e1e5
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>

vpnc: Remove edit of Makefile, not needed

diff --git a/net/vpnc/DETAILS b/net/vpnc/DETAILS
index 51c5fd6..826bc78 100755
--- a/net/vpnc/DETAILS
+++ b/net/vpnc/DETAILS
@@ -1,5 +1,6 @@
SPELL=vpnc
VERSION=0.5.3
+ SECURITY_PATCH=1
SOURCE=$SPELL-$VERSION.tar.gz
SOURCE_DIRECTORY=$BUILD_DIRECTORY/$SPELL-$VERSION
SOURCE_URL[0]=http://www.unix-ag.uni-kl.de/%7Emassar/vpnc/$SOURCE
diff --git a/net/vpnc/HISTORY b/net/vpnc/HISTORY
index 51722c3..dfbe40c 100644
--- a/net/vpnc/HISTORY
+++ b/net/vpnc/HISTORY
@@ -1,3 +1,12 @@
+2022-04-18 Ismael Luceno <ismael AT sourcemage.org>
+ * PRE_BUILD: removed edit of Makefile, not needed
+ added apply_patch_dir
+ * patches/0001-Fix-build-against-musl-libc.patch: fixed musl build
+ * patches/0002-Fix-cleanup-of-shared-secret.patch: fixed security
issue
+ * patches/0003-Fix-unused-variable-warnings.patch,
+ patches/0004-Fix-debug-message-format-string.patch: fixed minor
issues
+ * DETAILS: SECURITY_PATCH++
+
2010-10-06 Eric Sandall <sandalle AT sourcemage.org>
* PRE_BUILD: Fix sed to not mangle the Makefile

@@ -8,7 +17,7 @@
* DEPENDS: runtime_depends iproute2 (ip)

2008-08-18 Mathieu Lonjaret <lejatorn AT sourcemage.org>
- * DETAILS: 0.5.1 update
+ * DETAILS: 0.5.1 update

2006-10-03 Juuso Alasuutari <iuso AT sourcemage.org>
* DETAILS: [automated] Removed UPDATED.
@@ -23,5 +32,4 @@
* vpnc-0.3.3.tar.gz.sig: Updated to sha512 hash

2005-10-03 Eric Sandall <sandalle AT sourcemage.org>
- * DETAILS,DEPENDS,PRE_BUILD,BUILD,INSTALL: Created
-
+ * DETAILS, DEPENDS, PRE_BUILD, BUILD, INSTALL: Created
diff --git a/net/vpnc/PRE_BUILD b/net/vpnc/PRE_BUILD
index 1817d59..c230ad1 100755
--- a/net/vpnc/PRE_BUILD
+++ b/net/vpnc/PRE_BUILD
@@ -1,5 +1,3 @@
-default_pre_build &&
-#
-# Use our optimizations as well
-#
-sedit "s:CFLAGS ?=*:& ${CFLAGS} :" $SOURCE_DIRECTORY/Makefile
+default_pre_build &&
+cd "$SOURCE_DIRECTORY" &&
+apply_patch_dir patches
diff --git a/net/vpnc/patches/0001-Fix-build-against-musl-libc.patch
b/net/vpnc/patches/0001-Fix-build-against-musl-libc.patch
new file mode 100644
index 0000000..b376fcd
--- /dev/null
+++ b/net/vpnc/patches/0001-Fix-build-against-musl-libc.patch
@@ -0,0 +1,58 @@
+From 82ec49cec5c78f1ba3d1b5dddedfa77804d9fe5d Mon Sep 17 00:00:00 2001
+From: Ismael Luceno <ismael AT iodev.co.uk>
+Date: Mon, 18 Apr 2022 18:55:20 +0200
+Subject: [PATCH 1/4] Fix build against musl libc
+
+Signed-off-by: Ismael Luceno <ismael AT iodev.co.uk>
+---
+ sysdep.h | 7 ++++++-
+ vpnc.c | 2 +-
+ 2 files changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/sysdep.h b/sysdep.h
+index a5eafd6d87ea..d182e8340313 100644
+--- a/sysdep.h
++++ b/sysdep.h
+@@ -25,8 +25,11 @@
+ #if !defined(__CYGWIN__)
+ #include <net/if.h>
+ #include <net/if_arp.h>
++/* might conflict with <linux/if_ether.h> */
++#if defined(__linux__) && !defined(_LINUX_IF_ETHER_H)
+ #include <netinet/if_ether.h>
+ #endif
++#endif
+
+ #include "config.h"
+
+@@ -38,11 +41,13 @@ int tun_get_hwaddr(int fd, char *dev, uint8_t *hwaddr);
+
+
/***************************************************************************/
+ #if defined(__linux__) || defined(__GLIBC__)
++#ifdef __GLIBC__
+ #include <error.h>
++#define HAVE_ERROR 1
++#endif
+
+ #define HAVE_VASPRINTF 1
+ #define HAVE_ASPRINTF 1
+-#define HAVE_ERROR 1
+ #define HAVE_GETLINE 1
+ #define HAVE_UNSETENV 1
+ #define HAVE_SETENV 1
+diff --git a/vpnc.c b/vpnc.c
+index 38dc17fcc171..39eb40e86fa5 100644
+--- a/vpnc.c
++++ b/vpnc.c
+@@ -24,7 +24,7 @@
+ #define _GNU_SOURCE
+ #include <assert.h>
+ #include <unistd.h>
+-#include <sys/fcntl.h>
++#include <fcntl.h>
+ #include <stdio.h>
+ #include <errno.h>
+ #include <string.h>
+--
+2.35.3
+
diff --git a/net/vpnc/patches/0002-Fix-cleanup-of-shared-secret.patch
b/net/vpnc/patches/0002-Fix-cleanup-of-shared-secret.patch
new file mode 100644
index 0000000..d186e8e
--- /dev/null
+++ b/net/vpnc/patches/0002-Fix-cleanup-of-shared-secret.patch
@@ -0,0 +1,39 @@
+From 3a1af8afcafbc83b8f087833ae845829aa67765b Mon Sep 17 00:00:00 2001
+From: Ismael Luceno <ismael AT iodev.co.uk>
+Date: Mon, 18 Apr 2022 19:04:44 +0200
+Subject: [PATCH 2/4] Fix cleanup of shared secret
+
+Signed-off-by: Ismael Luceno <ismael AT iodev.co.uk>
+---
+ vpnc.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/vpnc.c b/vpnc.c
+index 39eb40e86fa5..474d94029c89 100644
+--- a/vpnc.c
++++ b/vpnc.c
+@@ -1853,9 +1853,11 @@ static void do_phase1_am(const char *key_id, const
char *shared_key, struct sa_b
+ static const unsigned char c012[3] = { 0, 1, 2 };
+ unsigned char *skeyid_e;
+ unsigned char *dh_shared_secret;
++ size_t dh_shared_secret_len;
+
+ /* Determine the shared secret. */
+- dh_shared_secret = xallocc(dh_getlen(dh_grp));
++ dh_shared_secret_len = dh_getlen(dh_grp);
++ dh_shared_secret = xallocc(dh_shared_secret_len);
+ dh_create_shared(dh_grp, dh_shared_secret,
ke->u.ke.data);
+ hex_dump("dh_shared_secret", dh_shared_secret,
dh_getlen(dh_grp), NULL);
+
+@@ -1899,7 +1901,7 @@ static void do_phase1_am(const char *key_id, const
char *shared_key, struct sa_b
+ gcry_md_close(hm);
+ hex_dump("skeyid_e", skeyid_e, s->ike.md_len, NULL);
+
+- memset(dh_shared_secret, 0, sizeof(dh_shared_secret));
++ memset(dh_shared_secret, 0, dh_shared_secret_len);
+ free(dh_shared_secret);
+
+ /* Determine the IKE encryption key. */
+--
+2.35.3
+
diff --git a/net/vpnc/patches/0003-Fix-unused-variable-warnings.patch
b/net/vpnc/patches/0003-Fix-unused-variable-warnings.patch
new file mode 100644
index 0000000..aaae1a0
--- /dev/null
+++ b/net/vpnc/patches/0003-Fix-unused-variable-warnings.patch
@@ -0,0 +1,122 @@
+From 30c29986235c24607e484e9bf7246666a249cc9c Mon Sep 17 00:00:00 2001
+From: Ismael Luceno <ismael AT iodev.co.uk>
+Date: Mon, 18 Apr 2022 19:07:19 +0200
+Subject: [PATCH 3/4] Fix unused variable warnings
+
+Signed-off-by: Ismael Luceno <ismael AT iodev.co.uk>
+---
+ math_group.c | 5 ++---
+ sysdep.c | 4 ++--
+ tunip.c | 4 +---
+ vpnc.c | 6 ++----
+ 4 files changed, 7 insertions(+), 12 deletions(-)
+
+diff --git a/math_group.c b/math_group.c
+index 5590450483e5..05d0d2e13f63 100644
+--- a/math_group.c
++++ b/math_group.c
+@@ -240,10 +240,9 @@ static void modp_getraw(struct group *grp, gcry_mpi_t
v, unsigned char *d)
+ {
+ size_t l, l2;
+ unsigned char *tmp;
+- int ret;
+
+ l = grp->getlen(grp);
+- ret = gcry_mpi_aprint(GCRYMPI_FMT_STD, &tmp, &l2, v);
++ gcry_mpi_aprint(GCRYMPI_FMT_STD, &tmp, &l2, v);
+ memcpy(d, tmp + (l2 - l), l);
+ gcry_free(tmp);
+ #if 0
+@@ -260,7 +259,7 @@ static int modp_setraw(struct group *grp, gcry_mpi_t d,
unsigned char *s, int l)
+ {
+ int i;
+
+- grp = NULL; /* unused */
++ (void)grp; /* unused */
+
+ gcry_mpi_set_ui(d, 0);
+ for (i = 0; i < l; i++) {
+diff --git a/sysdep.c b/sysdep.c
+index ff07753d7c6e..1f6d23502dca 100644
+--- a/sysdep.c
++++ b/sysdep.c
+@@ -510,13 +510,13 @@ int tun_close(int fd, char *dev)
+ #elif defined(__CYGWIN__)
+ int tun_close(int fd, char *dev)
+ {
+- dev = NULL; /* unused */
++ (void)dev; /* unused */
+ return CloseHandle((HANDLE) get_osfhandle(fd));
+ }
+ #else
+ int tun_close(int fd, char *dev)
+ {
+- dev = NULL; /*unused */
++ (void)dev; /*unused */
+ return close(fd);
+ }
+ #endif
+diff --git a/tunip.c b/tunip.c
+index 19db71736cd5..262cf987c8b1 100644
+--- a/tunip.c
++++ b/tunip.c
+@@ -490,9 +490,7 @@ static int encap_esp_recv_peer(struct sa_block *s)
+ unsigned char padlen, next_header;
+ unsigned char *pad;
+ unsigned char *iv;
+- struct esp_encap_header *eh;
+
+- eh = (struct esp_encap_header *)(s->ipsec.rx.buf +
s->ipsec.rx.bufpayload);
+ s->ipsec.rx.var_header_size = s->ipsec.iv_len;
+ iv = s->ipsec.rx.buf + s->ipsec.rx.bufpayload +
s->ipsec.em->fixed_header_size;
+
+@@ -655,7 +653,7 @@ static int process_non_ip(struct sa_block *s, uint8_t
*frame)
+ {
+ struct ether_header *eth = (struct ether_header *) frame;
+
+- s = NULL; /* unused */
++ (void)s; /* unused */
+
+ if (ntohs(eth->ether_type) != ETHERTYPE_IP) {
+ /* drop non-ip traffic */
+diff --git a/vpnc.c b/vpnc.c
+index 474d94029c89..4631b8ff6794 100644
+--- a/vpnc.c
++++ b/vpnc.c
+@@ -740,7 +740,6 @@ static void send_phase2_late(struct sa_block *s, struct
isakmp_payload *pl,
+ struct isakmp_packet *p;
+ uint8_t *p_flat;
+ size_t p_size;
+- ssize_t recvlen;
+
+ /* Build up the packet. */
+ p = new_isakmp_packet();
+@@ -758,7 +757,7 @@ static void send_phase2_late(struct sa_block *s, struct
isakmp_payload *pl,
+
+ s->ike.life.tx += p_size;
+
+- recvlen = sendrecv(s, NULL, 0, p_flat, p_size, 1);
++ sendrecv(s, NULL, 0, p_flat, p_size, 1);
+ free(p_flat);
+ }
+
+@@ -1306,7 +1305,7 @@ static void do_phase1_am(const char *key_id, const
char *shared_key, struct sa_b
+ struct isakmp_payload *last_cert = NULL;
+ struct isakmp_payload *sig = NULL;
+ struct isakmp_payload *idp = NULL;
+- int seen_sa = 0, seen_xauth_vid = 0;
++ int seen_sa = 0;
+ unsigned char *psk_skeyid;
+ unsigned char *skeyid;
+ gcry_md_hd_t skeyid_ctx;
+@@ -1490,7 +1489,6 @@ static void do_phase1_am(const char *key_id, const
char *shared_key, struct sa_b
+ if (rp->u.vid.length == sizeof(VID_XAUTH)
+ && memcmp(rp->u.vid.data, VID_XAUTH,
+ sizeof(VID_XAUTH)) == 0) {
+- seen_xauth_vid = 1;
+ } else if (rp->u.vid.length ==
sizeof(VID_NATT_RFC)
+ && memcmp(rp->u.vid.data,
VID_NATT_RFC,
+ sizeof(VID_NATT_RFC)) == 0) {
+--
+2.35.3
+
diff --git a/net/vpnc/patches/0004-Fix-debug-message-format-string.patch
b/net/vpnc/patches/0004-Fix-debug-message-format-string.patch
new file mode 100644
index 0000000..91cfcc1
--- /dev/null
+++ b/net/vpnc/patches/0004-Fix-debug-message-format-string.patch
@@ -0,0 +1,26 @@
+From f7cb5f93d85063590841d60bb10cf7b306d0c246 Mon Sep 17 00:00:00 2001
+From: Ismael Luceno <ismael AT iodev.co.uk>
+Date: Mon, 18 Apr 2022 19:07:40 +0200
+Subject: [PATCH 4/4] Fix debug message format string
+
+Signed-off-by: Ismael Luceno <ismael AT iodev.co.uk>
+---
+ isakmp-pkt.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/isakmp-pkt.c b/isakmp-pkt.c
+index d241ad8c3a2a..0d5cb714fe3d 100644
+--- a/isakmp-pkt.c
++++ b/isakmp-pkt.c
+@@ -820,7 +820,7 @@ struct isakmp_packet *parse_isakmp_packet(const uint8_t
* data, size_t data_len,
+ }
+
+ DEBUG(3, printf("BEGIN_PARSE\n"));
+- DEBUG(3, printf("Recieved Packet Len: %d\n", data_len));
++ DEBUG(3, printf("Recieved Packet Len: %zu\n", data_len));
+ fetchn(r->i_cookie, ISAKMP_COOKIE_LENGTH);
+ hex_dump("i_cookie", r->i_cookie, ISAKMP_COOKIE_LENGTH, NULL);
+ fetchn(r->r_cookie, ISAKMP_COOKIE_LENGTH);
+--
+2.35.3
+



  • [SM-Commit] GIT changes to master grimoire by Ismael Luceno (567a369895333988a3b963d256c8cd3459e42398), Ismael Luceno, 04/18/2022

Archive powered by MHonArc 2.6.24.

Top of Page