1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-19 00:13:33 +00:00

net/vde2: update to 2.3.3 release (+)

Upstream switched to GitHub
Cryptcab support now require WolfSSL instead of OpenSSL

PR:	264824
This commit is contained in:
Dima Panov 2022-07-03 00:28:11 +03:00
parent cf42607bff
commit 17ae8ac447
7 changed files with 28 additions and 185 deletions

View File

@ -1,10 +1,11 @@
# Created by: Philip M. Gollucci <ports@FreeBSD.org>
PORTNAME= vde2
PORTVERSION= 2.3.2
PORTREVISION= 5
PORTNAME= vde
PORTVERSION= 2.3.3
DISTVERSIONPREFIX= v
CATEGORIES= net
MASTER_SITES= SF/vde/${PORTNAME}/${PORTVERSION}
#MASTER_SITES= https://github.com/virtualsquare/vde-2/archive/refs/tags/
PKGNAMESUFFIX= 2
MAINTAINER= ports@FreeBSD.org
COMMENT= User-mode virtual ethernet infrastructure
@ -14,32 +15,32 @@ LICENSE_COMB= multi
LIB_DEPENDS= libpcap.so.1:net/libpcap
USES= gmake libtool pathfix shebangfix ssl
USES= autoreconf gmake libtool pathfix shebangfix ssl
USE_LDCONFIG= yes
USE_GITHUB= yes
GH_ACCOUNT= virtualsquare
GH_PROJECT= ${PORTNAME}-${PKGNAMESUFFIX}
CONFLICTS= vde
GNU_CONFIGURE= yes
INSTALL_TARGET= install-strip
SHEBANG_FILES= src/lib/python/VdePlug.py
MAKE_ENV= V=1
MAKE_JOBS_UNSAFE=yes
OPTIONS_DEFINE= PYTHON
OPTIONS_DEFAULT= PYTHON
OPTIONS_DEFINE= CRYPTCAB
OPTIONS_SUB= yes
PYTHON_CONFIGURE_OFF= --disable-python
PYTHON_USES= python:3.7-3.9 gettext-runtime
PYTHON_CPPFLAGS= -I${LOCALBASE}/include
PYTHON_LDFLAGS= -L${LOCALBASE}/lib
CRYPTCAB_DESC= Enable vde_cryptcab (require security/wolfssl)
CRYPTCAB_LIB_DEPENDS= libwolfssl.so:security/wolfssl
CRYPTCAB_USES= localbase:ldflags
CRYPTCAB_CONFIGURE_ENABLE= cryptcab
post-patch:
@${REINPLACE_CMD} -e '/-Wall/s|-O2||g' \
${WRKSRC}/configure
${WRKSRC}/configure.ac
@${REINPLACE_CMD} -e 's|$$(MAKE).*install-data-hook||g' \
${WRKSRC}/man/Makefile.in
@${REINPLACE_CMD} -e 's|^AM_CFLAGS|#AM_CFLAGS|g' \
${WRKSRC}/src/slirpvde/Makefile.in
${WRKSRC}/man/Makefile.am
post-install:
${LN} -sf unixcmd.1 ${STAGEDIR}${PREFIX}/man/man1/vdecmd.1

View File

@ -1,2 +1,3 @@
SHA256 (vde2-2.3.2.tar.gz) = 22df546a63dac88320d35d61b7833bbbcbef13529ad009c7ce3c5cb32250af93
SIZE (vde2-2.3.2.tar.gz) = 770257
TIMESTAMP = 1656794898
SHA256 (virtualsquare-vde-2-v2.3.3_GH0.tar.gz) = a7d2cc4c3d0c0ffe6aff7eb0029212f2b098313029126dcd12dc542723972379
SIZE (virtualsquare-vde-2-v2.3.3_GH0.tar.gz) = 234790

View File

