Diff
Not logged in

Differences From Artifact [b2c3fb3ac0]:

To Artifact [4f377d99d0]:


42
43
44
45
46
47
48
49

50
51
52
53


54
55

56
57
58
59
60
61
62
42
43
44
45
46
47
48

49




50
51
52

53
54
55
56
57
58
59
60







-
+
-
-
-
-
+
+

-
+







  }
  blob_zero(&uuid);
  db_blob(&uuid, "SELECT uuid FROM blob WHERE rid=%d", rid);
  if( !hname_validate(blob_buffer(&uuid), blob_size(&uuid)) ){
    fossil_fatal("not a valid rid: %d", rid);
  }
  if( content_get(rid, &content) ){
    sha1sum_blob(&content, &hash);
    if( !hname_verify_hash(&content, blob_buffer(&uuid), blob_size(&uuid)) ){
    blob_reset(&content);
    if( blob_compare(&uuid, &hash) ){
      fossil_fatal("hash of rid %d (%b) does not match its uuid (%b)",
                    rid, &hash, &uuid);
      fossil_fatal("hash of rid %d does not match its uuid (%b)",
                    rid, &uuid);
    }
    blob_reset(&hash);
    blob_reset(&content);
  }
  blob_reset(&uuid);
}

/*
** The following bag holds the rid for every record that needs
** to be verified.