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()
316 int rc; member
319 static void extent_crypt_complete(struct crypto_async_request *req, int rc) in extent_crypt_complete() argument
323 if (rc == -EINPROGRESS) in extent_crypt_complete()
326 ecr->rc = rc; in extent_crypt_complete()
348 int rc = 0; in crypt_scatterlist() local
365 rc = -ENOMEM; in crypt_scatterlist()
374 rc = crypto_ablkcipher_setkey(crypt_stat->tfm, crypt_stat->key, in crypt_scatterlist()
376 if (rc) { in crypt_scatterlist()
379 rc); in crypt_scatterlist()
381 rc = -EINVAL; in crypt_scatterlist()
388 rc = op == ENCRYPT ? crypto_ablkcipher_encrypt(req) : in crypt_scatterlist()
390 if (rc == -EINPROGRESS || rc == -EBUSY) { in crypt_scatterlist()
394 rc = ecr->rc; in crypt_scatterlist()
399 return rc; in crypt_scatterlist()
437 int rc; in crypt_extent() local
440 rc = ecryptfs_derive_iv(extent_iv, crypt_stat, in crypt_extent()
442 if (rc) { in crypt_extent()
445 (unsigned long long)(extent_base + extent_offset), rc); in crypt_extent()
457 rc = crypt_scatterlist(crypt_stat, &dst_sg, &src_sg, extent_size, in crypt_extent()
459 if (rc < 0) { in crypt_extent()
462 "rc = [%d]\n", __func__, page_index, extent_offset, rc); in crypt_extent()
465 rc = 0; in crypt_extent()
467 return rc; in crypt_extent()
494 int rc = 0; in ecryptfs_encrypt_page() local
502 rc = -ENOMEM; in ecryptfs_encrypt_page()
511 rc = crypt_extent(crypt_stat, enc_extent_page, page, in ecryptfs_encrypt_page()
513 if (rc) { in ecryptfs_encrypt_page()
515 "rc = [%d]\n", __func__, rc); in ecryptfs_encrypt_page()
522 rc = ecryptfs_write_lower(ecryptfs_inode, enc_extent_virt, lower_offset, in ecryptfs_encrypt_page()
525 if (rc < 0) { in ecryptfs_encrypt_page()
528 rc); in ecryptfs_encrypt_page()
531 rc = 0; in ecryptfs_encrypt_page()
536 return rc; in ecryptfs_encrypt_page()
562 int rc = 0; in ecryptfs_decrypt_page() local
571 rc = ecryptfs_read_lower(page_virt, lower_offset, PAGE_CACHE_SIZE, in ecryptfs_decrypt_page()
574 if (rc < 0) { in ecryptfs_decrypt_page()
577 rc); in ecryptfs_decrypt_page()
584 rc = crypt_extent(crypt_stat, page, page, in ecryptfs_decrypt_page()
586 if (rc) { in ecryptfs_decrypt_page()
588 "rc = [%d]\n", __func__, rc); in ecryptfs_decrypt_page()
593 return rc; in ecryptfs_decrypt_page()
610 int rc = -EINVAL; in ecryptfs_init_crypt_ctx() local
619 rc = 0; in ecryptfs_init_crypt_ctx()
622 rc = ecryptfs_crypto_api_algify_cipher_name(&full_alg_name, in ecryptfs_init_crypt_ctx()
624 if (rc) in ecryptfs_init_crypt_ctx()
628 rc = PTR_ERR(crypt_stat->tfm); in ecryptfs_init_crypt_ctx()
636 rc = 0; in ecryptfs_init_crypt_ctx()
641 return rc; in ecryptfs_init_crypt_ctx()
686 int rc = 0; in ecryptfs_compute_root_iv() local
692 rc = -EINVAL; in ecryptfs_compute_root_iv()
697 rc = ecryptfs_calculate_md5(dst, crypt_stat, crypt_stat->key, in ecryptfs_compute_root_iv()
699 if (rc) { in ecryptfs_compute_root_iv()
706 if (rc) { in ecryptfs_compute_root_iv()
710 return rc; in ecryptfs_compute_root_iv()
757 int rc = 0; in ecryptfs_copy_mount_wide_sigs_to_inode_sigs() local
767 rc = ecryptfs_add_keysig(crypt_stat, global_auth_tok->sig); in ecryptfs_copy_mount_wide_sigs_to_inode_sigs()
768 if (rc) { in ecryptfs_copy_mount_wide_sigs_to_inode_sigs()
769 printk(KERN_ERR "Error adding keysig; rc = [%d]\n", rc); in ecryptfs_copy_mount_wide_sigs_to_inode_sigs()
777 return rc; in ecryptfs_copy_mount_wide_sigs_to_inode_sigs()
828 int rc = 0; in ecryptfs_new_file_context() local
834 rc = ecryptfs_copy_mount_wide_sigs_to_inode_sigs(crypt_stat, in ecryptfs_new_file_context()
836 if (rc) { in ecryptfs_new_file_context()
838 "to the inode key sigs; rc = [%d]\n", rc); in ecryptfs_new_file_context()
850 rc = ecryptfs_init_crypt_ctx(crypt_stat); in ecryptfs_new_file_context()
851 if (rc) in ecryptfs_new_file_context()
854 crypt_stat->cipher, rc); in ecryptfs_new_file_context()
856 return rc; in ecryptfs_new_file_context()
905 int rc = 0; in ecryptfs_process_flags() local
919 return rc; in ecryptfs_process_flags()
1022 int rc = 0; in ecryptfs_cipher_code_to_string() local
1032 rc = -EINVAL; in ecryptfs_cipher_code_to_string()
1034 return rc; in ecryptfs_cipher_code_to_string()
1041 int rc; in ecryptfs_read_and_validate_header_region() local
1043 rc = ecryptfs_read_lower(file_size, 0, ECRYPTFS_SIZE_AND_MARKER_BYTES, in ecryptfs_read_and_validate_header_region()
1045 if (rc < ECRYPTFS_SIZE_AND_MARKER_BYTES) in ecryptfs_read_and_validate_header_region()
1046 return rc >= 0 ? -EINVAL : rc; in ecryptfs_read_and_validate_header_region()
1047 rc = ecryptfs_validate_marker(marker); in ecryptfs_read_and_validate_header_region()
1048 if (!rc) in ecryptfs_read_and_validate_header_region()
1050 return rc; in ecryptfs_read_and_validate_header_region()
1108 int rc; in ecryptfs_write_headers_virt() local
1121 rc = ecryptfs_generate_key_packet_set((page_virt + offset), crypt_stat, in ecryptfs_write_headers_virt()
1124 if (rc) in ecryptfs_write_headers_virt()
1126 "set; rc = [%d]\n", rc); in ecryptfs_write_headers_virt()
1131 return rc; in ecryptfs_write_headers_virt()
1138 int rc; in ecryptfs_write_metadata_to_contents() local
1140 rc = ecryptfs_write_lower(ecryptfs_inode, virt, in ecryptfs_write_metadata_to_contents()
1142 if (rc < 0) in ecryptfs_write_metadata_to_contents()
1144 "information to lower file; rc = [%d]\n", __func__, rc); in ecryptfs_write_metadata_to_contents()
1146 rc = 0; in ecryptfs_write_metadata_to_contents()
1147 return rc; in ecryptfs_write_metadata_to_contents()
1154 int rc; in ecryptfs_write_metadata_to_xattr() local
1156 rc = ecryptfs_setxattr(ecryptfs_dentry, ECRYPTFS_XATTR_NAME, page_virt, in ecryptfs_write_metadata_to_xattr()
1158 return rc; in ecryptfs_write_metadata_to_xattr()
1194 int rc = 0; in ecryptfs_write_metadata() local
1199 rc = -EINVAL; in ecryptfs_write_metadata()
1205 rc = -EINVAL; in ecryptfs_write_metadata()
1214 rc = -ENOMEM; in ecryptfs_write_metadata()
1218 rc = ecryptfs_write_headers_virt(virt, virt_len, &size, crypt_stat, in ecryptfs_write_metadata()
1220 if (unlikely(rc)) { in ecryptfs_write_metadata()
1222 __func__, rc); in ecryptfs_write_metadata()
1226 rc = ecryptfs_write_metadata_to_xattr(ecryptfs_dentry, virt, in ecryptfs_write_metadata()
1229 rc = ecryptfs_write_metadata_to_contents(ecryptfs_inode, virt, in ecryptfs_write_metadata()
1231 if (rc) { in ecryptfs_write_metadata()
1233 "rc = [%d]\n", __func__, rc); in ecryptfs_write_metadata()
1239 return rc; in ecryptfs_write_metadata()
1248 int rc = 0; in parse_header_metadata() local
1261 rc = -EINVAL; in parse_header_metadata()
1265 return rc; in parse_header_metadata()
1317 int rc = 0; in ecryptfs_read_headers_virt() local
1325 rc = ecryptfs_validate_marker(page_virt + offset); in ecryptfs_read_headers_virt()
1326 if (rc) in ecryptfs_read_headers_virt()
1331 rc = ecryptfs_process_flags(crypt_stat, (page_virt + offset), in ecryptfs_read_headers_virt()
1333 if (rc) { in ecryptfs_read_headers_virt()
1343 rc = -EINVAL; in ecryptfs_read_headers_virt()
1348 rc = parse_header_metadata(crypt_stat, (page_virt + offset), in ecryptfs_read_headers_virt()
1350 if (rc) { in ecryptfs_read_headers_virt()
1352 "metadata; rc = [%d]\n", rc); in ecryptfs_read_headers_virt()
1357 rc = ecryptfs_parse_packet_set(crypt_stat, (page_virt + offset), in ecryptfs_read_headers_virt()
1360 return rc; in ecryptfs_read_headers_virt()
1378 int rc = 0; in ecryptfs_read_xattr_region() local
1387 rc = -EINVAL; in ecryptfs_read_xattr_region()
1391 return rc; in ecryptfs_read_xattr_region()
1399 int rc; in ecryptfs_read_and_validate_xattr_region() local
1401 rc = ecryptfs_getxattr_lower(ecryptfs_dentry_to_lower(dentry), in ecryptfs_read_and_validate_xattr_region()
1404 if (rc < ECRYPTFS_SIZE_AND_MARKER_BYTES) in ecryptfs_read_and_validate_xattr_region()
1405 return rc >= 0 ? -EINVAL : rc; in ecryptfs_read_and_validate_xattr_region()
1406 rc = ecryptfs_validate_marker(marker); in ecryptfs_read_and_validate_xattr_region()
1407 if (!rc) in ecryptfs_read_and_validate_xattr_region()
1409 return rc; in ecryptfs_read_and_validate_xattr_region()
1426 int rc; in ecryptfs_read_metadata() local
1440 rc = -ENOMEM; in ecryptfs_read_metadata()
1445 rc = ecryptfs_read_lower(page_virt, 0, crypt_stat->extent_size, in ecryptfs_read_metadata()
1447 if (rc >= 0) in ecryptfs_read_metadata()
1448 rc = ecryptfs_read_headers_virt(page_virt, crypt_stat, in ecryptfs_read_metadata()
1451 if (rc) { in ecryptfs_read_metadata()
1454 rc = ecryptfs_read_xattr_region(page_virt, ecryptfs_inode); in ecryptfs_read_metadata()
1455 if (rc) { in ecryptfs_read_metadata()
1459 rc = -EINVAL; in ecryptfs_read_metadata()
1462 rc = ecryptfs_read_headers_virt(page_virt, crypt_stat, in ecryptfs_read_metadata()
1465 if (rc) { in ecryptfs_read_metadata()
1469 rc = -EINVAL; in ecryptfs_read_metadata()
1481 rc = -EINVAL; in ecryptfs_read_metadata()
1489 return rc; in ecryptfs_read_metadata()
1506 int rc = 0; in ecryptfs_encrypt_filename() local
1516 rc = ecryptfs_write_tag_70_packet( in ecryptfs_encrypt_filename()
1521 if (rc) { in ecryptfs_encrypt_filename()
1524 rc); in ecryptfs_encrypt_filename()
1534 rc = -ENOMEM; in ecryptfs_encrypt_filename()
1538 rc = ecryptfs_write_tag_70_packet(filename->encrypted_filename, in ecryptfs_encrypt_filename()
1544 if (rc) { in ecryptfs_encrypt_filename()
1547 rc); in ecryptfs_encrypt_filename()
1557 rc = -EOPNOTSUPP; in ecryptfs_encrypt_filename()
1561 return rc; in ecryptfs_encrypt_filename()
1567 int rc = 0; in ecryptfs_copy_filename() local
1571 rc = -ENOMEM; in ecryptfs_copy_filename()
1581 return rc; in ecryptfs_copy_filename()
1600 int rc; in ecryptfs_process_key_cipher() local
1604 rc = -EINVAL; in ecryptfs_process_key_cipher()
1609 rc = ecryptfs_crypto_api_algify_cipher_name(&full_alg_name, cipher_name, in ecryptfs_process_key_cipher()
1611 if (rc) in ecryptfs_process_key_cipher()
1615 rc = PTR_ERR(*key_tfm); in ecryptfs_process_key_cipher()
1617 "[%s]; rc = [%d]\n", full_alg_name, rc); in ecryptfs_process_key_cipher()
1627 rc = crypto_blkcipher_setkey(*key_tfm, dummy_key, *key_size); in ecryptfs_process_key_cipher()
1628 if (rc) { in ecryptfs_process_key_cipher()
1631 rc); in ecryptfs_process_key_cipher()
1632 rc = -EINVAL; in ecryptfs_process_key_cipher()
1637 return rc; in ecryptfs_process_key_cipher()
1677 int rc = 0; in ecryptfs_add_new_key_tfm() local
1685 rc = -ENOMEM; in ecryptfs_add_new_key_tfm()
1695 rc = ecryptfs_process_key_cipher(&tmp_tfm->key_tfm, in ecryptfs_add_new_key_tfm()
1698 if (rc) { in ecryptfs_add_new_key_tfm()
1701 tmp_tfm->cipher_name, rc); in ecryptfs_add_new_key_tfm()
1709 return rc; in ecryptfs_add_new_key_tfm()
1756 int rc = 0; in ecryptfs_get_tfm_and_mutex_for_cipher_name() local
1763 rc = ecryptfs_add_new_key_tfm(&key_tfm, cipher_name, 0); in ecryptfs_get_tfm_and_mutex_for_cipher_name()
1764 if (rc) { in ecryptfs_get_tfm_and_mutex_for_cipher_name()
1766 "rc = [%d]\n", rc); in ecryptfs_get_tfm_and_mutex_for_cipher_name()
1774 return rc; in ecryptfs_get_tfm_and_mutex_for_cipher_name()
1953 int rc = 0; in ecryptfs_encrypt_and_encode_filename() local
1967 rc = -ENOMEM; in ecryptfs_encrypt_and_encode_filename()
1972 rc = ecryptfs_encrypt_filename(filename, crypt_stat, in ecryptfs_encrypt_and_encode_filename()
1974 if (rc) { in ecryptfs_encrypt_and_encode_filename()
1976 "filename; rc = [%d]\n", __func__, rc); in ecryptfs_encrypt_and_encode_filename()
2001 rc = -ENOMEM; in ecryptfs_encrypt_and_encode_filename()
2025 rc = -EOPNOTSUPP; in ecryptfs_encrypt_and_encode_filename()
2027 if (rc) { in ecryptfs_encrypt_and_encode_filename()
2030 rc); in ecryptfs_encrypt_and_encode_filename()
2038 rc = ecryptfs_copy_filename(encoded_name, in ecryptfs_encrypt_and_encode_filename()
2043 return rc; in ecryptfs_encrypt_and_encode_filename()
2068 int rc = 0; in ecryptfs_decode_and_decrypt_filename() local
2087 rc = -ENOMEM; in ecryptfs_decode_and_decrypt_filename()
2092 rc = ecryptfs_parse_tag_70_packet(plaintext_name, in ecryptfs_decode_and_decrypt_filename()
2098 if (rc) { in ecryptfs_decode_and_decrypt_filename()
2102 rc = ecryptfs_copy_filename(plaintext_name, in ecryptfs_decode_and_decrypt_filename()
2108 rc = ecryptfs_copy_filename(plaintext_name, in ecryptfs_decode_and_decrypt_filename()
2116 return rc; in ecryptfs_decode_and_decrypt_filename()
2127 int rc; in ecryptfs_set_f_namelen() local
2134 rc = ecryptfs_get_tfm_and_mutex_for_cipher_name(&desc.tfm, &tfm_mutex, in ecryptfs_set_f_namelen()
2136 if (unlikely(rc)) { in ecryptfs_set_f_namelen()
2138 return rc; in ecryptfs_set_f_namelen()