From d93a925b5c8f2e012877d9a02d3839c62a2bde7f Mon Sep 17 00:00:00 2001 From: Milan Broz Date: Sun, 10 Jan 2010 20:54:00 +0000 Subject: [PATCH] Check for required minumum gcrypt version. (also ensure that gcrypt global init is called, see http://lists.gnupg.org/pipermail/gcrypt-devel/2003-August/000458.html) git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@176 36d66b0a-2a48-0410-832c-cd162a569da5 --- ChangeLog | 1 + lib/gcrypt.c | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index a4c78fd7..86a2df0c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ 2010-01-10 Milan Broz * Fix initialisation of gcrypt duting luksFormat. * Convert hash name to lower case in header (fix sha1 backward comatible header) + * Check for minimum required gcrypt version. 2009-12-30 Milan Broz * Fix key slot iteration count calculation (small -i value was the same as default). diff --git a/lib/gcrypt.c b/lib/gcrypt.c index 0971daf6..630f18f7 100644 --- a/lib/gcrypt.c +++ b/lib/gcrypt.c @@ -1,6 +1,7 @@ #include #include #include +#include #include #include "libcryptsetup.h" @@ -12,8 +13,8 @@ int init_crypto(void) { if (!gcry_control (GCRYCTL_INITIALIZATION_FINISHED_P)) { - //if (!gcry_check_version (GCRYPT_VERSION)) - // return -ENOSYS; + if (!gcry_check_version (GCRYPT_REQ_VERSION)) + return -ENOSYS; gcry_control (GCRYCTL_SUSPEND_SECMEM_WARN); gcry_control (GCRYCTL_INIT_SECMEM, 16384, 0); gcry_control (GCRYCTL_RESUME_SECMEM_WARN);