Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 673928 - net-misc/vde-2.3.2-r4 with >=dev-libs/openssl-1.1.0 - cryptcab.c:25:23: error: storage size of 'ctx' isn't known
Summary: net-misc/vde-2.3.2-r4 with >=dev-libs/openssl-1.1.0 - cryptcab.c:25:23: error...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Adam Feldman
URL:
Whiteboard:
Keywords: PATCH
: 677760 (view as bug list)
Depends on:
Blocks: openssl-1.1
  Show dependency tree
 
Reported: 2018-12-28 22:11 UTC by Vincent-Xavier JUMEL
Modified: 2019-05-08 17:04 UTC (History)
9 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,62.90 KB, text/plain)
2018-12-28 22:12 UTC, Vincent-Xavier JUMEL
Details
emerge.info (emerge.info,22.01 KB, text/plain)
2018-12-28 22:14 UTC, Vincent-Xavier JUMEL
Details
vde_cryptcab-compile-against-openssl-1.1.0.patch (vde_cryptcab-compile-against-openssl-1.1.0.patch,3.14 KB, patch)
2018-12-28 23:32 UTC, Lars Wendler (Polynomial-C) (RETIRED)
Details | Diff
corrected patch (vde-openssl-1.1.patch,2.29 KB, patch)
2018-12-29 11:47 UTC, Ognian Tenchev
Details | Diff
patch-failed-build.log (build.log,3.29 KB, text/x-log)
2019-04-29 23:31 UTC, Amel Hodzic
Details
rejected-patched-source-file (cryptcab.c.rej,1.87 KB, text/x-reject)
2019-04-29 23:35 UTC, Amel Hodzic
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vincent-Xavier JUMEL 2018-12-28 22:11:29 UTC
net-misc/vde fails with storage size of ctx isn't knwon in cryptcab.c
Comment 1 Vincent-Xavier JUMEL 2018-12-28 22:12:46 UTC
Created attachment 558734 [details]
build.log
Comment 2 Vincent-Xavier JUMEL 2018-12-28 22:14:12 UTC
Created attachment 558736 [details]
emerge.info
Comment 3 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2018-12-28 23:32:03 UTC
Created attachment 558740 [details, diff]
vde_cryptcab-compile-against-openssl-1.1.0.patch

Patch from Debian
Comment 4 Denis Descheneaux 2018-12-28 23:52:12 UTC
 * 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
 *
Comment 5 Ognian Tenchev 2018-12-29 11:47:39 UTC
Created attachment 558792 [details, diff]
corrected patch

Some adjustments for above patch. Compiling fine. Not tested about functionality - be aware it can crash.
Comment 6 Toralf Förster gentoo-dev 2019-02-16 14:01:20 UTC
*** Bug 677760 has been marked as a duplicate of this bug. ***
Comment 7 Amel Hodzic 2019-04-23 14:38:51 UTC
The patch does not seem to work.  Has anyone tried this?
Comment 8 Maciej S. Szmigiero 2019-04-23 14:51:40 UTC
(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.
Comment 9 Max Kresch 2019-04-23 18:31:04 UTC
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.
Comment 10 Max Kresch 2019-04-23 19:20:46 UTC
(In reply to Max Kresch from comment #9)

I probably should have mentioned: I'm on amd64.
Comment 11 Andreas Sturmlechner gentoo-dev 2019-04-29 22:47:08 UTC
ping
Comment 12 Amel Hodzic 2019-04-29 23:25:27 UTC
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'
Comment 13 Amel Hodzic 2019-04-29 23:27:07 UTC
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
Comment 14 Amel Hodzic 2019-04-29 23:31:08 UTC
Created attachment 574766 [details]
patch-failed-build.log
Comment 15 Amel Hodzic 2019-04-29 23:35:54 UTC
Created attachment 574768 [details]
rejected-patched-source-file

cryptcab.c.rej
Comment 16 Larry the Git Cow gentoo-dev 2019-05-08 17:04:19 UTC
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(+)