thread safety in gnutls [was: Re: Handshake and verification]

lfinsto at lfinsto at
Wed Dec 9 16:29:58 CET 2009

On Wed, December 9, 2009 3:51 pm, Daniel Kahn Gillmor wrote:
> On 12/09/2009 09:06 AM, lfinsto at wrote:


>> I got this error:
>> optdbsrv: ath.c:186: _gcry_ath_mutex_lock: Assertion `*lock ==
>> ((ath_mutex_t) 0)' failed.
>> Aborted


> are you initializing gcrypt itself to be threadsafe in your
> multithreaded program?

No, I had actually read this, but forgotten about it.  However, when I
tried it, i.e.,

#include <gnutls.h>
#include <gcrypt.h>
#include <errno.h>
#include <pthread.h>

int main()
   /* The order matters.  */
   gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);

I got this error from the call to `generate_rsa_params':

Ohhhh jeeee: operation is not possible without initialized secure memory

I'll have to take a closer look at the documentation, and also get the
documentation to `libcrypt', since I don't know what this is about.



Laurence Finston
Gesellschaft fuer wissenschaftliche Datenverarbeitung mbH
Am Fassberg 11
37077 Goettingen

Telefon: 	+49 551 201-1882
E-Mail: 	lfinsto at

More information about the Gnutls-devel mailing list