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",
}
struct sd_node {
- int32_t security_id;
+ s32 security_id;
u8 hash[SHA1_HASH_SIZE];
struct avl_tree_node index_node;
};
/* 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;
* 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;