diff options
Diffstat (limited to 'fs/ecryptfs/keystore.c')
-rw-r--r-- | fs/ecryptfs/keystore.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/fs/ecryptfs/keystore.c b/fs/ecryptfs/keystore.c index 82b99c786abb..8319b776a461 100644 --- a/fs/ecryptfs/keystore.c +++ b/fs/ecryptfs/keystore.c @@ -1202,7 +1202,7 @@ decrypt_pki_encrypted_session_key(struct ecryptfs_auth_tok *auth_tok, memcpy(crypt_stat->key, auth_tok->session_key.decrypted_key, auth_tok->session_key.decrypted_key_size); crypt_stat->key_size = ecryptfs_get_key_size_to_restore_key( - auth_tok->session_key.decrypted_key_size, full_cipher); + auth_tok->session_key.decrypted_key_size, crypt_stat); ecryptfs_parse_full_cipher(full_cipher, crypt_stat->cipher, crypt_stat->cipher_mode); @@ -1214,7 +1214,7 @@ decrypt_pki_encrypted_session_key(struct ecryptfs_auth_tok *auth_tok, crypt_stat->key_size); ecryptfs_dump_salt_hex(crypt_stat->key, crypt_stat->key_size, - full_cipher); + crypt_stat); } out: kfree(msg); @@ -1487,7 +1487,7 @@ parse_tag_3_packet(struct ecryptfs_crypt_stat *crypt_stat, crypt_stat->key_size = ecryptfs_get_key_size_to_restore_key( (*new_auth_tok)->session_key.encrypted_key_size, - full_cipher); + crypt_stat); } rc = ecryptfs_init_crypt_ctx(crypt_stat); @@ -1687,8 +1687,6 @@ static int decrypt_passphrase_encrypted_session_key(struct ecryptfs_auth_tok *auth_tok, struct ecryptfs_crypt_stat *crypt_stat) { - - unsigned char final[2*ECRYPTFS_MAX_CIPHER_NAME_SIZE+1]; struct scatterlist dst_sg[2]; struct scatterlist src_sg[2]; struct mutex *tfm_mutex; @@ -1762,9 +1760,7 @@ decrypt_passphrase_encrypted_session_key(struct ecryptfs_auth_tok *auth_tok, ecryptfs_dump_hex(crypt_stat->key, crypt_stat->key_size); ecryptfs_dump_salt_hex(crypt_stat->key, crypt_stat->key_size, - ecryptfs_get_full_cipher(crypt_stat->cipher, - crypt_stat->cipher_mode, - final, sizeof(final))); + crypt_stat); } out: return rc; @@ -2332,10 +2328,7 @@ write_tag_3_packet(char *dest, size_t *remaining_bytes, ecryptfs_printk(KERN_DEBUG, "Encrypting [%zd] bytes of the key\n", crypt_stat->key_size); ecryptfs_printk(KERN_DEBUG, "Encrypting [%zd] bytes of the salt key\n", - ecryptfs_get_salt_size_for_cipher( - ecryptfs_get_full_cipher(crypt_stat->cipher, - crypt_stat->cipher_mode, - final, sizeof(final)))); + ecryptfs_get_salt_size_for_cipher(crypt_stat)); rc = crypto_blkcipher_encrypt(&desc, dst_sg, src_sg, (*key_rec).enc_key_size); mutex_unlock(tfm_mutex); |