Subject: Re: Patch to use aes_*_ctr in newer versions of OpenSSL and #if LIBSSH2_DSA for more DSA-code

Re: Patch to use aes_*_ctr in newer versions of OpenSSL and #if LIBSSH2_DSA for more DSA-code

From: Simon Josefsson <simon_at_josefsson.org>
Date: Mon, 01 Mar 2010 11:40:57 +0100

Daniel Stenberg <daniel_at_haxx.se> writes:

> On Mon, 1 Mar 2010, Simon Josefsson wrote:
>
>> Please test the code in git now.
>
> Doesn't build for me!
>
> crypt.c:128: error: ‘EVP_aes_128_ctr’ undeclared here (not in a function)
> crypt.c:129: warning: missing initializer
> crypt.c:129: warning: (near initialization for
> ‘libssh2_crypt_method_aes128_ctr.algo’)
> crypt.c:140: error: ‘EVP_aes_192_ctr’ undeclared here (not in a function)
> crypt.c:141: warning: missing initializer
> crypt.c:141: warning: (near initialization for
> ‘libssh2_crypt_method_aes192_ctr.algo’)
> crypt.c:152: error: ‘EVP_aes_256_ctr’ undeclared here (not in a function)
> crypt.c:153: warning: missing initializer
> crypt.c:153: warning: (near initialization for
> ‘libssh2_crypt_method_aes256_ctr.algo’)

It seems some OpenSSL have AES-CTR and some do not, even if the version
is new enough. I can reproduce the above. On my debian system
/usr/include/openssl/evp.h has:

#if 0
const EVP_CIPHER *EVP_aes_128_ctr(void);
#endif

The version is recent enough:

#define OPENSSL_VERSION_NUMBER 0x009080bfL

I believe we need to check that EVP_aes_128_ctr actually is present in
the library, so I've applied a patch to do that. Please test again.

I now recall that this was the reason I did not use OpenSSL's built-in
AES-CTR APIs but had to re-implement it. AES-CTR doesn't appear widely
available in OpenSSL in distributions, even if it is in OpenSSL
upstream.

/Simon
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2010-03-01