summaryrefslogtreecommitdiff
path: root/fs/ecryptfs/debug.c
diff options
context:
space:
mode:
authorGilad Broner <gbroner@codeaurora.org>2016-01-11 14:07:26 +0200
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-25 16:04:06 -0700
commitf50a4a1dc7a0196eb94bfaa18abb95dd387fee1e (patch)
tree46e88594582b5b69030c0eb224eca30a53f81da5 /fs/ecryptfs/debug.c
parent53db8d989d8f077a5c8b2e41370449004b1c9199 (diff)
eCryptfs: fixed bug in cipher handling
Cipher was sometimes not treated properly, causing valid requests belonging to eCryptfs to be treated as regular. Change-Id: Iabfb93cc4c9e9e167901043482eb99613ed70343 Signed-off-by: Andrey Markovytch <andreym@codeaurora.org> Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
Diffstat (limited to 'fs/ecryptfs/debug.c')
-rw-r--r--fs/ecryptfs/debug.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/fs/ecryptfs/debug.c b/fs/ecryptfs/debug.c
index 1276764f3716..0556af1adfb7 100644
--- a/fs/ecryptfs/debug.c
+++ b/fs/ecryptfs/debug.c
@@ -119,9 +119,10 @@ void ecryptfs_dump_hex(char *data, int bytes)
printk("\n");
}
-void ecryptfs_dump_salt_hex(char *data, int key_size, char *cipher)
+void ecryptfs_dump_salt_hex(char *data, int key_size,
+ const struct ecryptfs_crypt_stat *crypt_stat)
{
- size_t salt_size = ecryptfs_get_salt_size_for_cipher(cipher);
+ size_t salt_size = ecryptfs_get_salt_size_for_cipher(crypt_stat);
if (0 == salt_size)
return;
@@ -132,3 +133,18 @@ void ecryptfs_dump_salt_hex(char *data, int key_size, char *cipher)
ecryptfs_printk(KERN_DEBUG, "Decrypted session salt key:\n");
ecryptfs_dump_hex(data + key_size, salt_size);
}
+
+void ecryptfs_dump_cipher(struct ecryptfs_crypt_stat *stat)
+{
+ if (!stat)
+ return;
+
+ if (stat->cipher)
+ ecryptfs_printk(KERN_DEBUG,
+ "ecryptfs cipher is %s\n", stat->cipher);
+
+ if (stat->cipher_mode)
+ ecryptfs_printk(KERN_DEBUG, "ecryptfs cipher mode is %s\n",
+ stat->cipher_mode);
+
+}