X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=include%2Fwimlib%2Fsecurity.h;h=002aef4cc36d16f7b829882bc21fa8da51db99d1;hb=aa3a2830cd4154238bc6a342ffea43d9ac69a14c;hp=2f51560ffe0a749a4a98010466d4231951f26fdb;hpb=4d9794d1f1a6044c261faae0968af1b2c0480f4b;p=wimlib diff --git a/include/wimlib/security.h b/include/wimlib/security.h index 2f51560f..002aef4c 100644 --- a/include/wimlib/security.h +++ b/include/wimlib/security.h @@ -1,15 +1,17 @@ #ifndef _WIMLIB_SECURITY_H #define _WIMLIB_SECURITY_H -#include "wimlib/rbtree.h" #include "wimlib/types.h" -/* Red-black tree that maps SHA1 message digests of security descriptors to - * security IDs, which are themselves indices into the table of security - * descriptors in the 'struct wim_security_data'. */ +struct wim_security_data; +struct avl_tree_node; + +/* Map from SHA1 message digests of security descriptors to security IDs, which + * are themselves indices into the table of security descriptors in the 'struct + * wim_security_data'. */ struct wim_sd_set { struct wim_security_data *sd; - struct rb_root rb_root; + struct avl_tree_node *root; int32_t orig_num_entries; }; @@ -26,7 +28,7 @@ struct wim_security_data { /* Array of sizes of the descriptors, in bytes, in the array * @descriptors. */ - size_t *sizes; + u64 *sizes; /* Array of pointers to the security descriptors in the * SECURITY_DESCRIPTOR_RELATIVE format. */ @@ -34,12 +36,12 @@ struct wim_security_data { }; extern void -destroy_sd_set(struct wim_sd_set *sd_set, bool rollback); +rollback_new_security_descriptors(struct wim_sd_set *sd_set); -extern int -lookup_sd(struct wim_sd_set *set, const u8 hash[]); +extern void +destroy_sd_set(struct wim_sd_set *sd_set); -extern int +extern int32_t sd_set_add_sd(struct wim_sd_set *sd_set, const char descriptor[], size_t size); @@ -50,12 +52,12 @@ extern struct wim_security_data * new_wim_security_data(void); extern int -read_wim_security_data(const u8 metadata_resource[], size_t - metadata_resource_len, struct wim_security_data **sd_p); +read_wim_security_data(const u8 *buf, size_t buf_len, + struct wim_security_data **sd_ret); extern u8 * -write_wim_security_data(const struct wim_security_data * restrict sd, u8 * - restrict p); +write_wim_security_data(const struct wim_security_data * restrict sd, + u8 * restrict p); extern void print_wim_security_data(const struct wim_security_data *sd);