net-misc/vde fails with storage size of ctx isn't knwon in cryptcab.c
Created attachment 558734 [details] build.log
Created attachment 558736 [details] emerge.info
Created attachment 558740 [details, diff] vde_cryptcab-compile-against-openssl-1.1.0.patch Patch from Debian
* Messages for package net-misc/vde-2.3.2-r4: * Package: net-misc/vde-2.3.2-r4 * Repository: gentoo * Maintainer: NP-Hardass@gentoo.org mlspamcb@noci.work,jmbsvicetto@gentoo.org,proxy-maint@gentoo.org * USE: abi_x86_64 amd64 elibc_glibc kernel_linux python_targets_python2_7 ssl static-libs userland_GNU * FEATURES: preserve-libs sandbox userpriv usersandbox * Applying vde-2.3.2-format-security.patch ... * Applying vde_cryptcab-compile-against-openssl-1.1.0.patch ... * ERROR: net-misc/vde-2.3.2-r4::gentoo failed (prepare phase): * patch -p1 failed with /etc/portage/patches/net-misc/vde/vde_cryptcab-compile-against-openssl-1.1.0.patch *
Created attachment 558792 [details, diff] corrected patch Some adjustments for above patch. Compiling fine. Not tested about functionality - be aware it can crash.
*** Bug 677760 has been marked as a duplicate of this bug. ***
The patch does not seem to work. Has anyone tried this?
(In reply to Amel Hodzic from comment #7) > The patch does not seem to work. Has anyone tried this? Do you mean that the package does not build or it fails at runtime? I remember building it successfully with the patch from comment 5.
FWIW, I have successfully built using the patch; and one very quick test (running qemu through a virtual win-XP boot) didn't reveal any runtime issues. -Max.
(In reply to Max Kresch from comment #9) I probably should have mentioned: I'm on amd64.
ping
I mean build time errors. For example, adapting the patch into my own overlay: diff -u vde-2.3.2-r* --- vde-2.3.2-r100.ebuild 2019-04-23 09:37:31.193769769 -0500 +++ vde-2.3.2-r4.ebuild 2019-04-29 18:20:46.924083849 -0500 @@ -31,9 +31,7 @@ S="${WORKDIR}/${MY_P}" -PATCHES=( "${FILESDIR}/${P}-format-security.patch" - "${FILESDIR}/${P}-openssl-1.1.patch" -) +PATCHES=( "${FILESDIR}/${P}-format-security.patch" ) pkg_setup() { # default group already used in kqemu The result is as follows (on amd64): ebuild vde-2.3.2-r100.ebuild install Appending /home/ilmostro/develpr/gentoo-devs/ag-ops to PORTDIR_OVERLAY... * vde2-2.3.2.tar.bz2 SHA256 SHA512 WHIRLPOOL size ;-) ... [ ok ] * Insufficient privileges to execute enewgroup >>> Unpacking source... >>> Unpacking vde2-2.3.2.tar.bz2 to /var/tmp/portage/net-misc/vde-2.3.2-r100/work >>> Source unpacked in /var/tmp/portage/net-misc/vde-2.3.2-r100/work >>> Preparing source in /var/tmp/portage/net-misc/vde-2.3.2-r100/work/vde2-2.3.2 ... * Applying vde-2.3.2-format-security.patch ... [ ok ] * Applying vde-2.3.2-openssl-1.1.patch ... 5 out of 6 hunks FAILED -- saving rejects to file src/vde_cryptcab/cryptcab.c.rej [ !! ] * ERROR: net-misc/vde-2.3.2-r100::ag-ops failed (prepare phase): * patch -p1 failed with /var/tmp/portage/net-misc/vde-2.3.2-r100/files/vde-2.3.2-openssl-1.1.patch * * Call stack: * ebuild.sh, line 124: Called src_prepare * environment, line 3715: Called default * phase-functions.sh, line 868: Called default_src_prepare * phase-functions.sh, line 933: Called __eapi6_src_prepare * environment, line 282: Called eapply '/var/tmp/portage/net-misc/vde-2.3.2-r100/files/vde-2.3.2-format-security.patch' '/var/tmp/portage/net-misc/vde-2.3.2-r100/files/vde-2.3.2-openssl-1.1.patch' * environment, line 848: Called _eapply_patch '/var/tmp/portage/net-misc/vde-2.3.2-r100/files/vde-2.3.2-openssl-1.1.patch' * environment, line 786: Called __helpers_die 'patch -p1 failed with /var/tmp/portage/net-misc/vde-2.3.2-r100/files/vde-2.3.2-openssl-1.1.patch' * isolated-functions.sh, line 119: Called die * The specific snippet of code: * die "$@" * * If you need support, post the output of `emerge --info '=net-misc/vde-2.3.2-r100::ag-ops'`, * the complete build log and the output of `emerge -pqv '=net-misc/vde-2.3.2-r100::ag-ops'`. * The complete build log is located at '/var/tmp/portage/net-misc/vde-2.3.2-r100/temp/build.log'. * The ebuild environment file is located at '/var/tmp/portage/net-misc/vde-2.3.2-r100/temp/environment'. * Working directory: '/var/tmp/portage/net-misc/vde-2.3.2-r100/work/vde2-2.3.2' * S: '/var/tmp/portage/net-misc/vde-2.3.2-r100/work/vde2-2.3.2'
The contents of "files/vde-2.3.2-openssl-1.1.patch: 1 --- vde2-2.3.2/src/vde_cryptcab/cryptcab.c 2011-11-23 18:41:17.000000000 +0200 2 +++ vde2-2.3.2.orig/src/vde_cryptcab/cryptcab.c 2018-12-29 13:37:10.479813884 +0200 3 @@ -22,7 +22,7 @@ 4 exit(1); 5 } 6 7 -static EVP_CIPHER_CTX ctx; 8 +static EVP_CIPHER_CTX *ctx; 9 static int ctx_initialized = 0; 10 static int encryption_disabled = 0; 11 static int nfd; 12 @@ -30,6 +30,10 @@ 13 static struct vde_open_args open_args={.port=0,.group=NULL,.mode=0700}; 14 static int verbose = 0; 15 16 +#if OPENSSL_VERSION_NUMBER < 0x10100000 17 +#define EVP_CIPHER_CTX_reset(x) EVP_CIPHER_CTX_cleanup(x) 18 +#endif 19 + 20 void vc_printlog(int priority, const char *format, ...) 21 { 22 va_list arg; 23 @@ -103,19 +107,21 @@ 24 } 25 26 if (!ctx_initialized) { 27 - EVP_CIPHER_CTX_init (&ctx); 28 + ctx = EVP_CIPHER_CTX_new (); 29 + if (!ctx) 30 + return -1; 31 ctx_initialized = 1; 32 } 33 34 - EVP_EncryptInit (&ctx, EVP_bf_cbc (), p->key, p->iv); 35 - if (EVP_EncryptUpdate (&ctx, dst, &olen, src, len) != 1) 36 + EVP_EncryptInit (ctx, EVP_bf_cbc (), p->key, p->iv); 37 + if (EVP_EncryptUpdate (ctx, dst, &olen, src, len) != 1) 38 { 39 fprintf (stderr,"error in encrypt update\n"); 40 olen = -1; 41 goto cleanup; 42 } 43 44 - if (EVP_EncryptFinal (&ctx, dst + olen, &tlen) != 1) 45 + if (EVP_EncryptFinal (ctx, dst + olen, &tlen) != 1) 46 { 47 fprintf (stderr,"error in encrypt final\n"); 48 olen = -1; 49 @@ -124,7 +130,7 @@ 50 olen += tlen; 51 52 cleanup: 53 - EVP_CIPHER_CTX_cleanup(&ctx); 54 + EVP_CIPHER_CTX_reset(ctx); 55 return olen; 56 } 57 58 @@ -138,19 +144,21 @@ 59 } 60 61 if (!ctx_initialized) { 62 - EVP_CIPHER_CTX_init (&ctx); 63 + ctx = EVP_CIPHER_CTX_new (); 64 + if (!ctx) 65 + return -1; 66 ctx_initialized = 1; 67 } 68 69 - EVP_DecryptInit (&ctx, EVP_bf_cbc (), p->key, p->iv); 70 - if (EVP_DecryptUpdate (&ctx, dst, &olen, src, len) != 1) 71 + EVP_DecryptInit (ctx, EVP_bf_cbc (), p->key, p->iv); 72 + if (EVP_DecryptUpdate (ctx, dst, &olen, src, olen) != 1) 73 { 74 fprintf (stderr,"error in decrypt update\n"); 75 olen = -1; 76 goto cleanup; 77 } 78 79 - if (EVP_DecryptFinal (&ctx, dst + olen, &tlen) != 1) 80 + if (EVP_DecryptFinal (ctx, dst + olen, &tlen) != 1) 81 { 82 fprintf (stderr,"error in decrypt final\n"); 83 olen = -1; 84 @@ -159,7 +167,7 @@ 85 olen += tlen; 86 87 cleanup: 88 - EVP_CIPHER_CTX_cleanup(&ctx); 89 + EVP_CIPHER_CTX_reset (ctx); 90 return olen; 91 } 92 93
Created attachment 574766 [details] patch-failed-build.log
Created attachment 574768 [details] rejected-patched-source-file cryptcab.c.rej
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a0bae155d65b5fd1ed4be98f52ec47012d39156a commit a0bae155d65b5fd1ed4be98f52ec47012d39156a Author: Andreas Sturmlechner <asturm@gentoo.org> AuthorDate: 2019-05-06 19:49:16 +0000 Commit: Andreas Sturmlechner <asturm@gentoo.org> CommitDate: 2019-05-08 17:03:37 +0000 net-misc/vde: Fix build with >=dev-libs/openssl-1.1 Closes: https://bugs.gentoo.org/673928 Package-Manager: Portage-2.3.66, Repoman-2.3.12 Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org> net-misc/vde/files/vde-2.3.2-openssl-1.1.patch | 104 +++++++++++++++++++++++++ net-misc/vde/vde-2.3.2-r4.ebuild | 5 ++ 2 files changed, 109 insertions(+)