Lines Matching refs:hash
70 /* this struct defines a hash algorithm */
81 int exit_on_error; /* exit if we can't create a hash */
91 /* this struct describes a directory entry to generate a hash for */
94 char *hash_val; /* its associated hash value */
100 /* define the possible hash algorithms */
157 /* find a hash algorithm, given its name */
161 hash_t *hash;
163 for (hash = hashes; hash->hashname != NULL; hash++)
164 if (strcasecmp(hash_type, hash->hashname) == 0)
165 return hash;
206 add_new_path_entry(veriexecgen_t *vp, const char *file, hash_t *hash)
229 if ((e->hash_val = do_hash(e->filename, hash)) == NULL) {
230 gripe(vp, "Cannot calculate hash `%s'", e->filename);
240 add_new_ftsent_entry(veriexecgen_t *vp, FTSENT *file, hash_t *hash)
267 if ((e->hash_val = do_hash(e->filename, hash)) == NULL) {
268 gripe(vp, "Cannot calculate hash `%s'", e->filename);
278 walk_dir(veriexecgen_t *vp, char **search_path, hash_t *hash)
309 add_new_ftsent_entry(vp, file, hash);
318 read_from_file(veriexecgen_t *vp, hash_t *hash, FILE *file)
327 add_new_path_entry(vp, line, hash);
368 store_entries(veriexecgen_t *vp, hash_t *hash)
416 (void)fprintf(fp, "%s %s %s %s\n", file, hash->hashname,
439 hash_t *hash = NULL;
504 if ((hash = find_hash(optarg)) == NULL) {
506 "No such hash algorithm (%s)",
525 if (hash == NULL) {
526 if ((hash = find_hash(DEFAULT_HASH)) == NULL)
527 errx(EXIT_FAILURE, "No hash algorithm");
539 banner(&v, hash, sys_paths);
540 walk_dir(&v, sys_paths, hash);
545 banner(&v, hash, search_path);
546 walk_dir(&v, search_path, hash);
551 banner(&v, hash, NULL);
552 read_from_file(&v, hash, v.from_file);
555 store_entries(&v, hash);