diff options
author | Floris Bos <bos@je-eigen-domein.nl> | 2015-01-02 16:36:05 +0100 |
---|---|---|
committer | Floris Bos <bos@je-eigen-domein.nl> | 2015-01-02 16:36:05 +0100 |
commit | 4674d4632b9ffc6779d9c9f79b8ebb53c12e29b2 (patch) | |
tree | 53ec81f765f67aba820d6b927a5d1f38f514d7af /libvncclient | |
parent | ac63d743646e4e368d437362faff809a38ef8810 (diff) | |
download | libtdevnc-4674d4632b9ffc6779d9c9f79b8ebb53c12e29b2.tar.gz libtdevnc-4674d4632b9ffc6779d9c9f79b8ebb53c12e29b2.zip |
Initialize libgcrypt before use
https://www.gnupg.org/documentation/manuals/gcrypt/Initializing-the-library.html
"Before the library can be used, it must initialize itself.
This is achieved by invoking the function gcry_check_version"
Closes issue #45
Tested with krdc + libgcrypt 1.6.1 (libgcrypt20-dev Ubunutu package)
connecting to a Mac Mini.
Signed-off-by: Floris Bos <bos@je-eigen-domein.nl>
Diffstat (limited to 'libvncclient')
-rw-r--r-- | libvncclient/rfbproto.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libvncclient/rfbproto.c b/libvncclient/rfbproto.c index f653850..aa74c23 100644 --- a/libvncclient/rfbproto.c +++ b/libvncclient/rfbproto.c @@ -857,6 +857,16 @@ HandleARDAuth(rfbClient *client) rfbCredential *cred = NULL; rfbBool result = FALSE; + if (!gcry_control(GCRYCTL_INITIALIZATION_FINISHED_P)) + { + /* Application did not initialize gcrypt, so we should */ + if (!gcry_check_version(GCRYPT_VERSION)) + { + /* Older version of libgcrypt is installed on system than compiled against */ + rfbClientLog("libgcrypt version mismatch.\n"); + } + } + while (1) { if (!ReadFromRFBServer(client, (char *)gen, 2)) |