aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2017-10-29 16:14:35 +0100
committerAndreas Schneider <asn@cryptomilk.org>2017-10-29 16:15:33 +0100
commit509fa8a7b25eeb2b0f62ca158876603d96b49481 (patch)
tree34ca1ed0df67453e7115c42208e9399d4c708671 /src
parent954da14c150771857b095f108995d41f843f950d (diff)
downloadlibssh-509fa8a7b25eeb2b0f62ca158876603d96b49481.tar.gz
libssh-509fa8a7b25eeb2b0f62ca158876603d96b49481.tar.xz
libssh-509fa8a7b25eeb2b0f62ca158876603d96b49481.zip
dh: Don't use deprecated function with newer OpenSSL
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'src')
-rw-r--r--src/dh.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/dh.c b/src/dh.c
index 0339be02..968af8ce 100644
--- a/src/dh.c
+++ b/src/dh.c
@@ -131,11 +131,18 @@ int ssh_get_random(void *where, int len, int strong){
return 1;
#elif defined HAVE_LIBCRYPTO
+# if OPENSSL_VERSION_NUMBER > 0x10100000L
+ /* variable not used in new libcrypto */
+ (void) strong;
+
+ return RAND_bytes(where, len);
+# else /* OPENSSL_VERSION_NUMBER */
if (strong) {
return RAND_bytes(where,len);
} else {
return RAND_pseudo_bytes(where,len);
}
+# endif /* OPENSSL_VERSION_NUMBER */
#endif
/* never reached */