summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2f23f60)
raw | patch | inline | side by side (parent: 2f23f60)
author | Luke Heberling <collectd@c-ware.com> | |
Mon, 31 Aug 2009 17:31:30 +0000 (10:31 -0700) | ||
committer | Florian Forster <octo@huhu.verplant.org> | |
Mon, 31 Aug 2009 18:24:46 +0000 (20:24 +0200) |
Subject: Ohhhh jeeee, libgcrypt 1.4.1 + collectd 4.7.2
On Monday 31 August 2009 09:03:37 Sebastian Harl wrote:
> Hrm … from a quick look at the libcrypt documentation I suppose we need
> to call gcry_control() using the 'GCRYCTL_INIT_SECMEM' command to
> explicitly initialize the secure memory. Sounds like this was required
> in libgcrypt 1.4.1 but is handled automatically in later versions.
>
also looks like there's some special initialization necessary for threads. I
doubt that this is handled by the new default behavior in 1.4.4. Don't know
that it's truly necessary if the network plugin is the only plugin using
gcrypt.
Here's a patch that works for me with 1.4.1.
I followed an example for pthread initialization and initialized gcry to 32k,
only since that's apparently the default that's used in 1.4.3. I did it in
network.c's module_register function. Kind of an abuse, I know.
Luke Heberling
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
On Monday 31 August 2009 09:03:37 Sebastian Harl wrote:
> Hrm … from a quick look at the libcrypt documentation I suppose we need
> to call gcry_control() using the 'GCRYCTL_INIT_SECMEM' command to
> explicitly initialize the secure memory. Sounds like this was required
> in libgcrypt 1.4.1 but is handled automatically in later versions.
>
also looks like there's some special initialization necessary for threads. I
doubt that this is handled by the new default behavior in 1.4.4. Don't know
that it's truly necessary if the network plugin is the only plugin using
gcrypt.
Here's a patch that works for me with 1.4.1.
I followed an example for pthread initialization and initialized gcry to 32k,
only since that's apparently the default that's used in 1.4.3. I did it in
network.c's module_register function. Kind of an abuse, I know.
Luke Heberling
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
src/network.c | patch | blob | history |
diff --git a/src/network.c b/src/network.c
index 0e246c20eda53e5dd69ada996fd91522564d5baa..791c1993f72b75f0079a287e6e27087a908f00b6 100644 (file)
--- a/src/network.c
+++ b/src/network.c
#if HAVE_LIBGCRYPT
# include <gcrypt.h>
+GCRY_THREAD_OPTION_PTHREAD_IMPL;
#endif
/* 1500 - 40 - 8 = Ethernet packet - IPv6 header - UDP header */
void module_register (void)
{
+#if HAVE_LIBGCRYPT
+ gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
+ gcry_control (GCRYCTL_INIT_SECMEM, 32768, 0);
+ gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
+#endif
+
plugin_register_complex_config ("network", network_config);
plugin_register_init ("network", network_init);
plugin_register_flush ("network", network_flush,