crypto.c (b88629060b03adc58639f818fe0968bf5fe81b5d) | crypto.c (c8161f64ccdcc3ac05c7bbfebc031e7ad5ca6412) |
---|---|
1/** 2 * eCryptfs: Linux filesystem encryption layer 3 * 4 * Copyright (C) 1997-2004 Erez Zadok 5 * Copyright (C) 2001-2004 Stony Brook University 6 * Copyright (C) 2004-2007 International Business Machines Corp. 7 * Author(s): Michael A. Halcrow <mahalcro@us.ibm.com> 8 * Michael C. Thompson <mcthomps@us.ibm.com> --- 785 unchanged lines hidden (view full) --- 794 if (crypt_stat->tfm) { 795 rc = 0; 796 goto out; 797 } 798 mutex_lock(&crypt_stat->cs_tfm_mutex); 799 rc = ecryptfs_crypto_api_algify_cipher_name(&full_alg_name, 800 crypt_stat->cipher, "cbc"); 801 if (rc) | 1/** 2 * eCryptfs: Linux filesystem encryption layer 3 * 4 * Copyright (C) 1997-2004 Erez Zadok 5 * Copyright (C) 2001-2004 Stony Brook University 6 * Copyright (C) 2004-2007 International Business Machines Corp. 7 * Author(s): Michael A. Halcrow <mahalcro@us.ibm.com> 8 * Michael C. Thompson <mcthomps@us.ibm.com> --- 785 unchanged lines hidden (view full) --- 794 if (crypt_stat->tfm) { 795 rc = 0; 796 goto out; 797 } 798 mutex_lock(&crypt_stat->cs_tfm_mutex); 799 rc = ecryptfs_crypto_api_algify_cipher_name(&full_alg_name, 800 crypt_stat->cipher, "cbc"); 801 if (rc) |
802 goto out; | 802 goto out_unlock; |
803 crypt_stat->tfm = crypto_alloc_blkcipher(full_alg_name, 0, 804 CRYPTO_ALG_ASYNC); 805 kfree(full_alg_name); 806 if (IS_ERR(crypt_stat->tfm)) { 807 rc = PTR_ERR(crypt_stat->tfm); 808 ecryptfs_printk(KERN_ERR, "cryptfs: init_crypt_ctx(): " 809 "Error initializing cipher [%s]\n", 810 crypt_stat->cipher); | 803 crypt_stat->tfm = crypto_alloc_blkcipher(full_alg_name, 0, 804 CRYPTO_ALG_ASYNC); 805 kfree(full_alg_name); 806 if (IS_ERR(crypt_stat->tfm)) { 807 rc = PTR_ERR(crypt_stat->tfm); 808 ecryptfs_printk(KERN_ERR, "cryptfs: init_crypt_ctx(): " 809 "Error initializing cipher [%s]\n", 810 crypt_stat->cipher); |
811 mutex_unlock(&crypt_stat->cs_tfm_mutex); 812 goto out; | 811 goto out_unlock; |
813 } 814 crypto_blkcipher_set_flags(crypt_stat->tfm, CRYPTO_TFM_REQ_WEAK_KEY); | 812 } 813 crypto_blkcipher_set_flags(crypt_stat->tfm, CRYPTO_TFM_REQ_WEAK_KEY); |
815 mutex_unlock(&crypt_stat->cs_tfm_mutex); | |
816 rc = 0; | 814 rc = 0; |
815out_unlock: 816 mutex_unlock(&crypt_stat->cs_tfm_mutex); |
|
817out: 818 return rc; 819} 820 821static void set_extent_mask_and_shift(struct ecryptfs_crypt_stat *crypt_stat) 822{ 823 int extent_size_tmp; 824 --- 1076 unchanged lines hidden --- | 817out: 818 return rc; 819} 820 821static void set_extent_mask_and_shift(struct ecryptfs_crypt_stat *crypt_stat) 822{ 823 int extent_size_tmp; 824 --- 1076 unchanged lines hidden --- |