diff -ru libssh2-1.2.5-20100226_orig/src/openssl.c libssh2-1.2.5-20100226/src/openssl.c
--- libssh2-1.2.5-20100226_orig/src/openssl.c	2010-02-11 06:06:03.000000000 +0100
+++ libssh2-1.2.5-20100226/src/openssl.c	2010-02-26 10:44:26.000000000 +0100
@@ -111,6 +111,7 @@
     return (ret == 1) ? 0 : -1;
 }
 
+#if LIBSSH2_DSA
 int
 _libssh2_dsa_new(libssh2_dsa_ctx ** dsactx,
                  const unsigned char *p,
@@ -166,6 +167,7 @@
 
     return (ret == 1) ? 0 : -1;
 }
+#endif /* LIBSSH_DSA */
 
 int
 _libssh2_cipher_init(_libssh2_cipher_ctx * h,
@@ -367,6 +369,7 @@
                                       filename, passphrase);
 }
 
+#if LIBSSH2_DSA
 int
 _libssh2_dsa_new_private(libssh2_dsa_ctx ** dsa,
                          LIBSSH2_SESSION * session,
@@ -387,6 +390,7 @@
     return read_private_key_from_file((void **) dsa, read_dsa,
                                       filename, passphrase);
 }
+#endif /* LIBSSH_DSA */
 
 int
 _libssh2_rsa_sha1_sign(LIBSSH2_SESSION * session,
@@ -419,6 +423,7 @@
     return 0;
 }
 
+#if LIBSSH2_DSA
 int
 _libssh2_dsa_sha1_sign(libssh2_dsa_ctx * dsactx,
                        const unsigned char *hash,
@@ -453,5 +458,6 @@
 
     return 0;
 }
+#endif /* LIBSSH_DSA */
 
 #endif /* !LIBSSH2_LIBGCRYPT */
diff -ru libssh2-1.2.5-20100226_orig/src/openssl.h libssh2-1.2.5-20100226/src/openssl.h
--- libssh2-1.2.5-20100226_orig/src/openssl.h	2009-11-17 06:06:05.000000000 +0100
+++ libssh2-1.2.5-20100226/src/openssl.h	2010-02-26 10:06:38.000000000 +0100
@@ -73,7 +73,11 @@
 #endif
 
 #if OPENSSL_VERSION_NUMBER >= 0x00907000L && !defined(OPENSSL_NO_AES)
+#if OPENSSL_VERSION_NUMBER >= 0x0090808fL 
+# define LIBSSH2_AES_CTR 0
+#else
 # define LIBSSH2_AES_CTR 1
+#endif
 # define LIBSSH2_AES 1
 #else
 # define LIBSSH2_AES 0
@@ -197,9 +201,15 @@
 #define _libssh2_cipher_aes256 EVP_aes_256_cbc
 #define _libssh2_cipher_aes192 EVP_aes_192_cbc
 #define _libssh2_cipher_aes128 EVP_aes_128_cbc
+#if LIBSSH2_AES_CTR
 #define _libssh2_cipher_aes128ctr _libssh2_EVP_aes_128_ctr
 #define _libssh2_cipher_aes192ctr _libssh2_EVP_aes_192_ctr
 #define _libssh2_cipher_aes256ctr _libssh2_EVP_aes_256_ctr
+#else
+#define _libssh2_cipher_aes128ctr EVP_aes_128_ctr
+#define _libssh2_cipher_aes192ctr EVP_aes_192_ctr
+#define _libssh2_cipher_aes256ctr EVP_aes_256_ctr
+#endif
 #define _libssh2_cipher_blowfish EVP_bf_cbc
 #define _libssh2_cipher_arcfour EVP_rc4
 #define _libssh2_cipher_cast5 EVP_cast5_cbc

