diff options
author | Andrey Markovytch <andreym@codeaurora.org> | 2015-08-04 15:57:48 +0300 |
---|---|---|
committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-23 21:24:08 -0700 |
commit | f707680de8e70550be74c26e1d5b609143aba9b7 (patch) | |
tree | d69a65420adf227a206c9b16c8f253d6d226afcf /security/pfe/pfk.c | |
parent | 8928f8683bcd0236f5653963deee3bc225fb2206 (diff) |
PFK: fixed bug where key was cleared without turning on clocks first
ICE clocks need to be turned on to clear the key, fixed
Change-Id: I1cd5a10899c2f128b138fe380beb34a5a310fa05
Signed-off-by: Andrey Markovytch <andreym@codeaurora.org>
Diffstat (limited to 'security/pfe/pfk.c')
-rw-r--r-- | security/pfe/pfk.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/security/pfe/pfk.c b/security/pfe/pfk.c index 3c8e2f8fad41..277b75eb2469 100644 --- a/security/pfe/pfk.c +++ b/security/pfe/pfk.c @@ -39,7 +39,6 @@ /* #define DEBUG 1 */ #define pr_fmt(fmt) "pfk [%s]: " fmt, __func__ - #include <linux/module.h> #include <linux/fs.h> #include <linux/errno.h> @@ -273,7 +272,7 @@ static int pfk_parse_cipher(const unsigned char *cipher, return -EPERM; if (!strcmp(cipher, PFK_SUPPORTED_CIPHER) == 0) { - pr_err("not supported alghoritm\n"); + pr_debug("not supported alghoritm %s\n", cipher); return -EINVAL; } @@ -404,15 +403,17 @@ int pfk_load_key(const struct bio *bio, struct ice_crypto_setting *ice_setting) } cipher = ecryptfs_get_cipher(ecryptfs_data); - if (!key) { + if (!cipher) { pr_err("could not parse key from ecryptfs\n"); ret = -EINVAL; goto end; } ret = pfk_parse_cipher(cipher, &algo_mode); - if (ret != 0) + if (ret != 0) { + pr_debug("not supported cipher\n"); return ret; + } ret = pfk_key_size_to_key_type(key_size, &key_size_type); if (ret != 0) @@ -583,8 +584,11 @@ static void pfk_open_cb(struct inode *inode, void *ecryptfs_data) return; } - if (0 != pfk_parse_cipher(cipher, NULL)) + if (0 != pfk_parse_cipher(cipher, NULL)) { + pr_debug("open_cb: not supported cipher\n"); return; + } + if (0 != pfk_key_size_to_key_type(key_size, NULL)) return; @@ -618,7 +622,7 @@ static void pfk_release_cb(struct inode *inode) data = pfk_get_ecryptfs_data(inode); if (!data) { - pr_err("could not get ecryptfs data from inode\n"); + pr_debug("could not get ecryptfs data from inode\n"); return; } |