From af87ffbd376bdd32af62d8ea7c561bbfab4c5e1b Mon Sep 17 00:00:00 2001 From: Milan Broz Date: Sun, 16 Jan 2011 10:40:57 +0000 Subject: [PATCH] Add context to crypto backend init (so it can print errors to callback). git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@415 36d66b0a-2a48-0410-832c-cd162a569da5 --- lib/crypto_backend/crypto_backend.h | 2 +- lib/crypto_backend/crypto_gcrypt.c | 2 +- lib/crypto_backend/crypto_kernel.c | 2 +- lib/crypto_backend/crypto_nss.c | 2 +- lib/crypto_backend/crypto_openssl.c | 2 +- lib/setup.c | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/crypto_backend/crypto_backend.h b/lib/crypto_backend/crypto_backend.h index 006295c9..85b81076 100644 --- a/lib/crypto_backend/crypto_backend.h +++ b/lib/crypto_backend/crypto_backend.h @@ -7,7 +7,7 @@ struct crypt_hash; struct crypt_hmac; -int crypt_backend_init(void); +int crypt_backend_init(struct crypt_device *ctx); #define CRYPT_BACKEND_KERNEL (1 << 0) /* Crypto uses kernel part, for benchmark */ diff --git a/lib/crypto_backend/crypto_gcrypt.c b/lib/crypto_backend/crypto_gcrypt.c index b73f3ad3..49159b45 100644 --- a/lib/crypto_backend/crypto_gcrypt.c +++ b/lib/crypto_backend/crypto_gcrypt.c @@ -39,7 +39,7 @@ struct crypt_hmac { int hash_len; }; -int crypt_backend_init(void) +int crypt_backend_init(struct crypt_device *ctx) { if (crypto_backend_initialised) return 0; diff --git a/lib/crypto_backend/crypto_kernel.c b/lib/crypto_backend/crypto_kernel.c index 6005b8ea..27af2152 100644 --- a/lib/crypto_backend/crypto_kernel.c +++ b/lib/crypto_backend/crypto_kernel.c @@ -88,7 +88,7 @@ bad: return -EINVAL; } -int crypt_backend_init(void) +int crypt_backend_init(struct crypt_device *ctx) { struct utsname uts; diff --git a/lib/crypto_backend/crypto_nss.c b/lib/crypto_backend/crypto_nss.c index 637e9fd0..559c8f48 100644 --- a/lib/crypto_backend/crypto_nss.c +++ b/lib/crypto_backend/crypto_nss.c @@ -65,7 +65,7 @@ static struct hash_alg *_get_alg(const char *name) return NULL; } -int crypt_backend_init(void) +int crypt_backend_init(struct crypt_device *ctx) { if (crypto_backend_initialised) return 0; diff --git a/lib/crypto_backend/crypto_openssl.c b/lib/crypto_backend/crypto_openssl.c index c9c8efe3..a48087ed 100644 --- a/lib/crypto_backend/crypto_openssl.c +++ b/lib/crypto_backend/crypto_openssl.c @@ -37,7 +37,7 @@ struct crypt_hmac { int hash_len; }; -int crypt_backend_init(void) +int crypt_backend_init(struct crypt_device *ctx) { if (crypto_backend_initialised) return 0; diff --git a/lib/setup.c b/lib/setup.c index 8a06424c..fd70ffe9 100644 --- a/lib/setup.c +++ b/lib/setup.c @@ -96,7 +96,7 @@ static int init_crypto(struct crypt_device *ctx) return r; } - r = crypt_backend_init(); + r = crypt_backend_init(ctx); if (r < 0) log_err(ctx, _("Cannot initialize crypto backend.\n"));