diff options
Diffstat (limited to 'fs/ecryptfs/keystore.c')
-rw-r--r-- | fs/ecryptfs/keystore.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/fs/ecryptfs/keystore.c b/fs/ecryptfs/keystore.c index ba454785a0c5..bc706d33559a 100644 --- a/fs/ecryptfs/keystore.c +++ b/fs/ecryptfs/keystore.c | |||
@@ -493,19 +493,16 @@ static int decrypt_session_key(struct ecryptfs_auth_tok *auth_tok, | |||
493 | goto out; | 493 | goto out; |
494 | } | 494 | } |
495 | } | 495 | } |
496 | if (password_s_ptr->session_key_encryption_key_bytes | ||
497 | < crypto_tfm_alg_min_keysize(tfm)) { | ||
498 | printk(KERN_WARNING "Session key encryption key is [%d] bytes; " | ||
499 | "minimum keysize for selected cipher is [%d] bytes.\n", | ||
500 | password_s_ptr->session_key_encryption_key_bytes, | ||
501 | crypto_tfm_alg_min_keysize(tfm)); | ||
502 | rc = -EINVAL; | ||
503 | goto out; | ||
504 | } | ||
505 | if (tfm_mutex) | 496 | if (tfm_mutex) |
506 | mutex_lock(tfm_mutex); | 497 | mutex_lock(tfm_mutex); |
507 | crypto_cipher_setkey(tfm, password_s_ptr->session_key_encryption_key, | 498 | rc = crypto_cipher_setkey(tfm, |
508 | crypt_stat->key_size); | 499 | password_s_ptr->session_key_encryption_key, |
500 | crypt_stat->key_size); | ||
501 | if (rc < 0) { | ||
502 | printk(KERN_ERR "Error setting key for crypto context\n"); | ||
503 | rc = -EINVAL; | ||
504 | goto out_free_tfm; | ||
505 | } | ||
509 | /* TODO: virt_to_scatterlist */ | 506 | /* TODO: virt_to_scatterlist */ |
510 | encrypted_session_key = (char *)__get_free_page(GFP_KERNEL); | 507 | encrypted_session_key = (char *)__get_free_page(GFP_KERNEL); |
511 | if (!encrypted_session_key) { | 508 | if (!encrypted_session_key) { |