Subject: Re: Help - build libssh2

Re: Help - build libssh2

From: Peter Stuge <peter_at_stuge.se>
Date: Sat, 13 Feb 2010 08:44:18 +0100

Hello Yelin,

Yelin Chen wrote:
> I've just downloaded libssh2.1-2.2.tar.gz from
> http://www.libssh2.org to build it on Sun T5120 server running open
> Solaris 10 (u6).

Please note that version 1.2.2 is somewhat old. Version 1.2.3 was
released recently and fixes several known bugs, but unfortunately it
also introduced a build bug for Solaris, at least when using the Sun
compiler. The build bug is fixed already and version 1.2.4 will be
released very soon but if you need to proceed before it becomes
available I would recommend either downloading the source code from
our git repository or using a daily snapshot:

http://libssh2.org/snapshots/libssh2-1.2.4-20100213.tar.gz

> I successfully ran the first command, 'configure CC=/usr/sfw/bin/gcc',
> however, got errors in the second command, 'gmake' as follows:
>
> gmake[2]: Entering directory `/export/home/achen/perl/SSH2_dependency/libssh2-1.2.2/example/simple'
> /bin/bash ../../libtool --tag=CC --mode=link /usr/sfw/bin/gcc -g -O2 -o ssh2 ssh2.o ../../src/libssh2.la -lnsl -lsocket
> libtool: link: /usr/sfw/bin/gcc -g -O2 -o .libs/ssh2 ssh2.o ../../src/.libs/libssh2.so -lssl -lcrypto -lz -lnsl -lsocket -R/usr/local/lib
> Undefined first referenced
> symbol in file
> EVP_aes_192_cbc ../../src/.libs/libssh2.so
> EVP_aes_256_cbc ../../src/.libs/libssh2.so
>
> Couldn't figure out where to find EVP_aes_192_cbc, EVP_aes_256_cbc
> definition. Any suggestion?

These are names of encryption algorithms in OpenSSL. The errors mean
that your installed version of OpenSSL does not support AES with 192
or 256 bit keys.

Would you like to use these key lengths? If so, you must install a
version of OpenSSL which supports them.

If not, you can either remove the encryption methods from the libssh2
source file src/crypt.c: (line number in brackets)

libssh2_crypt_method_aes192_ctr (131)
libssh2_crypt_method_aes256_ctr (143)
libssh2_crypt_method_aes192_cbc (169)
libssh2_crypt_method_aes256_cbc (181)

and in the list of all methods:

_libssh2_crypt_methods (298)

..or you could introduce new LIBSSH2_AES192 and LIBSSH2_AES256 flags
to be set in openssl.h and libgcrypt.h respectively.

In the long term I think it would be nice for libssh2 to just
autodetect which crypto capabilities are available and use what is
there - but there is no plan for implementing this at the moment.

//Peter
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2010-02-13