Lines Matching refs:rc
78 int rc = 0; in ecryptfs_calculate_md5() local
81 rc = ecryptfs_hash_digest(tfm, src, len, dst); in ecryptfs_calculate_md5()
82 if (rc) { in ecryptfs_calculate_md5()
85 __func__, rc); in ecryptfs_calculate_md5()
89 return rc; in ecryptfs_calculate_md5()
99 int rc; in ecryptfs_crypto_api_algify_cipher_name() local
104 rc = -ENOMEM; in ecryptfs_crypto_api_algify_cipher_name()
109 rc = 0; in ecryptfs_crypto_api_algify_cipher_name()
111 return rc; in ecryptfs_crypto_api_algify_cipher_name()
128 int rc = 0; in ecryptfs_derive_iv() local
147 rc = ecryptfs_calculate_md5(dst, crypt_stat, src, in ecryptfs_derive_iv()
149 if (rc) { in ecryptfs_derive_iv()
160 return rc; in ecryptfs_derive_iv()
172 int rc; in ecryptfs_init_crypt_stat() local
176 rc = PTR_ERR(tfm); in ecryptfs_init_crypt_stat()
179 rc); in ecryptfs_init_crypt_stat()
180 return rc; in ecryptfs_init_crypt_stat()
280 int rc; member
283 static void extent_crypt_complete(struct crypto_async_request *req, int rc) in extent_crypt_complete() argument
287 if (rc == -EINPROGRESS) in extent_crypt_complete()
290 ecr->rc = rc; in extent_crypt_complete()
312 int rc = 0; in crypt_scatterlist() local
329 rc = -ENOMEM; in crypt_scatterlist()
338 rc = crypto_skcipher_setkey(crypt_stat->tfm, crypt_stat->key, in crypt_scatterlist()
340 if (rc) { in crypt_scatterlist()
343 rc); in crypt_scatterlist()
345 rc = -EINVAL; in crypt_scatterlist()
352 rc = op == ENCRYPT ? crypto_skcipher_encrypt(req) : in crypt_scatterlist()
354 if (rc == -EINPROGRESS || rc == -EBUSY) { in crypt_scatterlist()
358 rc = ecr->rc; in crypt_scatterlist()
363 return rc; in crypt_scatterlist()
401 int rc; in crypt_extent() local
404 rc = ecryptfs_derive_iv(extent_iv, crypt_stat, in crypt_extent()
406 if (rc) { in crypt_extent()
409 (unsigned long long)(extent_base + extent_offset), rc); in crypt_extent()
421 rc = crypt_scatterlist(crypt_stat, &dst_sg, &src_sg, extent_size, in crypt_extent()
423 if (rc < 0) { in crypt_extent()
426 "rc = [%d]\n", __func__, page_index, extent_offset, rc); in crypt_extent()
429 rc = 0; in crypt_extent()
431 return rc; in crypt_extent()
458 int rc = 0; in ecryptfs_encrypt_page() local
466 rc = -ENOMEM; in ecryptfs_encrypt_page()
475 rc = crypt_extent(crypt_stat, enc_extent_page, page, in ecryptfs_encrypt_page()
477 if (rc) { in ecryptfs_encrypt_page()
479 "rc = [%d]\n", __func__, rc); in ecryptfs_encrypt_page()
486 rc = ecryptfs_write_lower(ecryptfs_inode, enc_extent_virt, lower_offset, in ecryptfs_encrypt_page()
489 if (rc < 0) { in ecryptfs_encrypt_page()
492 rc); in ecryptfs_encrypt_page()
495 rc = 0; in ecryptfs_encrypt_page()
500 return rc; in ecryptfs_encrypt_page()
526 int rc = 0; in ecryptfs_decrypt_page() local
535 rc = ecryptfs_read_lower(page_virt, lower_offset, PAGE_SIZE, in ecryptfs_decrypt_page()
538 if (rc < 0) { in ecryptfs_decrypt_page()
541 rc); in ecryptfs_decrypt_page()
548 rc = crypt_extent(crypt_stat, page, page, in ecryptfs_decrypt_page()
550 if (rc) { in ecryptfs_decrypt_page()
552 "rc = [%d]\n", __func__, rc); in ecryptfs_decrypt_page()
557 return rc; in ecryptfs_decrypt_page()
574 int rc = -EINVAL; in ecryptfs_init_crypt_ctx() local
583 rc = 0; in ecryptfs_init_crypt_ctx()
586 rc = ecryptfs_crypto_api_algify_cipher_name(&full_alg_name, in ecryptfs_init_crypt_ctx()
588 if (rc) in ecryptfs_init_crypt_ctx()
592 rc = PTR_ERR(crypt_stat->tfm); in ecryptfs_init_crypt_ctx()
601 rc = 0; in ecryptfs_init_crypt_ctx()
606 return rc; in ecryptfs_init_crypt_ctx()
651 int rc = 0; in ecryptfs_compute_root_iv() local
657 rc = -EINVAL; in ecryptfs_compute_root_iv()
662 rc = ecryptfs_calculate_md5(dst, crypt_stat, crypt_stat->key, in ecryptfs_compute_root_iv()
664 if (rc) { in ecryptfs_compute_root_iv()
671 if (rc) { in ecryptfs_compute_root_iv()
675 return rc; in ecryptfs_compute_root_iv()
722 int rc = 0; in ecryptfs_copy_mount_wide_sigs_to_inode_sigs() local
732 rc = ecryptfs_add_keysig(crypt_stat, global_auth_tok->sig); in ecryptfs_copy_mount_wide_sigs_to_inode_sigs()
733 if (rc) { in ecryptfs_copy_mount_wide_sigs_to_inode_sigs()
734 printk(KERN_ERR "Error adding keysig; rc = [%d]\n", rc); in ecryptfs_copy_mount_wide_sigs_to_inode_sigs()
742 return rc; in ecryptfs_copy_mount_wide_sigs_to_inode_sigs()
793 int rc = 0; in ecryptfs_new_file_context() local
799 rc = ecryptfs_copy_mount_wide_sigs_to_inode_sigs(crypt_stat, in ecryptfs_new_file_context()
801 if (rc) { in ecryptfs_new_file_context()
803 "to the inode key sigs; rc = [%d]\n", rc); in ecryptfs_new_file_context()
815 rc = ecryptfs_init_crypt_ctx(crypt_stat); in ecryptfs_new_file_context()
816 if (rc) in ecryptfs_new_file_context()
819 crypt_stat->cipher, rc); in ecryptfs_new_file_context()
821 return rc; in ecryptfs_new_file_context()
981 int rc = 0; in ecryptfs_cipher_code_to_string() local
991 rc = -EINVAL; in ecryptfs_cipher_code_to_string()
993 return rc; in ecryptfs_cipher_code_to_string()
1000 int rc; in ecryptfs_read_and_validate_header_region() local
1002 rc = ecryptfs_read_lower(file_size, 0, ECRYPTFS_SIZE_AND_MARKER_BYTES, in ecryptfs_read_and_validate_header_region()
1004 if (rc < 0) in ecryptfs_read_and_validate_header_region()
1005 return rc; in ecryptfs_read_and_validate_header_region()
1006 else if (rc < ECRYPTFS_SIZE_AND_MARKER_BYTES) in ecryptfs_read_and_validate_header_region()
1008 rc = ecryptfs_validate_marker(marker); in ecryptfs_read_and_validate_header_region()
1009 if (!rc) in ecryptfs_read_and_validate_header_region()
1011 return rc; in ecryptfs_read_and_validate_header_region()
1069 int rc; in ecryptfs_write_headers_virt() local
1082 rc = ecryptfs_generate_key_packet_set((page_virt + offset), crypt_stat, in ecryptfs_write_headers_virt()
1085 if (rc) in ecryptfs_write_headers_virt()
1087 "set; rc = [%d]\n", rc); in ecryptfs_write_headers_virt()
1092 return rc; in ecryptfs_write_headers_virt()
1099 int rc; in ecryptfs_write_metadata_to_contents() local
1101 rc = ecryptfs_write_lower(ecryptfs_inode, virt, in ecryptfs_write_metadata_to_contents()
1103 if (rc < 0) in ecryptfs_write_metadata_to_contents()
1105 "information to lower file; rc = [%d]\n", __func__, rc); in ecryptfs_write_metadata_to_contents()
1107 rc = 0; in ecryptfs_write_metadata_to_contents()
1108 return rc; in ecryptfs_write_metadata_to_contents()
1116 int rc; in ecryptfs_write_metadata_to_xattr() local
1121 rc = -EOPNOTSUPP; in ecryptfs_write_metadata_to_xattr()
1126 rc = __vfs_setxattr(lower_dentry, lower_inode, ECRYPTFS_XATTR_NAME, in ecryptfs_write_metadata_to_xattr()
1128 if (!rc && ecryptfs_inode) in ecryptfs_write_metadata_to_xattr()
1132 return rc; in ecryptfs_write_metadata_to_xattr()
1168 int rc = 0; in ecryptfs_write_metadata() local
1173 rc = -EINVAL; in ecryptfs_write_metadata()
1179 rc = -EINVAL; in ecryptfs_write_metadata()
1188 rc = -ENOMEM; in ecryptfs_write_metadata()
1192 rc = ecryptfs_write_headers_virt(virt, virt_len, &size, crypt_stat, in ecryptfs_write_metadata()
1194 if (unlikely(rc)) { in ecryptfs_write_metadata()
1196 __func__, rc); in ecryptfs_write_metadata()
1200 rc = ecryptfs_write_metadata_to_xattr(ecryptfs_dentry, ecryptfs_inode, in ecryptfs_write_metadata()
1203 rc = ecryptfs_write_metadata_to_contents(ecryptfs_inode, virt, in ecryptfs_write_metadata()
1205 if (rc) { in ecryptfs_write_metadata()
1207 "rc = [%d]\n", __func__, rc); in ecryptfs_write_metadata()
1213 return rc; in ecryptfs_write_metadata()
1222 int rc = 0; in parse_header_metadata() local
1235 rc = -EINVAL; in parse_header_metadata()
1239 return rc; in parse_header_metadata()
1291 int rc = 0; in ecryptfs_read_headers_virt() local
1299 rc = ecryptfs_validate_marker(page_virt + offset); in ecryptfs_read_headers_virt()
1300 if (rc) in ecryptfs_read_headers_virt()
1312 rc = -EINVAL; in ecryptfs_read_headers_virt()
1317 rc = parse_header_metadata(crypt_stat, (page_virt + offset), in ecryptfs_read_headers_virt()
1319 if (rc) { in ecryptfs_read_headers_virt()
1321 "metadata; rc = [%d]\n", rc); in ecryptfs_read_headers_virt()
1326 rc = ecryptfs_parse_packet_set(crypt_stat, (page_virt + offset), in ecryptfs_read_headers_virt()
1329 return rc; in ecryptfs_read_headers_virt()
1347 int rc = 0; in ecryptfs_read_xattr_region() local
1358 rc = -EINVAL; in ecryptfs_read_xattr_region()
1362 return rc; in ecryptfs_read_xattr_region()
1370 int rc; in ecryptfs_read_and_validate_xattr_region() local
1372 rc = ecryptfs_getxattr_lower(ecryptfs_dentry_to_lower(dentry), in ecryptfs_read_and_validate_xattr_region()
1376 if (rc < 0) in ecryptfs_read_and_validate_xattr_region()
1377 return rc; in ecryptfs_read_and_validate_xattr_region()
1378 else if (rc < ECRYPTFS_SIZE_AND_MARKER_BYTES) in ecryptfs_read_and_validate_xattr_region()
1380 rc = ecryptfs_validate_marker(marker); in ecryptfs_read_and_validate_xattr_region()
1381 if (!rc) in ecryptfs_read_and_validate_xattr_region()
1383 return rc; in ecryptfs_read_and_validate_xattr_region()
1400 int rc; in ecryptfs_read_metadata() local
1414 rc = -ENOMEM; in ecryptfs_read_metadata()
1417 rc = ecryptfs_read_lower(page_virt, 0, crypt_stat->extent_size, in ecryptfs_read_metadata()
1419 if (rc >= 0) in ecryptfs_read_metadata()
1420 rc = ecryptfs_read_headers_virt(page_virt, crypt_stat, in ecryptfs_read_metadata()
1423 if (rc) { in ecryptfs_read_metadata()
1426 rc = ecryptfs_read_xattr_region(page_virt, ecryptfs_inode); in ecryptfs_read_metadata()
1427 if (rc) { in ecryptfs_read_metadata()
1431 rc = -EINVAL; in ecryptfs_read_metadata()
1434 rc = ecryptfs_read_headers_virt(page_virt, crypt_stat, in ecryptfs_read_metadata()
1437 if (rc) { in ecryptfs_read_metadata()
1441 rc = -EINVAL; in ecryptfs_read_metadata()
1453 rc = -EINVAL; in ecryptfs_read_metadata()
1461 return rc; in ecryptfs_read_metadata()
1477 int rc = 0; in ecryptfs_encrypt_filename() local
1486 rc = ecryptfs_write_tag_70_packet( in ecryptfs_encrypt_filename()
1491 if (rc) { in ecryptfs_encrypt_filename()
1494 rc); in ecryptfs_encrypt_filename()
1501 rc = -ENOMEM; in ecryptfs_encrypt_filename()
1505 rc = ecryptfs_write_tag_70_packet(filename->encrypted_filename, in ecryptfs_encrypt_filename()
1511 if (rc) { in ecryptfs_encrypt_filename()
1514 rc); in ecryptfs_encrypt_filename()
1524 rc = -EOPNOTSUPP; in ecryptfs_encrypt_filename()
1528 return rc; in ecryptfs_encrypt_filename()
1534 int rc = 0; in ecryptfs_copy_filename() local
1538 rc = -ENOMEM; in ecryptfs_copy_filename()
1548 return rc; in ecryptfs_copy_filename()
1567 int rc; in ecryptfs_process_key_cipher() local
1571 rc = -EINVAL; in ecryptfs_process_key_cipher()
1576 rc = ecryptfs_crypto_api_algify_cipher_name(&full_alg_name, cipher_name, in ecryptfs_process_key_cipher()
1578 if (rc) in ecryptfs_process_key_cipher()
1582 rc = PTR_ERR(*key_tfm); in ecryptfs_process_key_cipher()
1584 "[%s]; rc = [%d]\n", full_alg_name, rc); in ecryptfs_process_key_cipher()
1591 rc = crypto_skcipher_setkey(*key_tfm, dummy_key, *key_size); in ecryptfs_process_key_cipher()
1592 if (rc) { in ecryptfs_process_key_cipher()
1595 rc); in ecryptfs_process_key_cipher()
1596 rc = -EINVAL; in ecryptfs_process_key_cipher()
1601 return rc; in ecryptfs_process_key_cipher()
1640 int rc = 0; in ecryptfs_add_new_key_tfm() local
1648 rc = -ENOMEM; in ecryptfs_add_new_key_tfm()
1656 rc = ecryptfs_process_key_cipher(&tmp_tfm->key_tfm, in ecryptfs_add_new_key_tfm()
1659 if (rc) { in ecryptfs_add_new_key_tfm()
1662 tmp_tfm->cipher_name, rc); in ecryptfs_add_new_key_tfm()
1670 return rc; in ecryptfs_add_new_key_tfm()
1717 int rc = 0; in ecryptfs_get_tfm_and_mutex_for_cipher_name() local
1724 rc = ecryptfs_add_new_key_tfm(&key_tfm, cipher_name, 0); in ecryptfs_get_tfm_and_mutex_for_cipher_name()
1725 if (rc) { in ecryptfs_get_tfm_and_mutex_for_cipher_name()
1727 "rc = [%d]\n", rc); in ecryptfs_get_tfm_and_mutex_for_cipher_name()
1735 return rc; in ecryptfs_get_tfm_and_mutex_for_cipher_name()
1913 int rc = 0; in ecryptfs_encrypt_and_encode_filename() local
1923 rc = -ENOMEM; in ecryptfs_encrypt_and_encode_filename()
1928 rc = ecryptfs_encrypt_filename(filename, mount_crypt_stat); in ecryptfs_encrypt_and_encode_filename()
1929 if (rc) { in ecryptfs_encrypt_and_encode_filename()
1931 "filename; rc = [%d]\n", __func__, rc); in ecryptfs_encrypt_and_encode_filename()
1951 rc = -ENOMEM; in ecryptfs_encrypt_and_encode_filename()
1973 rc = -EOPNOTSUPP; in ecryptfs_encrypt_and_encode_filename()
1975 if (rc) { in ecryptfs_encrypt_and_encode_filename()
1978 rc); in ecryptfs_encrypt_and_encode_filename()
1986 rc = ecryptfs_copy_filename(encoded_name, in ecryptfs_encrypt_and_encode_filename()
1991 return rc; in ecryptfs_encrypt_and_encode_filename()
2026 int rc = 0; in ecryptfs_decode_and_decrypt_filename() local
2031 rc = ecryptfs_copy_filename(plaintext_name, in ecryptfs_decode_and_decrypt_filename()
2040 rc = -EINVAL; in ecryptfs_decode_and_decrypt_filename()
2050 rc = -ENOMEM; in ecryptfs_decode_and_decrypt_filename()
2055 rc = ecryptfs_parse_tag_70_packet(plaintext_name, in ecryptfs_decode_and_decrypt_filename()
2061 if (rc) { in ecryptfs_decode_and_decrypt_filename()
2068 rc = ecryptfs_copy_filename(plaintext_name, in ecryptfs_decode_and_decrypt_filename()
2076 return rc; in ecryptfs_decode_and_decrypt_filename()
2087 int rc; in ecryptfs_set_f_namelen() local
2094 rc = ecryptfs_get_tfm_and_mutex_for_cipher_name(&tfm, &tfm_mutex, in ecryptfs_set_f_namelen()
2096 if (unlikely(rc)) { in ecryptfs_set_f_namelen()
2098 return rc; in ecryptfs_set_f_namelen()