Commit 41246cee by Dwight Engen Committed by Stéphane Graber

ensure gnutls is initialized before use

Section 7.1.2 of the gnutls info manual states that it must be initialized with a call to gnutls_global_init before use. This fixes the syslog warning I was seeing: lxc-create: Libgcrypt warning: missing initialization - please fix the application Signed-off-by: 's avatarDwight Engen <dwight.engen@oracle.com> Acked-by: 's avatarStéphane Graber <stgraber@ubuntu.com>
parent f220889f
......@@ -426,6 +426,13 @@ static inline int lock_fclose(FILE *f)
#if HAVE_LIBGNUTLS
#include <gnutls/gnutls.h>
#include <gnutls/crypto.h>
__attribute__((constructor))
static void gnutls_lxc_init(void)
{
gnutls_global_init();
}
int sha1sum_file(char *fnam, unsigned char *digest)
{
char *buf;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment