In FIPS mode, libgcrypt uses a DRBG, which behaves differently when the
length passed to gcry_create_nonce() or gcry_randomize() is <= 0. It
expects a struct and explicitly checks that the passed pointer is not
NULL.
plugin_t *gcrypt_plugin_create()
{
private_gcrypt_plugin_t *this;
+ u_char *dummy[1];
#if GCRYPT_VERSION_NUMBER < 0x010600
gcry_control(GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
gcry_control(GCRYCTL_INITIALIZATION_FINISHED, 0);
/* initialize static allocations we want to exclude from leak-detective */
- gcry_create_nonce(NULL, 0);
+ gcry_create_nonce(dummy, sizeof(dummy));
INIT(this,
.public = {