Lines Matching refs:rc

65 	int rc = crypto_shash_tfm_digest(crypt_stat->hash_tfm, src, len, dst);  in ecryptfs_calculate_md5()  local
67 if (rc) { in ecryptfs_calculate_md5()
70 __func__, rc); in ecryptfs_calculate_md5()
74 return rc; in ecryptfs_calculate_md5()
84 int rc; in ecryptfs_crypto_api_algify_cipher_name() local
89 rc = -ENOMEM; in ecryptfs_crypto_api_algify_cipher_name()
94 rc = 0; in ecryptfs_crypto_api_algify_cipher_name()
96 return rc; in ecryptfs_crypto_api_algify_cipher_name()
113 int rc = 0; in ecryptfs_derive_iv() local
132 rc = ecryptfs_calculate_md5(dst, crypt_stat, src, in ecryptfs_derive_iv()
134 if (rc) { in ecryptfs_derive_iv()
145 return rc; in ecryptfs_derive_iv()
157 int rc; in ecryptfs_init_crypt_stat() local
161 rc = PTR_ERR(tfm); in ecryptfs_init_crypt_stat()
164 rc); in ecryptfs_init_crypt_stat()
165 return rc; in ecryptfs_init_crypt_stat()
281 int rc = 0; in crypt_scatterlist() local
294 rc = -ENOMEM; in crypt_scatterlist()
303 rc = crypto_skcipher_setkey(crypt_stat->tfm, crypt_stat->key, in crypt_scatterlist()
305 if (rc) { in crypt_scatterlist()
308 rc); in crypt_scatterlist()
310 rc = -EINVAL; in crypt_scatterlist()
317 rc = op == ENCRYPT ? crypto_skcipher_encrypt(req) : in crypt_scatterlist()
319 rc = crypto_wait_req(rc, &ecr); in crypt_scatterlist()
322 return rc; in crypt_scatterlist()
361 int rc; in crypt_extent() local
364 rc = ecryptfs_derive_iv(extent_iv, crypt_stat, in crypt_extent()
366 if (rc) { in crypt_extent()
369 (unsigned long long)(extent_base + extent_offset), rc); in crypt_extent()
381 rc = crypt_scatterlist(crypt_stat, &dst_sg, &src_sg, extent_size, in crypt_extent()
383 if (rc < 0) { in crypt_extent()
386 "rc = [%d]\n", __func__, page_index, extent_offset, rc); in crypt_extent()
389 rc = 0; in crypt_extent()
391 return rc; in crypt_extent()
418 int rc = 0; in ecryptfs_encrypt_page() local
426 rc = -ENOMEM; in ecryptfs_encrypt_page()
435 rc = crypt_extent(crypt_stat, enc_extent_page, in ecryptfs_encrypt_page()
438 if (rc) { in ecryptfs_encrypt_page()
440 "rc = [%d]\n", __func__, rc); in ecryptfs_encrypt_page()
447 rc = ecryptfs_write_lower(ecryptfs_inode, enc_extent_virt, lower_offset, in ecryptfs_encrypt_page()
450 if (rc < 0) { in ecryptfs_encrypt_page()
453 rc); in ecryptfs_encrypt_page()
456 rc = 0; in ecryptfs_encrypt_page()
461 return rc; in ecryptfs_encrypt_page()
487 int rc = 0; in ecryptfs_decrypt_page() local
496 rc = ecryptfs_read_lower(page_virt, lower_offset, PAGE_SIZE, in ecryptfs_decrypt_page()
499 if (rc < 0) { in ecryptfs_decrypt_page()
502 rc); in ecryptfs_decrypt_page()
510 rc = crypt_extent(crypt_stat, page, page, folio->index, in ecryptfs_decrypt_page()
512 if (rc) { in ecryptfs_decrypt_page()
514 "rc = [%d]\n", __func__, rc); in ecryptfs_decrypt_page()
519 return rc; in ecryptfs_decrypt_page()
536 int rc = -EINVAL; in ecryptfs_init_crypt_ctx() local
545 rc = 0; in ecryptfs_init_crypt_ctx()
548 rc = ecryptfs_crypto_api_algify_cipher_name(&full_alg_name, in ecryptfs_init_crypt_ctx()
550 if (rc) in ecryptfs_init_crypt_ctx()
554 rc = PTR_ERR(crypt_stat->tfm); in ecryptfs_init_crypt_ctx()
563 rc = 0; in ecryptfs_init_crypt_ctx()
568 return rc; in ecryptfs_init_crypt_ctx()
612 int rc = 0; in ecryptfs_compute_root_iv() local
618 rc = -EINVAL; in ecryptfs_compute_root_iv()
623 rc = ecryptfs_calculate_md5(dst, crypt_stat, crypt_stat->key, in ecryptfs_compute_root_iv()
625 if (rc) { in ecryptfs_compute_root_iv()
632 if (rc) { in ecryptfs_compute_root_iv()
636 return rc; in ecryptfs_compute_root_iv()
683 int rc = 0; in ecryptfs_copy_mount_wide_sigs_to_inode_sigs() local
693 rc = ecryptfs_add_keysig(crypt_stat, global_auth_tok->sig); in ecryptfs_copy_mount_wide_sigs_to_inode_sigs()
694 if (rc) { in ecryptfs_copy_mount_wide_sigs_to_inode_sigs()
695 printk(KERN_ERR "Error adding keysig; rc = [%d]\n", rc); in ecryptfs_copy_mount_wide_sigs_to_inode_sigs()
703 return rc; in ecryptfs_copy_mount_wide_sigs_to_inode_sigs()
754 int rc = 0; in ecryptfs_new_file_context() local
760 rc = ecryptfs_copy_mount_wide_sigs_to_inode_sigs(crypt_stat, in ecryptfs_new_file_context()
762 if (rc) { in ecryptfs_new_file_context()
764 "to the inode key sigs; rc = [%d]\n", rc); in ecryptfs_new_file_context()
776 rc = ecryptfs_init_crypt_ctx(crypt_stat); in ecryptfs_new_file_context()
777 if (rc) in ecryptfs_new_file_context()
780 crypt_stat->cipher, rc); in ecryptfs_new_file_context()
782 return rc; in ecryptfs_new_file_context()
942 int rc = 0; in ecryptfs_cipher_code_to_string() local
952 rc = -EINVAL; in ecryptfs_cipher_code_to_string()
954 return rc; in ecryptfs_cipher_code_to_string()
961 int rc; in ecryptfs_read_and_validate_header_region() local
963 rc = ecryptfs_read_lower(file_size, 0, ECRYPTFS_SIZE_AND_MARKER_BYTES, in ecryptfs_read_and_validate_header_region()
965 if (rc < 0) in ecryptfs_read_and_validate_header_region()
966 return rc; in ecryptfs_read_and_validate_header_region()
967 else if (rc < ECRYPTFS_SIZE_AND_MARKER_BYTES) in ecryptfs_read_and_validate_header_region()
969 rc = ecryptfs_validate_marker(marker); in ecryptfs_read_and_validate_header_region()
970 if (!rc) in ecryptfs_read_and_validate_header_region()
972 return rc; in ecryptfs_read_and_validate_header_region()
1030 int rc; in ecryptfs_write_headers_virt() local
1043 rc = ecryptfs_generate_key_packet_set((page_virt + offset), crypt_stat, in ecryptfs_write_headers_virt()
1046 if (rc) in ecryptfs_write_headers_virt()
1048 "set; rc = [%d]\n", rc); in ecryptfs_write_headers_virt()
1053 return rc; in ecryptfs_write_headers_virt()
1060 int rc; in ecryptfs_write_metadata_to_contents() local
1062 rc = ecryptfs_write_lower(ecryptfs_inode, virt, in ecryptfs_write_metadata_to_contents()
1064 if (rc < 0) in ecryptfs_write_metadata_to_contents()
1066 "information to lower file; rc = [%d]\n", __func__, rc); in ecryptfs_write_metadata_to_contents()
1068 rc = 0; in ecryptfs_write_metadata_to_contents()
1069 return rc; in ecryptfs_write_metadata_to_contents()
1077 int rc; in ecryptfs_write_metadata_to_xattr() local
1082 rc = -EOPNOTSUPP; in ecryptfs_write_metadata_to_xattr()
1087 rc = __vfs_setxattr(&nop_mnt_idmap, lower_dentry, lower_inode, in ecryptfs_write_metadata_to_xattr()
1089 if (!rc && ecryptfs_inode) in ecryptfs_write_metadata_to_xattr()
1093 return rc; in ecryptfs_write_metadata_to_xattr()
1129 int rc = 0; in ecryptfs_write_metadata() local
1134 rc = -EINVAL; in ecryptfs_write_metadata()
1140 rc = -EINVAL; in ecryptfs_write_metadata()
1149 rc = -ENOMEM; in ecryptfs_write_metadata()
1153 rc = ecryptfs_write_headers_virt(virt, virt_len, &size, crypt_stat, in ecryptfs_write_metadata()
1155 if (unlikely(rc)) { in ecryptfs_write_metadata()
1157 __func__, rc); in ecryptfs_write_metadata()
1161 rc = ecryptfs_write_metadata_to_xattr(ecryptfs_dentry, ecryptfs_inode, in ecryptfs_write_metadata()
1164 rc = ecryptfs_write_metadata_to_contents(ecryptfs_inode, virt, in ecryptfs_write_metadata()
1166 if (rc) { in ecryptfs_write_metadata()
1168 "rc = [%d]\n", __func__, rc); in ecryptfs_write_metadata()
1174 return rc; in ecryptfs_write_metadata()
1183 int rc = 0; in parse_header_metadata() local
1196 rc = -EINVAL; in parse_header_metadata()
1200 return rc; in parse_header_metadata()
1252 int rc = 0; in ecryptfs_read_headers_virt() local
1260 rc = ecryptfs_validate_marker(page_virt + offset); in ecryptfs_read_headers_virt()
1261 if (rc) in ecryptfs_read_headers_virt()
1273 rc = -EINVAL; in ecryptfs_read_headers_virt()
1278 rc = parse_header_metadata(crypt_stat, (page_virt + offset), in ecryptfs_read_headers_virt()
1280 if (rc) { in ecryptfs_read_headers_virt()
1282 "metadata; rc = [%d]\n", rc); in ecryptfs_read_headers_virt()
1287 rc = ecryptfs_parse_packet_set(crypt_stat, (page_virt + offset), in ecryptfs_read_headers_virt()
1290 return rc; in ecryptfs_read_headers_virt()
1308 int rc = 0; in ecryptfs_read_xattr_region() local
1319 rc = -EINVAL; in ecryptfs_read_xattr_region()
1323 return rc; in ecryptfs_read_xattr_region()
1331 int rc; in ecryptfs_read_and_validate_xattr_region() local
1333 rc = ecryptfs_getxattr_lower(ecryptfs_dentry_to_lower(dentry), in ecryptfs_read_and_validate_xattr_region()
1337 if (rc < 0) in ecryptfs_read_and_validate_xattr_region()
1338 return rc; in ecryptfs_read_and_validate_xattr_region()
1339 else if (rc < ECRYPTFS_SIZE_AND_MARKER_BYTES) in ecryptfs_read_and_validate_xattr_region()
1341 rc = ecryptfs_validate_marker(marker); in ecryptfs_read_and_validate_xattr_region()
1342 if (!rc) in ecryptfs_read_and_validate_xattr_region()
1344 return rc; in ecryptfs_read_and_validate_xattr_region()
1361 int rc; in ecryptfs_read_metadata() local
1375 rc = -ENOMEM; in ecryptfs_read_metadata()
1378 rc = ecryptfs_read_lower(page_virt, 0, crypt_stat->extent_size, in ecryptfs_read_metadata()
1380 if (rc >= 0) in ecryptfs_read_metadata()
1381 rc = ecryptfs_read_headers_virt(page_virt, crypt_stat, in ecryptfs_read_metadata()
1384 if (rc) { in ecryptfs_read_metadata()
1387 rc = ecryptfs_read_xattr_region(page_virt, ecryptfs_inode); in ecryptfs_read_metadata()
1388 if (rc) { in ecryptfs_read_metadata()
1392 rc = -EINVAL; in ecryptfs_read_metadata()
1395 rc = ecryptfs_read_headers_virt(page_virt, crypt_stat, in ecryptfs_read_metadata()
1398 if (rc) { in ecryptfs_read_metadata()
1402 rc = -EINVAL; in ecryptfs_read_metadata()
1414 rc = -EINVAL; in ecryptfs_read_metadata()
1422 return rc; in ecryptfs_read_metadata()
1438 int rc = 0; in ecryptfs_encrypt_filename() local
1447 rc = ecryptfs_write_tag_70_packet( in ecryptfs_encrypt_filename()
1452 if (rc) { in ecryptfs_encrypt_filename()
1455 rc); in ecryptfs_encrypt_filename()
1462 rc = -ENOMEM; in ecryptfs_encrypt_filename()
1466 rc = ecryptfs_write_tag_70_packet(filename->encrypted_filename, in ecryptfs_encrypt_filename()
1472 if (rc) { in ecryptfs_encrypt_filename()
1475 rc); in ecryptfs_encrypt_filename()
1485 rc = -EOPNOTSUPP; in ecryptfs_encrypt_filename()
1489 return rc; in ecryptfs_encrypt_filename()
1495 int rc = 0; in ecryptfs_copy_filename() local
1499 rc = -ENOMEM; in ecryptfs_copy_filename()
1509 return rc; in ecryptfs_copy_filename()
1528 int rc; in ecryptfs_process_key_cipher() local
1532 rc = -EINVAL; in ecryptfs_process_key_cipher()
1537 rc = ecryptfs_crypto_api_algify_cipher_name(&full_alg_name, cipher_name, in ecryptfs_process_key_cipher()
1539 if (rc) in ecryptfs_process_key_cipher()
1543 rc = PTR_ERR(*key_tfm); in ecryptfs_process_key_cipher()
1545 "[%s]; rc = [%d]\n", full_alg_name, rc); in ecryptfs_process_key_cipher()
1552 rc = crypto_skcipher_setkey(*key_tfm, dummy_key, *key_size); in ecryptfs_process_key_cipher()
1553 if (rc) { in ecryptfs_process_key_cipher()
1556 rc); in ecryptfs_process_key_cipher()
1557 rc = -EINVAL; in ecryptfs_process_key_cipher()
1562 return rc; in ecryptfs_process_key_cipher()
1600 int rc = 0; in ecryptfs_add_new_key_tfm() local
1608 rc = -ENOMEM; in ecryptfs_add_new_key_tfm()
1614 rc = ecryptfs_process_key_cipher(&tmp_tfm->key_tfm, in ecryptfs_add_new_key_tfm()
1617 if (rc) { in ecryptfs_add_new_key_tfm()
1620 tmp_tfm->cipher_name, rc); in ecryptfs_add_new_key_tfm()
1628 return rc; in ecryptfs_add_new_key_tfm()
1675 int rc = 0; in ecryptfs_get_tfm_and_mutex_for_cipher_name() local
1682 rc = ecryptfs_add_new_key_tfm(&key_tfm, cipher_name, 0); in ecryptfs_get_tfm_and_mutex_for_cipher_name()
1683 if (rc) { in ecryptfs_get_tfm_and_mutex_for_cipher_name()
1685 "rc = [%d]\n", rc); in ecryptfs_get_tfm_and_mutex_for_cipher_name()
1693 return rc; in ecryptfs_get_tfm_and_mutex_for_cipher_name()
1872 int rc = 0; in ecryptfs_encrypt_and_encode_filename() local
1882 rc = -ENOMEM; in ecryptfs_encrypt_and_encode_filename()
1887 rc = ecryptfs_encrypt_filename(filename, mount_crypt_stat); in ecryptfs_encrypt_and_encode_filename()
1888 if (rc) { in ecryptfs_encrypt_and_encode_filename()
1890 "filename; rc = [%d]\n", __func__, rc); in ecryptfs_encrypt_and_encode_filename()
1910 rc = -ENOMEM; in ecryptfs_encrypt_and_encode_filename()
1932 rc = -EOPNOTSUPP; in ecryptfs_encrypt_and_encode_filename()
1934 if (rc) { in ecryptfs_encrypt_and_encode_filename()
1937 rc); in ecryptfs_encrypt_and_encode_filename()
1945 rc = ecryptfs_copy_filename(encoded_name, in ecryptfs_encrypt_and_encode_filename()
1950 return rc; in ecryptfs_encrypt_and_encode_filename()
1975 int rc = 0; in ecryptfs_decode_and_decrypt_filename() local
1980 rc = ecryptfs_copy_filename(plaintext_name, in ecryptfs_decode_and_decrypt_filename()
1989 rc = -EINVAL; in ecryptfs_decode_and_decrypt_filename()
1999 rc = -ENOMEM; in ecryptfs_decode_and_decrypt_filename()
2004 rc = ecryptfs_parse_tag_70_packet(plaintext_name, in ecryptfs_decode_and_decrypt_filename()
2010 if (rc) { in ecryptfs_decode_and_decrypt_filename()
2017 rc = ecryptfs_copy_filename(plaintext_name, in ecryptfs_decode_and_decrypt_filename()
2025 return rc; in ecryptfs_decode_and_decrypt_filename()
2036 int rc; in ecryptfs_set_f_namelen() local
2043 rc = ecryptfs_get_tfm_and_mutex_for_cipher_name(&tfm, &tfm_mutex, in ecryptfs_set_f_namelen()
2045 if (unlikely(rc)) { in ecryptfs_set_f_namelen()
2047 return rc; in ecryptfs_set_f_namelen()