Ticket #47771: patch-initialise-gcrypt-first.diff

File patch-initialise-gcrypt-first.diff, 976 bytes (added by RJVB (René Bertin), 9 years ago)
  • libvncclient/rfbproto.c

    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>
    a b HandleARDAuth(rfbClient *client) 
    857857  rfbCredential *cred = NULL;
    858858  rfbBool result = FALSE;
    859859
     860  if (!gcry_control(GCRYCTL_INITIALIZATION_FINISHED_P))
     861  {
     862    /* Application did not initialize gcrypt, so we should */
     863    if (!gcry_check_version(GCRYPT_VERSION))
     864    {
     865      /* Older version of libgcrypt is installed on system than compiled against */
     866      rfbClientLog("libgcrypt version mismatch.\n");
     867    }
     868  }
     869
    860870  while (1)
    861871  {
    862872    if (!ReadFromRFBServer(client, (char *)gen, 2))