diff options
Diffstat (limited to 'fs/ecryptfs/keystore.c')
-rw-r--r-- | fs/ecryptfs/keystore.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/fs/ecryptfs/keystore.c b/fs/ecryptfs/keystore.c index 3a61f056acf6..17164e483ab1 100644 --- a/fs/ecryptfs/keystore.c +++ b/fs/ecryptfs/keystore.c | |||
@@ -612,7 +612,12 @@ ecryptfs_write_tag_70_packet(char *dest, size_t *remaining_bytes, | |||
612 | } | 612 | } |
613 | /* TODO: Support other key modules than passphrase for | 613 | /* TODO: Support other key modules than passphrase for |
614 | * filename encryption */ | 614 | * filename encryption */ |
615 | BUG_ON(s->auth_tok->token_type != ECRYPTFS_PASSWORD); | 615 | if (s->auth_tok->token_type != ECRYPTFS_PASSWORD) { |
616 | rc = -EOPNOTSUPP; | ||
617 | printk(KERN_INFO "%s: Filename encryption only supports " | ||
618 | "password tokens\n", __func__); | ||
619 | goto out_free_unlock; | ||
620 | } | ||
616 | sg_init_one( | 621 | sg_init_one( |
617 | &s->hash_sg, | 622 | &s->hash_sg, |
618 | (u8 *)s->auth_tok->token.password.session_key_encryption_key, | 623 | (u8 *)s->auth_tok->token.password.session_key_encryption_key, |
@@ -910,7 +915,12 @@ ecryptfs_parse_tag_70_packet(char **filename, size_t *filename_size, | |||
910 | } | 915 | } |
911 | /* TODO: Support other key modules than passphrase for | 916 | /* TODO: Support other key modules than passphrase for |
912 | * filename encryption */ | 917 | * filename encryption */ |
913 | BUG_ON(s->auth_tok->token_type != ECRYPTFS_PASSWORD); | 918 | if (s->auth_tok->token_type != ECRYPTFS_PASSWORD) { |
919 | rc = -EOPNOTSUPP; | ||
920 | printk(KERN_INFO "%s: Filename encryption only supports " | ||
921 | "password tokens\n", __func__); | ||
922 | goto out_free_unlock; | ||
923 | } | ||
914 | rc = crypto_blkcipher_setkey( | 924 | rc = crypto_blkcipher_setkey( |
915 | s->desc.tfm, | 925 | s->desc.tfm, |
916 | s->auth_tok->token.password.session_key_encryption_key, | 926 | s->auth_tok->token.password.session_key_encryption_key, |