diff options
Diffstat (limited to 'fs/ecryptfs/main.c')
| -rw-r--r-- | fs/ecryptfs/main.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c index 5938a232d11b..a78d87d14baf 100644 --- a/fs/ecryptfs/main.c +++ b/fs/ecryptfs/main.c | |||
| @@ -208,7 +208,6 @@ static int ecryptfs_parse_options(struct super_block *sb, char *options) | |||
| 208 | char *cipher_name_dst; | 208 | char *cipher_name_dst; |
| 209 | char *cipher_name_src; | 209 | char *cipher_name_src; |
| 210 | char *cipher_key_bytes_src; | 210 | char *cipher_key_bytes_src; |
| 211 | struct crypto_tfm *tmp_tfm; | ||
| 212 | int cipher_name_len; | 211 | int cipher_name_len; |
| 213 | 212 | ||
| 214 | if (!options) { | 213 | if (!options) { |
| @@ -305,25 +304,19 @@ static int ecryptfs_parse_options(struct super_block *sb, char *options) | |||
| 305 | = '\0'; | 304 | = '\0'; |
| 306 | } | 305 | } |
| 307 | if (!cipher_key_bytes_set) { | 306 | if (!cipher_key_bytes_set) { |
| 308 | mount_crypt_stat->global_default_cipher_key_size = | 307 | mount_crypt_stat->global_default_cipher_key_size = 0; |
| 309 | ECRYPTFS_DEFAULT_KEY_BYTES; | ||
| 310 | ecryptfs_printk(KERN_DEBUG, "Cipher key size was not " | ||
| 311 | "specified. Defaulting to [%d]\n", | ||
| 312 | mount_crypt_stat-> | ||
| 313 | global_default_cipher_key_size); | ||
| 314 | } | 308 | } |
| 315 | rc = ecryptfs_process_cipher( | 309 | rc = ecryptfs_process_cipher( |
| 316 | &tmp_tfm, | ||
| 317 | &mount_crypt_stat->global_key_tfm, | 310 | &mount_crypt_stat->global_key_tfm, |
| 318 | mount_crypt_stat->global_default_cipher_name, | 311 | mount_crypt_stat->global_default_cipher_name, |
| 319 | mount_crypt_stat->global_default_cipher_key_size); | 312 | &mount_crypt_stat->global_default_cipher_key_size); |
| 320 | if (tmp_tfm) | ||
| 321 | crypto_free_tfm(tmp_tfm); | ||
| 322 | if (rc) { | 313 | if (rc) { |
| 323 | printk(KERN_ERR "Error attempting to initialize cipher [%s] " | 314 | printk(KERN_ERR "Error attempting to initialize cipher [%s] " |
| 324 | "with key size [%Zd] bytes; rc = [%d]\n", | 315 | "with key size [%Zd] bytes; rc = [%d]\n", |
| 325 | mount_crypt_stat->global_default_cipher_name, | 316 | mount_crypt_stat->global_default_cipher_name, |
| 326 | mount_crypt_stat->global_default_cipher_key_size, rc); | 317 | mount_crypt_stat->global_default_cipher_key_size, rc); |
| 318 | mount_crypt_stat->global_key_tfm = NULL; | ||
| 319 | mount_crypt_stat->global_auth_tok_key = NULL; | ||
| 327 | rc = -EINVAL; | 320 | rc = -EINVAL; |
| 328 | goto out; | 321 | goto out; |
| 329 | } | 322 | } |
