[Pkg-openldap-devel] Bug#368297: Initializing Libgcrypt

Jack Bates 8it1g1 at nottheoilrig.com
Thu Mar 21 21:18:35 UTC 2013


I contributed a fix for the regression caused by the solution in Ubuntu 
[1]. The Python wrapper for the GnuTLS library doesn't initialize 
Libgcrypt properly.

One addition to Carlos' analysis:

 > The problem is that when OpenLDAP calls gnutls_global_init(), this
 > function does nothing because OpenLDAP had previously already
 > initialized libgcrypt at some point on the stack (probably by
 > mistake).

My understanding of Howard Chu in LP: #423252 comment #72 [2] is that 
OpenLDAP doesn't initialize Libgcrypt (it doesn't invoke 
gcry_check_version which the manual states must be invoked before any 
other function in the library, and which is correctly invoked by 
gnutls_global_init). OpenLDAP is required to initialize Libgcrypt's 
thread callbacks with GCRYCTL_SET_THREAD_CBS and prior to Libgcrypt 
version 1.3.X GCRYCTL_SET_THREAD_CBS didn't invoke global_init. So the 
solution in Ubuntu [3] is consistent with the Libgcrypt manual 
(gcry_check_version must be invoked before any other function in the 
library, with the exception of the GCRYCTL_SET_THREAD_CBS command) and 
with the original behavior of the library.

   [1] 
https://code.launchpad.net/~nottheoilrig/ubuntu/quantal/python-gnutls/fix-for-1013798/+merge/154767
   [2] https://bugs.launchpad.net/bugs/423252
   [3] https://launchpadlibrarian.net/45701569/dif1.txt



More information about the Pkg-openldap-devel mailing list