@ -4,8 +4,8 @@
if (daemonize != 0)
daemon(0,0);
- else if (setpgrp() != 0) {
+ else if (setpgrp(0,getpid()) != 0) {
- else if (setpgrp() == -1) {
+ else if (setpgrp(0,getpid()) == -1) {
fprintf(stderr,"Err: cannot create pgrp\n");
perror("setpgrp");
exit(1);
}

View File

@ -1,110 +0,0 @@
--- src/vde_cryptcab/cryptcab.c.orig 2011-11-23 16:41:17 UTC
+++ src/vde_cryptcab/cryptcab.c
@@ -22,7 +22,11 @@ static void Usage(char *programname)
exit(1);
}
+#if OPENSSL_VERSION_NUMBER >= 0x1010100fL
+static EVP_CIPHER_CTX *ctx;
+#else
static EVP_CIPHER_CTX ctx;
+#endif
static int ctx_initialized = 0;
static int encryption_disabled = 0;
static int nfd;
@@ -103,19 +107,33 @@ int data_encrypt(unsigned char *src, unsigned char *ds
}
if (!ctx_initialized) {
+#if OPENSSL_VERSION_NUMBER >= 0x1010100fL
+ ctx = EVP_CIPHER_CTX_new();
+ EVP_CIPHER_CTX_init (ctx);
+#else
EVP_CIPHER_CTX_init (&ctx);
+#endif
ctx_initialized = 1;
}
+#if OPENSSL_VERSION_NUMBER >= 0x1010100fL
+ EVP_EncryptInit (ctx, EVP_bf_cbc (), p->key, p->iv);
+ if (EVP_EncryptUpdate (ctx, dst, &olen, src, len) != 1)
+#else
EVP_EncryptInit (&ctx, EVP_bf_cbc (), p->key, p->iv);
if (EVP_EncryptUpdate (&ctx, dst, &olen, src, len) != 1)
+#endif
{
fprintf (stderr,"error in encrypt update\n");
olen = -1;
goto cleanup;
}
+#if OPENSSL_VERSION_NUMBER >= 0x1010100fL
+ if (EVP_EncryptFinal (ctx, dst + olen, &tlen) != 1)
+#else
if (EVP_EncryptFinal (&ctx, dst + olen, &tlen) != 1)
+#endif
{
fprintf (stderr,"error in encrypt final\n");
olen = -1;
@@ -124,7 +142,12 @@ int data_encrypt(unsigned char *src, unsigned char *ds
olen += tlen;
cleanup:
- EVP_CIPHER_CTX_cleanup(&ctx);
+#if OPENSSL_VERSION_NUMBER >= 0x1010100fL
+ EVP_CIPHER_CTX_cleanup(ctx);
+ EVP_CIPHER_CTX_free(ctx);
+#else
+ EVP_CIPHER_CTX_cleanup(&ctx);
+#endif
return olen;
}
@@ -138,19 +161,33 @@ int data_decrypt(unsigned char *src, unsigned char *ds
}
if (!ctx_initialized) {
+#if OPENSSL_VERSION_NUMBER >= 0x1010100fL
+ ctx = EVP_CIPHER_CTX_new();
+ EVP_CIPHER_CTX_init(ctx);
+#else
EVP_CIPHER_CTX_init (&ctx);
+#endif
ctx_initialized = 1;
}
+#if OPENSSL_VERSION_NUMBER >= 0x1010100fL
+ EVP_DecryptInit (ctx, EVP_bf_cbc (), p->key, p->iv);
+ if (EVP_DecryptUpdate (ctx, dst, &olen, src, len) != 1)
+#else
EVP_DecryptInit (&ctx, EVP_bf_cbc (), p->key, p->iv);
if (EVP_DecryptUpdate (&ctx, dst, &olen, src, len) != 1)
+#endif
{
fprintf (stderr,"error in decrypt update\n");
olen = -1;
goto cleanup;
}
+#if OPENSSL_VERSION_NUMBER >= 0x1010100fL
+ if (EVP_DecryptFinal (ctx, dst + olen, &tlen) != 1)
+#else
if (EVP_DecryptFinal (&ctx, dst + olen, &tlen) != 1)
+#endif
{
fprintf (stderr,"error in decrypt final\n");
olen = -1;
@@ -159,7 +196,12 @@ int data_decrypt(unsigned char *src, unsigned char *ds
olen += tlen;
cleanup:
- EVP_CIPHER_CTX_cleanup(&ctx);
+#if OPENSSL_VERSION_NUMBER >= 0x1010100fL
+ EVP_CIPHER_CTX_cleanup(ctx);
+ EVP_CIPHER_CTX_free(ctx);
+#else
+ EVP_CIPHER_CTX_cleanup(&ctx);
+#endif
return olen;
}

View File

@ -1,23 +0,0 @@
--- src/vde_l3/vde_l3.c.orig 2021-02-23 10:35:14 UTC
+++ src/vde_l3/vde_l3.c
@@ -99,17 +99,19 @@ struct routing_policy unlimited_fifo_routing_policy ={
.policy_init = ufifo_init
};
-
+static
inline struct vde_ethernet_header *ethhead(struct vde_buff *vdb)
{
return (struct vde_ethernet_header*)(vdb->data);
}
+static
inline struct iphdr *iphead(struct vde_buff *vdb)
{
return (struct iphdr*)(vdb->data + 14);
}
+static
inline void *payload(struct vde_buff *vdb)
{
return (uint8_t*)(vdb->data + 14 + sizeof(struct iphdr));

View File

@ -1,18 +0,0 @@
--- src/vde_switch/fstp.c.orig 2021-02-23 10:19:12 UTC
+++ src/vde_switch/fstp.c
@@ -30,6 +30,7 @@ static int numports;
#ifdef FSTP
#include <fstp.h>
/*********************** sending macro used by FSTP & Core ******************/
+static
void inline ltonstring(unsigned long l,unsigned char *s) {
s[3]=l; l>>=8;
s[2]=l; l>>=8;
@@ -37,6 +38,7 @@ void inline ltonstring(unsigned long l,unsigned char *
s[0]=l;
}
+static
unsigned long inline nstringtol(unsigned char *s) {
return (s[0]<<24)+(s[1]<<16)+(s[2]<<8)+s[3];
}

View File

@ -1,19 +1,14 @@
bin/dpipe
bin/slirpvde
bin/unixcmd
bin/unixterm
bin/vde_autolink
bin/vde_cryptcab
bin/vde_l3
%%CRYPTCAB%%bin/vde_cryptcab
bin/vde_over_ns
bin/vde_pcapplug
bin/vde_plug
bin/vde_plug2tap
bin/vde_router
bin/vde_switch
bin/vdecmd
bin/vdekvm
bin/vdeq
bin/vdeqemu
bin/vdeterm
bin/wirefilter
etc/vde2/libvdemgmt/asyncrecv.rc
@ -42,11 +37,6 @@ lib/libvdesnmp.a
lib/libvdesnmp.so
lib/libvdesnmp.so.0
lib/libvdesnmp.so.0.0.1
%%PYTHON%%%%PYTHON_SITELIBDIR%%/VdePlug.py
%%PYTHON%%%%PYTHON_SITELIBDIR%%/vdeplug_python.so
lib/vde2/vde_l3/bfifo.so
lib/vde2/vde_l3/pfifo.so
lib/vde2/vde_l3/tbf.so
libdata/pkgconfig/vdehist.pc
libdata/pkgconfig/vdemgmt.pc
libdata/pkgconfig/vdeplug.pc
@ -62,7 +52,9 @@ man/man1/vde_over_ns.1.gz
man/man1/vde_pcapplug.1.gz
man/man1/vde_plug.1.gz
man/man1/vde_plug2tap.1.gz
man/man1/vde_router.1.gz
man/man1/vde_switch.1.gz
man/man1/vde_vxlan.1.gz
man/man1/vdecmd.1.gz
man/man1/vdekvm.1.gz
man/man1/vdeq.1.gz