From: Peter Spiess-Knafl <psk@autistici.org>
Date: Wed, 4 Feb 2015 13:20:39 +0100
Subject: init libgcrypt before use

---
 libvncclient/rfbproto.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

--- a/libvncclient/rfbproto.c
+++ b/libvncclient/rfbproto.c
@@ -836,6 +836,16 @@
   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))
