Lines Matching defs:hash
116 mhash_retrieve_entry(scf_handle_t *hndl, const char *name, uchar_t *hash,
132 * In this implementation the hash for name is the opaque value of
170 szret = scf_value_get_opaque(val, hash, MHASH_SIZE);
177 * Make sure that the old hash is returned with
181 (void) memset(hash + MHASH_SIZE_OLD, 0,
233 uchar_t *hash, apply_action_t apply_late, char **errstr)
276 *errstr = gettext("Could not get manifest hash "
293 *errstr = gettext("Could not store file hash: "
300 *errstr = gettext("Could not add manifest hash "
308 *errstr = gettext("Could not store file hash: "
321 "hash record)");
337 *errstr = gettext("Could not store file hash: "
344 *errstr = gettext("Could not store file hash");
350 *errstr = gettext("Could not store file hash: "
363 *errstr = gettext("Could not store file hash: "
369 ret = scf_value_set_opaque(val, hash, MHASH_SIZE);
388 *errstr = gettext("Could not update hash "
397 "hash transaction.\n");
403 *errstr = gettext("Could not store file hash: "
417 *errstr = gettext("Could not modify hash "
488 *errstr = gettext("Could not store file hash: "
517 * Generate the md5 hash of a file; manifest files are smallish
521 md5_hash_file(const char *file, off64_t sz, uchar_t *hash)
544 md5_calc(hash, (uchar_t *)buf, (unsigned int) sz);
557 * if the hash value is absent or different, then the import operation
559 * hash value for the file is absent.
561 * We keep two hashes: one which can be quickly test: the metadata hash,
562 * and one which is more expensive to test: the file contents hash.
564 * If either hash matches, the file does not need to be re-read.
566 * is to store the newly computed hash.
567 * If neither hash matches, the hash computed for the new file is returned
571 * MHASH_NEWFILE - the file no longer matches the hash or no hash existed
572 * ONLY in this case we return the new file's hash.
574 * MHASH_RECONCILED- based on the metadata/file hash, the file does
576 * the hash was upgraded or reconciled.
578 * NOTE: no hash is returned UNLESS MHASH_NEWFILE is returned.
590 uchar_t hash[MHASH_SIZE];
604 * The previous hash was composed of the inode number, the UID, the file
607 * algorithm will allow matches of this "v1" hash, but always returns
608 * the effective "v2" hash, such that updates result in the more
609 * portable hash being used.
611 * An unwanted side effect of a hash based solely on the file
614 * with (live) upgrades. We extend the V2 hash with an additional
615 * digest of the file contents and the code retrieving the hash
623 * file hash, we match the file content digest. If it matches,
624 * we compute and store the new complete hash so that later
627 * If the above matches fail and the V1 hash doesn't match either,
664 * No hash and not interested in one, then don't bother computing it.
687 (void) memset(hash, 0, MHASH_SIZE);
688 md5_calc(hash, (uchar_t *)data, strlen(data));
693 * Verify the meta data hash.
695 if (hashash && memcmp(hash, stored_hash, MD5_DIGEST_LENGTH) == 0) {
700 * The metadata hash matches; now we see if there was a
701 * content hash; if not, we will continue on and compute and
702 * store the updated hash.
703 * If there was no content hash, mhash_retrieve_entry()
722 * Compute the file hash as we can no longer avoid having to know it.
723 * Note: from this point on "hash" contains the full, current, hash.
725 if (md5_hash_file(file, st.st_size, &hash[MHASH_SIZE_OLD]) != 0) {
733 memcmp(&hash[MHASH_SIZE_OLD], &stored_hash[MHASH_SIZE_OLD],
738 * meta data hash matches or the content hash matches;
740 * new hash so we can be a bit quicker next time.
742 (void) mhash_store_entry(hndl, pname, file, hash,
756 * No match on V2 hash or file content; compare V1 hash.
774 (void) mhash_store_entry(hndl, pname, file, hash,
787 (void) memcpy(hashbuf, hash, MHASH_SIZE);