Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 533424 - net-libs/libssh-0.6.4 USE=gcrypt - In function ‘make_string_bn_inplace’: .../work/libssh-0.6.4/src/dh.c:413:4: error: #error "unsupported"
Summary: net-libs/libssh-0.6.4 USE=gcrypt - In function ‘make_string_bn_inplace’: .../...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All All
: Normal normal (vote)
Assignee: Gentoo Netmon project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: CVE-2014-8132
  Show dependency tree
 
Reported: 2014-12-24 03:50 UTC by Arfrever Frehtes Taifersar Arahesis
Modified: 2014-12-30 07:00 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Arfrever Frehtes Taifersar Arahesis 2014-12-24 03:50:34 UTC
net-libs/libssh-0.6.4 fails to build with USE="gcrypt".
Problem absent with USE="-gcrypt".


[ 25%] Building C object src/CMakeFiles/ssh_shared.dir/dh.c.o
cd /var/tmp/portage/net-libs/libssh-0.6.4/work/libssh-0.6.4-abi_x86_64.amd64/src && /usr/bin/x86_64-pc-linux-gnu-gcc  -DLIBSSH_EXPORTS  -DNDEBUG -march=core2 -O2 -fno-ident -frecord-gcc-switches -pipe -Wall -Wpointer-sign  -std=gnu99 -pedantic -pedantic-errors -Wall -Wextra -Wshadow -Wmissing-prototypes -Wdeclaration-after-statement -Wunused -Wfloat-equal -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -fPIC -fstack-protector -D_LARGEFILE64_SOURCE -fPIC -I/var/tmp/portage/net-libs/libssh-0.6.4/work/libssh-0.6.4-abi_x86_64.amd64/src -I/var/tmp/portage/net-libs/libssh-0.6.4/work/libssh-0.6.4/src -I/var/tmp/portage/net-libs/libssh-0.6.4/work/libssh-0.6.4/include -I/var/tmp/portage/net-libs/libssh-0.6.4/work/libssh-0.6.4-abi_x86_64.amd64    -fvisibility=hidden -o CMakeFiles/ssh_shared.dir/dh.c.o -c /var/tmp/portage/net-libs/libssh-0.6.4/work/libssh-0.6.4/src/dh.c
/var/tmp/portage/net-libs/libssh-0.6.4/work/libssh-0.6.4/src/dh.c: In function ‘make_string_bn_inplace’:
/var/tmp/portage/net-libs/libssh-0.6.4/work/libssh-0.6.4/src/dh.c:413:4: error: #error "unsupported"
   #error "unsupported"
    ^
/var/tmp/portage/net-libs/libssh-0.6.4/work/libssh-0.6.4/src/dh.c:411:16: warning: unused variable ‘len’ [-Wunused-variable]
   unsigned int len = ssh_string_len(string);
                ^
/var/tmp/portage/net-libs/libssh-0.6.4/work/libssh-0.6.4/src/dh.c:410:55: warning: unused parameter ‘bnout’ [-Wunused-parameter]
 void make_string_bn_inplace(ssh_string string, bignum bnout) {
                                                       ^
src/CMakeFiles/ssh_shared.dir/build.make:284: recipe for target 'src/CMakeFiles/ssh_shared.dir/dh.c.o' failed
make[2]: *** [src/CMakeFiles/ssh_shared.dir/dh.c.o] Error 1
make[2]: Leaving directory '/var/tmp/portage/net-libs/libssh-0.6.4/work/libssh-0.6.4-abi_x86_64.amd64'
CMakeFiles/Makefile2:185: recipe for target 'src/CMakeFiles/ssh_shared.dir/all' failed
make[1]: *** [src/CMakeFiles/ssh_shared.dir/all] Error 2
make[1]: Leaving directory '/var/tmp/portage/net-libs/libssh-0.6.4/work/libssh-0.6.4-abi_x86_64.amd64'
Makefile:137: recipe for target 'all' failed
make: *** [all] Error 2
 * ERROR: net-libs/libssh-0.6.4::gentoo failed (compile phase):
 *   emake failed


The following change introduced this problem:

--- libssh-0.6.3/src/dh.c
+++ libssh-0.6.4/src/dh.c
@@ -407,6 +407,15 @@
   return bn;
 }
 
+void make_string_bn_inplace(ssh_string string, bignum bnout) {
+  unsigned int len = ssh_string_len(string);
+#ifdef HAVE_LIBGCRYPT
+  #error "unsupported"
+#elif defined HAVE_LIBCRYPTO
+  bignum_bin2bn(string->data, len, bnout);
+#endif
+}
+
 ssh_string dh_get_e(ssh_session session) {
   return make_bignum_string(session->next_crypto->e);
 }
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2014-12-24 05:09:29 UTC
#ifdef HAVE_LIBGCRYPT
  #error "unsupported"

Right.
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2014-12-24 05:49:25 UTC
Upstream moved the functions around and forgot to remove the old one, it seems.
Comment 3 Jeroen Roovers (RETIRED) gentoo-dev 2014-12-24 06:02:54 UTC
No, it's worse. They didn't test the HAVE_LIBGCRYPT path at all before release. Should we maybe put "=net-libs/libssh-0.6.4 gcrypt" in package.use.mask?
Comment 4 Jeroen Roovers (RETIRED) gentoo-dev 2014-12-24 06:05:05 UTC
(In reply to Jeroen Roovers from comment #3)
> No, it's worse. They didn't test the HAVE_LIBGCRYPT path at all before
> release.

Neither that nor the DEBUG_CRYPTO path.
Comment 5 Aris Adamantiadis 2014-12-29 20:01:35 UTC
Hi,

I committed a patch to fix this problem:
http://git.libssh.org/projects/libssh.git/commit/?h=v0-6&id=3880a8ed80a4b1e2c052bd62f328bba2f869d5ae

On the good side this show that we don't have as many configurations as we should in the automated testing, I'll see how we can fix that.

Aris
Comment 6 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2014-12-30 07:00:21 UTC
+  30 Dec 2014; Lars Wendler <polynomial-c@gentoo.org> libssh-0.6.4.ebuild:
+  Fixed compilation with libgcrypt (bug #533424).
+

Thank you Aris :)