Lines Matching refs:cprotect

28 #include <sys/cprotect.h>
55 static int cp_getxattr(cnode_t *, struct hfsmount *hfsmp, struct cprotect **);
56 static struct cprotect *cp_entry_alloc(size_t);
57 static void cp_entry_dealloc(struct cprotect *entry);
58 static int cp_restore_keys(struct cprotect *, struct hfsmount *hfsmp, struct cnode *);
63 static int cp_new(int newclass, struct hfsmount *hfsmp, struct cnode *cp, mode_t cmode, struct cprotect **output_entry);
65 static int cp_unwrap(struct hfsmount *, struct cprotect *, struct cnode *);
66 static int cp_setup_aes_ctx(struct cprotect *entry);
121 * Allocate and initialize a cprotect blob for a new cnode.
125 * unwrap the file key and cache it in the cprotect blob.
130 struct cprotect *entry = NULL;
202 * c) we failed to generate a new cprotect data structure.
227 * Generate a keyless cprotect structure for use with the new AppleKeyStore kext.
237 mode_t cmode, struct cprotect **tmpentry)
240 struct cprotect *entry = NULL;
297 /* Generate the cprotect to vend out */
345 * Set up an initial key/class pair for a disassociated cprotect entry.
349 * a cnode directly, we take a pointer to the cprotect struct.
355 int cp_entry_gentempkeys(struct cprotect **entry_ptr, struct hfsmount *hfsmp)
358 struct cprotect *entry = NULL;
390 * Tear down and clear a cprotect blob for a closing file.
394 cp_entry_destroy(struct cprotect *entry_ptr)
438 struct cprotect *entry;
507 struct cprotect *entry = 0;
598 struct cprotect *newentry = NULL;
627 * We get here if the new class was F, or if we were re-wrapping a cprotect that already
649 struct cprotect *entry = 0;
744 * Takes cnode lock, and upgrades to exclusive if modifying cprotect.
756 struct cprotect *entry;
801 * All files should have cprotect structs. It's possible to encounter
853 struct cprotect *newentry = NULL;
893 struct cprotect *entry = NULL;
918 * If the mount is protected and we couldn't get a cprotect for this vnode,
934 struct cprotect *newentry = NULL;
1037 struct cprotect *entry;
1163 int cp_setxattr(struct cnode *cp, struct cprotect *entry, struct hfsmount *hfsmp, uint32_t fileid, int options)
1369 static struct cprotect *
1372 struct cprotect *cp_entry;
1377 MALLOC(cp_entry, struct cprotect *, sizeof(struct cprotect) + keylen,
1388 cp_entry_dealloc(struct cprotect *entry)
1397 * Initializes a new cprotect entry with xattr data from the cnode.
1401 cp_getxattr(struct cnode *cp, struct hfsmount *hfsmp, struct cprotect **outentry)
1408 struct cprotect *entry = NULL;
1587 cp_restore_keys(struct cprotect *entry, struct hfsmount *hfsmp, struct cnode *cp)
1624 * We respond only to lock events. Since cprotect structs
1680 struct cprotect *entry = NULL;
1796 struct cprotect *entry = cp->c_cpentry;
1841 struct cprotect *newentry = NULL;
1852 bcopy (entry, newentry, sizeof(struct cprotect));
1875 cp_unwrap(struct hfsmount *hfsmp, struct cprotect *entry, struct cnode *cp)
1925 cp_setup_aes_ctx(struct cprotect *entry)
1949 int cp_generate_keys (struct hfsmount *hfsmp, struct cnode *cp, int targetclass, struct cprotect **newentry)
1953 struct cprotect *newcp = NULL;
1956 /* Validate that it has a cprotect already */
1962 /* Asserts for the underlying cprotect */
1988 * If we got here, then we have a new cprotect.
1994 /* Tear down the new cprotect; Tell MKB that it's invalid. Bail out */
2006 * 3) cprotect is ready to go.
2017 void cp_replace_entry (struct cnode *cp, struct cprotect *newentry)
2033 * Given a double-pointer to a cprotect, generate keys (either in-kernel or from keystore),
2034 * allocate a cprotect, and vend it back to the caller.
2036 * Additionally, decide if keys are even needed -- directories get cprotect data structures
2042 cp_new(int newclass, struct hfsmount *hfsmp, struct cnode *cp, mode_t cmode, struct cprotect **output_entry)
2044 struct cprotect *entry = NULL;
2132 * Step 2: Allocate cprotect and initialize it.