X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=src%2Fsecurity.c;h=f160d683f6cbf4755bc92f8ef28b96fa9f8dfcb4;hb=26a90546f2a8ded51376d631e5a13f3d7a84f8dc;hp=a17b889c661022f78b0f0465ea1cfd72a7628be1;hpb=3071e89c11d1be71cf45b694432e5908e0c4ded9;p=wimlib diff --git a/src/security.c b/src/security.c index a17b889c..f160d683 100644 --- a/src/security.c +++ b/src/security.c @@ -157,8 +157,8 @@ read_wim_security_data(const u8 *buf, size_t buf_len, p += sd->sizes[i]; } out_align_total_length: - total_len = (total_len + 7) & ~7; - sd->total_length = (sd->total_length + 7) & ~7; + total_len = ALIGN(total_len, 8); + sd->total_length = ALIGN(sd->total_length, 8); if (total_len != sd->total_length) { WARNING("Expected WIM security data total length of " "%u bytes, but calculated %u bytes", @@ -230,7 +230,7 @@ free_wim_security_data(struct wim_security_data *sd) } struct sd_node { - int32_t security_id; + s32 security_id; u8 hash[SHA1_HASH_SIZE]; struct avl_tree_node index_node; }; @@ -284,7 +284,7 @@ insert_sd_node(struct wim_sd_set *set, struct sd_node *new) /* Returns the index of the security descriptor having a SHA1 message digest of * @hash. If not found, return -1. */ -static int32_t +static s32 lookup_sd(struct wim_sd_set *set, const u8 hash[SHA1_HASH_SIZE]) { struct avl_tree_node *res; @@ -305,11 +305,11 @@ lookup_sd(struct wim_sd_set *set, const u8 hash[SHA1_HASH_SIZE]) * the security ID for it. If a new security descriptor cannot be allocated, * return -1. */ -int32_t +s32 sd_set_add_sd(struct wim_sd_set *sd_set, const char *descriptor, size_t size) { u8 hash[SHA1_HASH_SIZE]; - int32_t security_id; + s32 security_id; struct sd_node *new; u8 **descriptors; u64 *sizes;