1 #ifndef _WIMLIB_SECURITY_H
2 #define _WIMLIB_SECURITY_H
4 #include "wimlib/rbtree.h"
5 #include "wimlib/types.h"
7 /* Red-black tree that maps SHA1 message digests of security descriptors to
8 * security IDs, which are themselves indices into the table of security
9 * descriptors in the 'struct wim_security_data'. */
11 struct wim_security_data *sd;
12 struct rb_root rb_root;
13 int32_t orig_num_entries;
16 /* Table of security descriptors for a WIM image. */
17 struct wim_security_data {
18 /* The total length of the security data, in bytes. If there are no
19 * security descriptors, this field, when read from the on-disk metadata
20 * resource, may be either 8 (which is correct) or 0 (which is
21 * interpreted as 8). */
24 /* The number of security descriptors in the array @descriptors. */
27 /* Array of sizes of the descriptors, in bytes, in the array
31 /* Array of pointers to the security descriptors in the
32 * SECURITY_DESCRIPTOR_RELATIVE format. */
37 destroy_sd_set(struct wim_sd_set *sd_set, bool rollback);
40 lookup_sd(struct wim_sd_set *set, const u8 hash[]);
43 sd_set_add_sd(struct wim_sd_set *sd_set, const char descriptor[],
47 init_sd_set(struct wim_sd_set *sd_set, struct wim_security_data *sd);
49 extern struct wim_security_data *
50 new_wim_security_data(void);
53 read_wim_security_data(const u8 metadata_resource[], size_t
54 metadata_resource_len, struct wim_security_data **sd_p);
57 write_wim_security_data(const struct wim_security_data * restrict sd, u8 *
61 print_wim_security_data(const struct wim_security_data *sd);
64 free_wim_security_data(struct wim_security_data *sd);
66 #endif /* _WIMLIB_SECURITY_H */