Lines Matching refs:rc
103 int rc = 0; in ecryptfs_calculate_md5() local
111 rc = PTR_ERR(desc.tfm); in ecryptfs_calculate_md5()
114 rc); in ecryptfs_calculate_md5()
119 rc = crypto_hash_init(&desc); in ecryptfs_calculate_md5()
120 if (rc) { in ecryptfs_calculate_md5()
123 __func__, rc); in ecryptfs_calculate_md5()
126 rc = crypto_hash_update(&desc, &sg, len); in ecryptfs_calculate_md5()
127 if (rc) { in ecryptfs_calculate_md5()
130 __func__, rc); in ecryptfs_calculate_md5()
133 rc = crypto_hash_final(&desc, dst); in ecryptfs_calculate_md5()
134 if (rc) { in ecryptfs_calculate_md5()
137 __func__, rc); in ecryptfs_calculate_md5()
142 return rc; in ecryptfs_calculate_md5()
152 int rc; in ecryptfs_crypto_api_algify_cipher_name() local
157 rc = -ENOMEM; in ecryptfs_crypto_api_algify_cipher_name()
162 rc = 0; in ecryptfs_crypto_api_algify_cipher_name()
164 return rc; in ecryptfs_crypto_api_algify_cipher_name()
181 int rc = 0; in ecryptfs_derive_iv() local
200 rc = ecryptfs_calculate_md5(dst, crypt_stat, src, in ecryptfs_derive_iv()
202 if (rc) { in ecryptfs_derive_iv()
213 return rc; in ecryptfs_derive_iv()
347 int rc = 0; in encrypt_scatterlist() local
360 rc = crypto_blkcipher_setkey(crypt_stat->tfm, crypt_stat->key, in encrypt_scatterlist()
364 if (rc) { in encrypt_scatterlist()
366 rc); in encrypt_scatterlist()
368 rc = -EINVAL; in encrypt_scatterlist()
375 return rc; in encrypt_scatterlist()
410 int rc; in ecryptfs_encrypt_extent() local
414 rc = ecryptfs_derive_iv(extent_iv, crypt_stat, in ecryptfs_encrypt_extent()
416 if (rc) { in ecryptfs_encrypt_extent()
420 rc); in ecryptfs_encrypt_extent()
434 rc = ecryptfs_encrypt_page_offset(crypt_stat, enc_extent_page, 0, in ecryptfs_encrypt_extent()
438 if (rc < 0) { in ecryptfs_encrypt_extent()
442 rc); in ecryptfs_encrypt_extent()
445 rc = 0; in ecryptfs_encrypt_extent()
449 rc); in ecryptfs_encrypt_extent()
455 return rc; in ecryptfs_encrypt_extent()
481 int rc = 0; in ecryptfs_encrypt_page() local
487 rc = ecryptfs_write_lower_page_segment(ecryptfs_inode, page, in ecryptfs_encrypt_page()
489 if (rc) in ecryptfs_encrypt_page()
497 rc = -ENOMEM; in ecryptfs_encrypt_page()
508 rc = ecryptfs_encrypt_extent(enc_extent_page, crypt_stat, page, in ecryptfs_encrypt_page()
510 if (rc) { in ecryptfs_encrypt_page()
512 "rc = [%d]\n", __func__, rc); in ecryptfs_encrypt_page()
520 rc = ecryptfs_write_lower(ecryptfs_inode, enc_extent_virt, in ecryptfs_encrypt_page()
522 if (rc) { in ecryptfs_encrypt_page()
525 "\n", rc); in ecryptfs_encrypt_page()
534 return rc; in ecryptfs_encrypt_page()
544 int rc; in ecryptfs_decrypt_extent() local
548 rc = ecryptfs_derive_iv(extent_iv, crypt_stat, in ecryptfs_decrypt_extent()
550 if (rc) { in ecryptfs_decrypt_extent()
554 rc); in ecryptfs_decrypt_extent()
568 rc = ecryptfs_decrypt_page_offset(crypt_stat, page, in ecryptfs_decrypt_extent()
573 if (rc < 0) { in ecryptfs_decrypt_extent()
577 rc); in ecryptfs_decrypt_extent()
580 rc = 0; in ecryptfs_decrypt_extent()
584 rc); in ecryptfs_decrypt_extent()
592 return rc; in ecryptfs_decrypt_extent()
618 int rc = 0; in ecryptfs_decrypt_page() local
624 rc = ecryptfs_read_lower_page_segment(page, page->index, 0, in ecryptfs_decrypt_page()
627 if (rc) in ecryptfs_decrypt_page()
635 rc = -ENOMEM; in ecryptfs_decrypt_page()
650 rc = ecryptfs_read_lower(enc_extent_virt, offset, in ecryptfs_decrypt_page()
653 if (rc) { in ecryptfs_decrypt_page()
656 "\n", rc); in ecryptfs_decrypt_page()
659 rc = ecryptfs_decrypt_extent(page, crypt_stat, enc_extent_page, in ecryptfs_decrypt_page()
661 if (rc) { in ecryptfs_decrypt_page()
663 "rc = [%d]\n", __func__, rc); in ecryptfs_decrypt_page()
672 return rc; in ecryptfs_decrypt_page()
695 int rc = 0; in decrypt_scatterlist() local
699 rc = crypto_blkcipher_setkey(crypt_stat->tfm, crypt_stat->key, in decrypt_scatterlist()
701 if (rc) { in decrypt_scatterlist()
703 rc); in decrypt_scatterlist()
705 rc = -EINVAL; in decrypt_scatterlist()
709 rc = crypto_blkcipher_decrypt_iv(&desc, dest_sg, src_sg, size); in decrypt_scatterlist()
711 if (rc) { in decrypt_scatterlist()
713 rc); in decrypt_scatterlist()
716 rc = size; in decrypt_scatterlist()
718 return rc; in decrypt_scatterlist()
792 int rc = -EINVAL; in ecryptfs_init_crypt_ctx() local
804 rc = 0; in ecryptfs_init_crypt_ctx()
808 rc = ecryptfs_crypto_api_algify_cipher_name(&full_alg_name, in ecryptfs_init_crypt_ctx()
810 if (rc) in ecryptfs_init_crypt_ctx()
816 rc = PTR_ERR(crypt_stat->tfm); in ecryptfs_init_crypt_ctx()
823 rc = 0; in ecryptfs_init_crypt_ctx()
827 return rc; in ecryptfs_init_crypt_ctx()
872 int rc = 0; in ecryptfs_compute_root_iv() local
878 rc = -EINVAL; in ecryptfs_compute_root_iv()
883 rc = ecryptfs_calculate_md5(dst, crypt_stat, crypt_stat->key, in ecryptfs_compute_root_iv()
885 if (rc) { in ecryptfs_compute_root_iv()
892 if (rc) { in ecryptfs_compute_root_iv()
896 return rc; in ecryptfs_compute_root_iv()
943 int rc = 0; in ecryptfs_copy_mount_wide_sigs_to_inode_sigs() local
951 rc = ecryptfs_add_keysig(crypt_stat, global_auth_tok->sig); in ecryptfs_copy_mount_wide_sigs_to_inode_sigs()
952 if (rc) { in ecryptfs_copy_mount_wide_sigs_to_inode_sigs()
953 printk(KERN_ERR "Error adding keysig; rc = [%d]\n", rc); in ecryptfs_copy_mount_wide_sigs_to_inode_sigs()
961 return rc; in ecryptfs_copy_mount_wide_sigs_to_inode_sigs()
1012 int rc = 0; in ecryptfs_new_file_context() local
1018 rc = ecryptfs_copy_mount_wide_sigs_to_inode_sigs(crypt_stat, in ecryptfs_new_file_context()
1020 if (rc) { in ecryptfs_new_file_context()
1022 "to the inode key sigs; rc = [%d]\n", rc); in ecryptfs_new_file_context()
1034 rc = ecryptfs_init_crypt_ctx(crypt_stat); in ecryptfs_new_file_context()
1035 if (rc) in ecryptfs_new_file_context()
1038 crypt_stat->cipher, rc); in ecryptfs_new_file_context()
1040 return rc; in ecryptfs_new_file_context()
1089 int rc = 0; in ecryptfs_process_flags() local
1103 return rc; in ecryptfs_process_flags()
1206 int rc = 0; in ecryptfs_cipher_code_to_string() local
1216 rc = -EINVAL; in ecryptfs_cipher_code_to_string()
1218 return rc; in ecryptfs_cipher_code_to_string()
1226 int rc; in ecryptfs_read_and_validate_header_region() local
1230 rc = ecryptfs_read_lower(data, 0, crypt_stat->extent_size, in ecryptfs_read_and_validate_header_region()
1232 if (rc) { in ecryptfs_read_and_validate_header_region()
1234 __func__, rc); in ecryptfs_read_and_validate_header_region()
1238 rc = -EINVAL; in ecryptfs_read_and_validate_header_region()
1241 return rc; in ecryptfs_read_and_validate_header_region()
1301 int rc; in ecryptfs_write_headers_virt() local
1313 rc = ecryptfs_generate_key_packet_set((page_virt + offset), crypt_stat, in ecryptfs_write_headers_virt()
1316 if (rc) in ecryptfs_write_headers_virt()
1318 "set; rc = [%d]\n", rc); in ecryptfs_write_headers_virt()
1323 return rc; in ecryptfs_write_headers_virt()
1330 int rc; in ecryptfs_write_metadata_to_contents() local
1332 rc = ecryptfs_write_lower(ecryptfs_dentry->d_inode, virt, in ecryptfs_write_metadata_to_contents()
1334 if (rc) in ecryptfs_write_metadata_to_contents()
1337 rc); in ecryptfs_write_metadata_to_contents()
1338 return rc; in ecryptfs_write_metadata_to_contents()
1345 int rc; in ecryptfs_write_metadata_to_xattr() local
1347 rc = ecryptfs_setxattr(ecryptfs_dentry, ECRYPTFS_XATTR_NAME, page_virt, in ecryptfs_write_metadata_to_xattr()
1349 return rc; in ecryptfs_write_metadata_to_xattr()
1383 int rc = 0; in ecryptfs_write_metadata() local
1388 rc = -EINVAL; in ecryptfs_write_metadata()
1394 rc = -EINVAL; in ecryptfs_write_metadata()
1403 rc = -ENOMEM; in ecryptfs_write_metadata()
1406 rc = ecryptfs_write_headers_virt(virt, virt_len, &size, crypt_stat, in ecryptfs_write_metadata()
1408 if (unlikely(rc)) { in ecryptfs_write_metadata()
1410 __func__, rc); in ecryptfs_write_metadata()
1414 rc = ecryptfs_write_metadata_to_xattr(ecryptfs_dentry, virt, in ecryptfs_write_metadata()
1417 rc = ecryptfs_write_metadata_to_contents(ecryptfs_dentry, virt, in ecryptfs_write_metadata()
1419 if (rc) { in ecryptfs_write_metadata()
1421 "rc = [%d]\n", __func__, rc); in ecryptfs_write_metadata()
1427 return rc; in ecryptfs_write_metadata()
1436 int rc = 0; in parse_header_metadata() local
1450 rc = -EINVAL; in parse_header_metadata()
1454 return rc; in parse_header_metadata()
1488 int rc = 0; in ecryptfs_read_headers_virt() local
1496 rc = contains_ecryptfs_marker(page_virt + offset); in ecryptfs_read_headers_virt()
1497 if (rc == 0) { in ecryptfs_read_headers_virt()
1498 rc = -EINVAL; in ecryptfs_read_headers_virt()
1502 rc = ecryptfs_process_flags(crypt_stat, (page_virt + offset), in ecryptfs_read_headers_virt()
1504 if (rc) { in ecryptfs_read_headers_virt()
1514 rc = -EINVAL; in ecryptfs_read_headers_virt()
1519 rc = parse_header_metadata(crypt_stat, (page_virt + offset), in ecryptfs_read_headers_virt()
1521 if (rc) { in ecryptfs_read_headers_virt()
1523 "metadata; rc = [%d]\n", rc); in ecryptfs_read_headers_virt()
1528 rc = ecryptfs_parse_packet_set(crypt_stat, (page_virt + offset), in ecryptfs_read_headers_virt()
1531 return rc; in ecryptfs_read_headers_virt()
1549 int rc = 0; in ecryptfs_read_xattr_region() local
1558 rc = -EINVAL; in ecryptfs_read_xattr_region()
1562 return rc; in ecryptfs_read_xattr_region()
1568 int rc; in ecryptfs_read_and_validate_xattr_region() local
1570 rc = ecryptfs_read_xattr_region(page_virt, ecryptfs_dentry->d_inode); in ecryptfs_read_and_validate_xattr_region()
1571 if (rc) in ecryptfs_read_and_validate_xattr_region()
1576 rc = -EINVAL; in ecryptfs_read_and_validate_xattr_region()
1579 return rc; in ecryptfs_read_and_validate_xattr_region()
1596 int rc = 0; in ecryptfs_read_metadata() local
1610 rc = -ENOMEM; in ecryptfs_read_metadata()
1615 rc = ecryptfs_read_lower(page_virt, 0, crypt_stat->extent_size, in ecryptfs_read_metadata()
1617 if (!rc) in ecryptfs_read_metadata()
1618 rc = ecryptfs_read_headers_virt(page_virt, crypt_stat, in ecryptfs_read_metadata()
1621 if (rc) { in ecryptfs_read_metadata()
1622 rc = ecryptfs_read_xattr_region(page_virt, ecryptfs_inode); in ecryptfs_read_metadata()
1623 if (rc) { in ecryptfs_read_metadata()
1626 rc = -EINVAL; in ecryptfs_read_metadata()
1629 rc = ecryptfs_read_headers_virt(page_virt, crypt_stat, in ecryptfs_read_metadata()
1632 if (rc) { in ecryptfs_read_metadata()
1635 rc = -EINVAL; in ecryptfs_read_metadata()
1646 rc = -EINVAL; in ecryptfs_read_metadata()
1654 return rc; in ecryptfs_read_metadata()
1671 int rc = 0; in ecryptfs_encrypt_filename() local
1681 rc = ecryptfs_write_tag_70_packet( in ecryptfs_encrypt_filename()
1686 if (rc) { in ecryptfs_encrypt_filename()
1689 rc); in ecryptfs_encrypt_filename()
1699 rc = -ENOMEM; in ecryptfs_encrypt_filename()
1703 rc = ecryptfs_write_tag_70_packet(filename->encrypted_filename, in ecryptfs_encrypt_filename()
1709 if (rc) { in ecryptfs_encrypt_filename()
1712 rc); in ecryptfs_encrypt_filename()
1722 rc = -ENOTSUPP; in ecryptfs_encrypt_filename()
1726 return rc; in ecryptfs_encrypt_filename()
1732 int rc = 0; in ecryptfs_copy_filename() local
1736 rc = -ENOMEM; in ecryptfs_copy_filename()
1746 return rc; in ecryptfs_copy_filename()
1765 int rc; in ecryptfs_process_key_cipher() local
1769 rc = -EINVAL; in ecryptfs_process_key_cipher()
1774 rc = ecryptfs_crypto_api_algify_cipher_name(&full_alg_name, cipher_name, in ecryptfs_process_key_cipher()
1776 if (rc) in ecryptfs_process_key_cipher()
1781 rc = PTR_ERR(*key_tfm); in ecryptfs_process_key_cipher()
1783 "[%s]; rc = [%d]\n", cipher_name, rc); in ecryptfs_process_key_cipher()
1793 rc = crypto_blkcipher_setkey(*key_tfm, dummy_key, *key_size); in ecryptfs_process_key_cipher()
1794 if (rc) { in ecryptfs_process_key_cipher()
1796 "cipher [%s]; rc = [%d]\n", *key_size, cipher_name, rc); in ecryptfs_process_key_cipher()
1797 rc = -EINVAL; in ecryptfs_process_key_cipher()
1801 return rc; in ecryptfs_process_key_cipher()
1841 int rc = 0; in ecryptfs_add_new_key_tfm() local
1849 rc = -ENOMEM; in ecryptfs_add_new_key_tfm()
1859 rc = ecryptfs_process_key_cipher(&tmp_tfm->key_tfm, in ecryptfs_add_new_key_tfm()
1862 if (rc) { in ecryptfs_add_new_key_tfm()
1865 tmp_tfm->cipher_name, rc); in ecryptfs_add_new_key_tfm()
1873 return rc; in ecryptfs_add_new_key_tfm()
1920 int rc = 0; in ecryptfs_get_tfm_and_mutex_for_cipher_name() local
1927 rc = ecryptfs_add_new_key_tfm(&key_tfm, cipher_name, 0); in ecryptfs_get_tfm_and_mutex_for_cipher_name()
1928 if (rc) { in ecryptfs_get_tfm_and_mutex_for_cipher_name()
1930 "rc = [%d]\n", rc); in ecryptfs_get_tfm_and_mutex_for_cipher_name()
1938 return rc; in ecryptfs_get_tfm_and_mutex_for_cipher_name()
2113 int rc = 0; in ecryptfs_encrypt_and_encode_filename() local
2127 rc = -ENOMEM; in ecryptfs_encrypt_and_encode_filename()
2132 rc = ecryptfs_encrypt_filename(filename, crypt_stat, in ecryptfs_encrypt_and_encode_filename()
2134 if (rc) { in ecryptfs_encrypt_and_encode_filename()
2136 "filename; rc = [%d]\n", __func__, rc); in ecryptfs_encrypt_and_encode_filename()
2161 rc = -ENOMEM; in ecryptfs_encrypt_and_encode_filename()
2186 rc = -ENOTSUPP; in ecryptfs_encrypt_and_encode_filename()
2188 if (rc) { in ecryptfs_encrypt_and_encode_filename()
2191 rc); in ecryptfs_encrypt_and_encode_filename()
2199 rc = ecryptfs_copy_filename(encoded_name, in ecryptfs_encrypt_and_encode_filename()
2204 return rc; in ecryptfs_encrypt_and_encode_filename()
2230 int rc = 0; in ecryptfs_decode_and_decrypt_filename() local
2249 rc = -ENOMEM; in ecryptfs_decode_and_decrypt_filename()
2254 rc = ecryptfs_parse_tag_70_packet(plaintext_name, in ecryptfs_decode_and_decrypt_filename()
2260 if (rc) { in ecryptfs_decode_and_decrypt_filename()
2264 rc = ecryptfs_copy_filename(plaintext_name, in ecryptfs_decode_and_decrypt_filename()
2270 rc = ecryptfs_copy_filename(plaintext_name, in ecryptfs_decode_and_decrypt_filename()
2278 return rc; in ecryptfs_decode_and_decrypt_filename()