aboutsummaryrefslogtreecommitdiff
path: root/libssh
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2010-08-30 14:39:35 +0200
committerAris Adamantiadis <aris@0xbadc0de.be>2010-08-30 14:39:35 +0200
commite34da1b94dc707e9074b0958ebcd24706442bc81 (patch)
tree5b1d72de1337793d46414c02192d161287a3d856 /libssh
parent717eff71dda38a947dc4fd77f51cafd796ce9693 (diff)
downloadlibssh-e34da1b94dc707e9074b0958ebcd24706442bc81.tar.gz
libssh-e34da1b94dc707e9074b0958ebcd24706442bc81.tar.xz
libssh-e34da1b94dc707e9074b0958ebcd24706442bc81.zip
Added "fix" for libgcrypt threading, ...
... but it doesn't seem to work. This is however the recommanded way of initializing threading : http://lists.gnupg.org/pipermail/gcrypt-devel/2009-February/001452.html
Diffstat (limited to 'libssh')
-rw-r--r--libssh/dh.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libssh/dh.c b/libssh/dh.c
index 8ad80a0e..d6166a0e 100644
--- a/libssh/dh.c
+++ b/libssh/dh.c
@@ -104,6 +104,12 @@ int ssh_get_random(void *where, int len, int strong){
return 1;
}
+#ifdef HAVE_LIBGCRYPT
+#include <errno.h>
+#include <pthread.h>
+GCRY_THREAD_OPTION_PTHREAD_IMPL;
+#endif
+
/*
* This inits the values g and p which are used for DH key agreement
@@ -113,6 +119,7 @@ int ssh_crypto_init(void) {
if (ssh_crypto_initialized == 0) {
#ifdef HAVE_LIBGCRYPT
gcry_check_version(NULL);
+ gcry_control(GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
if (!gcry_control(GCRYCTL_INITIALIZATION_FINISHED_P,0)) {
gcry_control(GCRYCTL_INIT_SECMEM, 4096);