Lines Matching refs:rc

96 	int rc = 0;  in ecryptfs_calculate_md5()  local
104 rc = PTR_ERR(desc.tfm); in ecryptfs_calculate_md5()
107 rc); in ecryptfs_calculate_md5()
112 rc = crypto_hash_init(&desc); in ecryptfs_calculate_md5()
113 if (rc) { in ecryptfs_calculate_md5()
116 __func__, rc); in ecryptfs_calculate_md5()
119 rc = crypto_hash_update(&desc, &sg, len); in ecryptfs_calculate_md5()
120 if (rc) { in ecryptfs_calculate_md5()
123 __func__, rc); in ecryptfs_calculate_md5()
126 rc = crypto_hash_final(&desc, dst); in ecryptfs_calculate_md5()
127 if (rc) { in ecryptfs_calculate_md5()
130 __func__, rc); in ecryptfs_calculate_md5()
135 return rc; in ecryptfs_calculate_md5()
145 int rc; in ecryptfs_crypto_api_algify_cipher_name() local
150 rc = -ENOMEM; in ecryptfs_crypto_api_algify_cipher_name()
155 rc = 0; in ecryptfs_crypto_api_algify_cipher_name()
157 return rc; in ecryptfs_crypto_api_algify_cipher_name()
174 int rc = 0; in ecryptfs_derive_iv() local
193 rc = ecryptfs_calculate_md5(dst, crypt_stat, src, in ecryptfs_derive_iv()
195 if (rc) { in ecryptfs_derive_iv()
206 return rc; in ecryptfs_derive_iv()
315 int rc; member
318 static void extent_crypt_complete(struct crypto_async_request *req, int rc) in extent_crypt_complete() argument
322 if (rc == -EINPROGRESS) in extent_crypt_complete()
325 ecr->rc = rc; in extent_crypt_complete()
347 int rc = 0; in crypt_scatterlist() local
364 rc = -ENOMEM; in crypt_scatterlist()
373 rc = crypto_ablkcipher_setkey(crypt_stat->tfm, crypt_stat->key, in crypt_scatterlist()
375 if (rc) { in crypt_scatterlist()
378 rc); in crypt_scatterlist()
380 rc = -EINVAL; in crypt_scatterlist()
387 rc = op == ENCRYPT ? crypto_ablkcipher_encrypt(req) : in crypt_scatterlist()
389 if (rc == -EINPROGRESS || rc == -EBUSY) { in crypt_scatterlist()
393 rc = ecr->rc; in crypt_scatterlist()
398 return rc; in crypt_scatterlist()
436 int rc; in crypt_extent() local
439 rc = ecryptfs_derive_iv(extent_iv, crypt_stat, in crypt_extent()
441 if (rc) { in crypt_extent()
444 (unsigned long long)(extent_base + extent_offset), rc); in crypt_extent()
456 rc = crypt_scatterlist(crypt_stat, &dst_sg, &src_sg, extent_size, in crypt_extent()
458 if (rc < 0) { in crypt_extent()
461 "rc = [%d]\n", __func__, page_index, extent_offset, rc); in crypt_extent()
464 rc = 0; in crypt_extent()
466 return rc; in crypt_extent()
493 int rc = 0; in ecryptfs_encrypt_page() local
501 rc = -ENOMEM; in ecryptfs_encrypt_page()
510 rc = crypt_extent(crypt_stat, enc_extent_page, page, in ecryptfs_encrypt_page()
512 if (rc) { in ecryptfs_encrypt_page()
514 "rc = [%d]\n", __func__, rc); in ecryptfs_encrypt_page()
521 rc = ecryptfs_write_lower(ecryptfs_inode, enc_extent_virt, lower_offset, in ecryptfs_encrypt_page()
524 if (rc < 0) { in ecryptfs_encrypt_page()
527 rc); in ecryptfs_encrypt_page()
530 rc = 0; in ecryptfs_encrypt_page()
535 return rc; in ecryptfs_encrypt_page()
561 int rc = 0; in ecryptfs_decrypt_page() local
570 rc = ecryptfs_read_lower(page_virt, lower_offset, PAGE_CACHE_SIZE, in ecryptfs_decrypt_page()
573 if (rc < 0) { in ecryptfs_decrypt_page()
576 rc); in ecryptfs_decrypt_page()
583 rc = crypt_extent(crypt_stat, page, page, in ecryptfs_decrypt_page()
585 if (rc) { in ecryptfs_decrypt_page()
587 "rc = [%d]\n", __func__, rc); in ecryptfs_decrypt_page()
592 return rc; in ecryptfs_decrypt_page()
609 int rc = -EINVAL; in ecryptfs_init_crypt_ctx() local
618 rc = 0; in ecryptfs_init_crypt_ctx()
621 rc = ecryptfs_crypto_api_algify_cipher_name(&full_alg_name, in ecryptfs_init_crypt_ctx()
623 if (rc) in ecryptfs_init_crypt_ctx()
627 rc = PTR_ERR(crypt_stat->tfm); in ecryptfs_init_crypt_ctx()
635 rc = 0; in ecryptfs_init_crypt_ctx()
640 return rc; in ecryptfs_init_crypt_ctx()
685 int rc = 0; in ecryptfs_compute_root_iv() local
691 rc = -EINVAL; in ecryptfs_compute_root_iv()
696 rc = ecryptfs_calculate_md5(dst, crypt_stat, crypt_stat->key, in ecryptfs_compute_root_iv()
698 if (rc) { in ecryptfs_compute_root_iv()
705 if (rc) { in ecryptfs_compute_root_iv()
709 return rc; in ecryptfs_compute_root_iv()
756 int rc = 0; in ecryptfs_copy_mount_wide_sigs_to_inode_sigs() local
766 rc = ecryptfs_add_keysig(crypt_stat, global_auth_tok->sig); in ecryptfs_copy_mount_wide_sigs_to_inode_sigs()
767 if (rc) { in ecryptfs_copy_mount_wide_sigs_to_inode_sigs()
768 printk(KERN_ERR "Error adding keysig; rc = [%d]\n", rc); in ecryptfs_copy_mount_wide_sigs_to_inode_sigs()
776 return rc; in ecryptfs_copy_mount_wide_sigs_to_inode_sigs()
827 int rc = 0; in ecryptfs_new_file_context() local
833 rc = ecryptfs_copy_mount_wide_sigs_to_inode_sigs(crypt_stat, in ecryptfs_new_file_context()
835 if (rc) { in ecryptfs_new_file_context()
837 "to the inode key sigs; rc = [%d]\n", rc); in ecryptfs_new_file_context()
849 rc = ecryptfs_init_crypt_ctx(crypt_stat); in ecryptfs_new_file_context()
850 if (rc) in ecryptfs_new_file_context()
853 crypt_stat->cipher, rc); in ecryptfs_new_file_context()
855 return rc; in ecryptfs_new_file_context()
904 int rc = 0; in ecryptfs_process_flags() local
918 return rc; in ecryptfs_process_flags()
1021 int rc = 0; in ecryptfs_cipher_code_to_string() local
1031 rc = -EINVAL; in ecryptfs_cipher_code_to_string()
1033 return rc; in ecryptfs_cipher_code_to_string()
1040 int rc; in ecryptfs_read_and_validate_header_region() local
1042 rc = ecryptfs_read_lower(file_size, 0, ECRYPTFS_SIZE_AND_MARKER_BYTES, in ecryptfs_read_and_validate_header_region()
1044 if (rc < ECRYPTFS_SIZE_AND_MARKER_BYTES) in ecryptfs_read_and_validate_header_region()
1045 return rc >= 0 ? -EINVAL : rc; in ecryptfs_read_and_validate_header_region()
1046 rc = ecryptfs_validate_marker(marker); in ecryptfs_read_and_validate_header_region()
1047 if (!rc) in ecryptfs_read_and_validate_header_region()
1049 return rc; in ecryptfs_read_and_validate_header_region()
1107 int rc; in ecryptfs_write_headers_virt() local
1120 rc = ecryptfs_generate_key_packet_set((page_virt + offset), crypt_stat, in ecryptfs_write_headers_virt()
1123 if (rc) in ecryptfs_write_headers_virt()
1125 "set; rc = [%d]\n", rc); in ecryptfs_write_headers_virt()
1130 return rc; in ecryptfs_write_headers_virt()
1137 int rc; in ecryptfs_write_metadata_to_contents() local
1139 rc = ecryptfs_write_lower(ecryptfs_inode, virt, in ecryptfs_write_metadata_to_contents()
1141 if (rc < 0) in ecryptfs_write_metadata_to_contents()
1143 "information to lower file; rc = [%d]\n", __func__, rc); in ecryptfs_write_metadata_to_contents()
1145 rc = 0; in ecryptfs_write_metadata_to_contents()
1146 return rc; in ecryptfs_write_metadata_to_contents()
1153 int rc; in ecryptfs_write_metadata_to_xattr() local
1155 rc = ecryptfs_setxattr(ecryptfs_dentry, ECRYPTFS_XATTR_NAME, page_virt, in ecryptfs_write_metadata_to_xattr()
1157 return rc; in ecryptfs_write_metadata_to_xattr()
1193 int rc = 0; in ecryptfs_write_metadata() local
1198 rc = -EINVAL; in ecryptfs_write_metadata()
1204 rc = -EINVAL; in ecryptfs_write_metadata()
1213 rc = -ENOMEM; in ecryptfs_write_metadata()
1217 rc = ecryptfs_write_headers_virt(virt, virt_len, &size, crypt_stat, in ecryptfs_write_metadata()
1219 if (unlikely(rc)) { in ecryptfs_write_metadata()
1221 __func__, rc); in ecryptfs_write_metadata()
1225 rc = ecryptfs_write_metadata_to_xattr(ecryptfs_dentry, virt, in ecryptfs_write_metadata()
1228 rc = ecryptfs_write_metadata_to_contents(ecryptfs_inode, virt, in ecryptfs_write_metadata()
1230 if (rc) { in ecryptfs_write_metadata()
1232 "rc = [%d]\n", __func__, rc); in ecryptfs_write_metadata()
1238 return rc; in ecryptfs_write_metadata()
1247 int rc = 0; in parse_header_metadata() local
1260 rc = -EINVAL; in parse_header_metadata()
1264 return rc; in parse_header_metadata()
1316 int rc = 0; in ecryptfs_read_headers_virt() local
1324 rc = ecryptfs_validate_marker(page_virt + offset); in ecryptfs_read_headers_virt()
1325 if (rc) in ecryptfs_read_headers_virt()
1330 rc = ecryptfs_process_flags(crypt_stat, (page_virt + offset), in ecryptfs_read_headers_virt()
1332 if (rc) { in ecryptfs_read_headers_virt()
1342 rc = -EINVAL; in ecryptfs_read_headers_virt()
1347 rc = parse_header_metadata(crypt_stat, (page_virt + offset), in ecryptfs_read_headers_virt()
1349 if (rc) { in ecryptfs_read_headers_virt()
1351 "metadata; rc = [%d]\n", rc); in ecryptfs_read_headers_virt()
1356 rc = ecryptfs_parse_packet_set(crypt_stat, (page_virt + offset), in ecryptfs_read_headers_virt()
1359 return rc; in ecryptfs_read_headers_virt()
1377 int rc = 0; in ecryptfs_read_xattr_region() local
1386 rc = -EINVAL; in ecryptfs_read_xattr_region()
1390 return rc; in ecryptfs_read_xattr_region()
1398 int rc; in ecryptfs_read_and_validate_xattr_region() local
1400 rc = ecryptfs_getxattr_lower(ecryptfs_dentry_to_lower(dentry), in ecryptfs_read_and_validate_xattr_region()
1403 if (rc < ECRYPTFS_SIZE_AND_MARKER_BYTES) in ecryptfs_read_and_validate_xattr_region()
1404 return rc >= 0 ? -EINVAL : rc; in ecryptfs_read_and_validate_xattr_region()
1405 rc = ecryptfs_validate_marker(marker); in ecryptfs_read_and_validate_xattr_region()
1406 if (!rc) in ecryptfs_read_and_validate_xattr_region()
1408 return rc; in ecryptfs_read_and_validate_xattr_region()
1425 int rc; in ecryptfs_read_metadata() local
1439 rc = -ENOMEM; in ecryptfs_read_metadata()
1444 rc = ecryptfs_read_lower(page_virt, 0, crypt_stat->extent_size, in ecryptfs_read_metadata()
1446 if (rc >= 0) in ecryptfs_read_metadata()
1447 rc = ecryptfs_read_headers_virt(page_virt, crypt_stat, in ecryptfs_read_metadata()
1450 if (rc) { in ecryptfs_read_metadata()
1453 rc = ecryptfs_read_xattr_region(page_virt, ecryptfs_inode); in ecryptfs_read_metadata()
1454 if (rc) { in ecryptfs_read_metadata()
1458 rc = -EINVAL; in ecryptfs_read_metadata()
1461 rc = ecryptfs_read_headers_virt(page_virt, crypt_stat, in ecryptfs_read_metadata()
1464 if (rc) { in ecryptfs_read_metadata()
1468 rc = -EINVAL; in ecryptfs_read_metadata()
1480 rc = -EINVAL; in ecryptfs_read_metadata()
1488 return rc; in ecryptfs_read_metadata()
1505 int rc = 0; in ecryptfs_encrypt_filename() local
1515 rc = ecryptfs_write_tag_70_packet( in ecryptfs_encrypt_filename()
1520 if (rc) { in ecryptfs_encrypt_filename()
1523 rc); in ecryptfs_encrypt_filename()
1533 rc = -ENOMEM; in ecryptfs_encrypt_filename()
1537 rc = ecryptfs_write_tag_70_packet(filename->encrypted_filename, in ecryptfs_encrypt_filename()
1543 if (rc) { in ecryptfs_encrypt_filename()
1546 rc); in ecryptfs_encrypt_filename()
1556 rc = -EOPNOTSUPP; in ecryptfs_encrypt_filename()
1560 return rc; in ecryptfs_encrypt_filename()
1566 int rc = 0; in ecryptfs_copy_filename() local
1570 rc = -ENOMEM; in ecryptfs_copy_filename()
1580 return rc; in ecryptfs_copy_filename()
1599 int rc; in ecryptfs_process_key_cipher() local
1603 rc = -EINVAL; in ecryptfs_process_key_cipher()
1608 rc = ecryptfs_crypto_api_algify_cipher_name(&full_alg_name, cipher_name, in ecryptfs_process_key_cipher()
1610 if (rc) in ecryptfs_process_key_cipher()
1614 rc = PTR_ERR(*key_tfm); in ecryptfs_process_key_cipher()
1616 "[%s]; rc = [%d]\n", full_alg_name, rc); in ecryptfs_process_key_cipher()
1626 rc = crypto_blkcipher_setkey(*key_tfm, dummy_key, *key_size); in ecryptfs_process_key_cipher()
1627 if (rc) { in ecryptfs_process_key_cipher()
1630 rc); in ecryptfs_process_key_cipher()
1631 rc = -EINVAL; in ecryptfs_process_key_cipher()
1636 return rc; in ecryptfs_process_key_cipher()
1676 int rc = 0; in ecryptfs_add_new_key_tfm() local
1684 rc = -ENOMEM; in ecryptfs_add_new_key_tfm()
1694 rc = ecryptfs_process_key_cipher(&tmp_tfm->key_tfm, in ecryptfs_add_new_key_tfm()
1697 if (rc) { in ecryptfs_add_new_key_tfm()
1700 tmp_tfm->cipher_name, rc); in ecryptfs_add_new_key_tfm()
1708 return rc; in ecryptfs_add_new_key_tfm()
1755 int rc = 0; in ecryptfs_get_tfm_and_mutex_for_cipher_name() local
1762 rc = ecryptfs_add_new_key_tfm(&key_tfm, cipher_name, 0); in ecryptfs_get_tfm_and_mutex_for_cipher_name()
1763 if (rc) { in ecryptfs_get_tfm_and_mutex_for_cipher_name()
1765 "rc = [%d]\n", rc); in ecryptfs_get_tfm_and_mutex_for_cipher_name()
1773 return rc; in ecryptfs_get_tfm_and_mutex_for_cipher_name()
1952 int rc = 0; in ecryptfs_encrypt_and_encode_filename() local
1966 rc = -ENOMEM; in ecryptfs_encrypt_and_encode_filename()
1971 rc = ecryptfs_encrypt_filename(filename, crypt_stat, in ecryptfs_encrypt_and_encode_filename()
1973 if (rc) { in ecryptfs_encrypt_and_encode_filename()
1975 "filename; rc = [%d]\n", __func__, rc); in ecryptfs_encrypt_and_encode_filename()
2000 rc = -ENOMEM; in ecryptfs_encrypt_and_encode_filename()
2024 rc = -EOPNOTSUPP; in ecryptfs_encrypt_and_encode_filename()
2026 if (rc) { in ecryptfs_encrypt_and_encode_filename()
2029 rc); in ecryptfs_encrypt_and_encode_filename()
2037 rc = ecryptfs_copy_filename(encoded_name, in ecryptfs_encrypt_and_encode_filename()
2042 return rc; in ecryptfs_encrypt_and_encode_filename()
2067 int rc = 0; in ecryptfs_decode_and_decrypt_filename() local
2086 rc = -ENOMEM; in ecryptfs_decode_and_decrypt_filename()
2091 rc = ecryptfs_parse_tag_70_packet(plaintext_name, in ecryptfs_decode_and_decrypt_filename()
2097 if (rc) { in ecryptfs_decode_and_decrypt_filename()
2101 rc = ecryptfs_copy_filename(plaintext_name, in ecryptfs_decode_and_decrypt_filename()
2107 rc = ecryptfs_copy_filename(plaintext_name, in ecryptfs_decode_and_decrypt_filename()
2115 return rc; in ecryptfs_decode_and_decrypt_filename()
2126 int rc; in ecryptfs_set_f_namelen() local
2133 rc = ecryptfs_get_tfm_and_mutex_for_cipher_name(&desc.tfm, &tfm_mutex, in ecryptfs_set_f_namelen()
2135 if (unlikely(rc)) { in ecryptfs_set_f_namelen()
2137 return rc; in ecryptfs_set_f_namelen()