Lines Matching refs:digest
101 void hidden digest_gen_hash(struct selabel_digest *digest) in digest_gen_hash() argument
106 if (!digest) in digest_gen_hash()
110 Sha1Update(&context, digest->hashbuf, digest->hashbuf_size); in digest_gen_hash()
111 Sha1Finalise(&context, (SHA1_HASH *)digest->digest); in digest_gen_hash()
112 free(digest->hashbuf); in digest_gen_hash()
113 digest->hashbuf = NULL; in digest_gen_hash()
129 int hidden digest_add_specfile(struct selabel_digest *digest, FILE *fp, in digest_add_specfile() argument
136 if (!digest) in digest_add_specfile()
139 if (digest->hashbuf_size + buf_len < digest->hashbuf_size) { in digest_add_specfile()
143 digest->hashbuf_size += buf_len; in digest_add_specfile()
145 tmp_buf = realloc(digest->hashbuf, digest->hashbuf_size); in digest_add_specfile()
149 digest->hashbuf = tmp_buf; in digest_add_specfile()
153 if (fread(digest->hashbuf + (digest->hashbuf_size - buf_len), in digest_add_specfile()
159 tmp_buf = memcpy(digest->hashbuf + in digest_add_specfile()
160 (digest->hashbuf_size - buf_len), in digest_add_specfile()
166 digest->specfile_list[digest->specfile_cnt] = strdup(path); in digest_add_specfile()
167 if (!digest->specfile_list[digest->specfile_cnt]) in digest_add_specfile()
170 digest->specfile_cnt++; in digest_add_specfile()
171 if (digest->specfile_cnt > DIGEST_FILES_MAX) { in digest_add_specfile()