crypto.c (cb5629b10d64a8006622ce3a52bc887d91057d69) crypto.c (fd9fc842bbab0cb5560b0d52ce4598c898707863)
1/**
2 * eCryptfs: Linux filesystem encryption layer
3 *
4 * Copyright (C) 1997-2004 Erez Zadok
5 * Copyright (C) 2001-2004 Stony Brook University
6 * Copyright (C) 2004-2007 International Business Machines Corp.
7 * Author(s): Michael A. Halcrow <mahalcro@us.ibm.com>
8 * Michael C. Thompson <mcthomps@us.ibm.com>

--- 1702 unchanged lines hidden (view full) ---

1711 return rc;
1712}
1713
1714static int ecryptfs_copy_filename(char **copied_name, size_t *copied_name_size,
1715 const char *name, size_t name_size)
1716{
1717 int rc = 0;
1718
1/**
2 * eCryptfs: Linux filesystem encryption layer
3 *
4 * Copyright (C) 1997-2004 Erez Zadok
5 * Copyright (C) 2001-2004 Stony Brook University
6 * Copyright (C) 2004-2007 International Business Machines Corp.
7 * Author(s): Michael A. Halcrow <mahalcro@us.ibm.com>
8 * Michael C. Thompson <mcthomps@us.ibm.com>

--- 1702 unchanged lines hidden (view full) ---

1711 return rc;
1712}
1713
1714static int ecryptfs_copy_filename(char **copied_name, size_t *copied_name_size,
1715 const char *name, size_t name_size)
1716{
1717 int rc = 0;
1718
1719 (*copied_name) = kmalloc((name_size + 2), GFP_KERNEL);
1719 (*copied_name) = kmalloc((name_size + 1), GFP_KERNEL);
1720 if (!(*copied_name)) {
1721 rc = -ENOMEM;
1722 goto out;
1723 }
1724 memcpy((void *)(*copied_name), (void *)name, name_size);
1725 (*copied_name)[(name_size)] = '\0'; /* Only for convenience
1726 * in printing out the
1727 * string in debug
1728 * messages */
1720 if (!(*copied_name)) {
1721 rc = -ENOMEM;
1722 goto out;
1723 }
1724 memcpy((void *)(*copied_name), (void *)name, name_size);
1725 (*copied_name)[(name_size)] = '\0'; /* Only for convenience
1726 * in printing out the
1727 * string in debug
1728 * messages */
1729 (*copied_name_size) = (name_size + 1);
1729 (*copied_name_size) = name_size;
1730out:
1731 return rc;
1732}
1733
1734/**
1735 * ecryptfs_process_key_cipher - Perform key cipher initialization.
1736 * @key_tfm: Crypto context for key material, set by this function
1737 * @cipher_name: Name of the cipher

--- 525 unchanged lines hidden ---
1730out:
1731 return rc;
1732}
1733
1734/**
1735 * ecryptfs_process_key_cipher - Perform key cipher initialization.
1736 * @key_tfm: Crypto context for key material, set by this function
1737 * @cipher_name: Name of the cipher

--- 525 unchanged lines hidden ---