Fossil SCM

Remove a reference to sha1sum from the pre-commit verification logic.

drh 2017-02-28 20:43 fossil-2.0
Commit fc246fc4d1e9e98528b6af2f15f504cb585dd235
1 file changed +4 -6
+4 -6
--- src/verify.c
+++ src/verify.c
@@ -44,17 +44,15 @@
4444
db_blob(&uuid, "SELECT uuid FROM blob WHERE rid=%d", rid);
4545
if( !hname_validate(blob_buffer(&uuid), blob_size(&uuid)) ){
4646
fossil_fatal("not a valid rid: %d", rid);
4747
}
4848
if( content_get(rid, &content) ){
49
- sha1sum_blob(&content, &hash);
50
- blob_reset(&content);
51
- if( blob_compare(&uuid, &hash) ){
52
- fossil_fatal("hash of rid %d (%b) does not match its uuid (%b)",
53
- rid, &hash, &uuid);
49
+ if( !hname_verify_hash(&content, blob_buffer(&uuid), blob_size(&uuid)) ){
50
+ fossil_fatal("hash of rid %d does not match its uuid (%b)",
51
+ rid, &uuid);
5452
}
55
- blob_reset(&hash);
53
+ blob_reset(&content);
5654
}
5755
blob_reset(&uuid);
5856
}
5957
6058
/*
6159
--- src/verify.c
+++ src/verify.c
@@ -44,17 +44,15 @@
44 db_blob(&uuid, "SELECT uuid FROM blob WHERE rid=%d", rid);
45 if( !hname_validate(blob_buffer(&uuid), blob_size(&uuid)) ){
46 fossil_fatal("not a valid rid: %d", rid);
47 }
48 if( content_get(rid, &content) ){
49 sha1sum_blob(&content, &hash);
50 blob_reset(&content);
51 if( blob_compare(&uuid, &hash) ){
52 fossil_fatal("hash of rid %d (%b) does not match its uuid (%b)",
53 rid, &hash, &uuid);
54 }
55 blob_reset(&hash);
56 }
57 blob_reset(&uuid);
58 }
59
60 /*
61
--- src/verify.c
+++ src/verify.c
@@ -44,17 +44,15 @@
44 db_blob(&uuid, "SELECT uuid FROM blob WHERE rid=%d", rid);
45 if( !hname_validate(blob_buffer(&uuid), blob_size(&uuid)) ){
46 fossil_fatal("not a valid rid: %d", rid);
47 }
48 if( content_get(rid, &content) ){
49 if( !hname_verify_hash(&content, blob_buffer(&uuid), blob_size(&uuid)) ){
50 fossil_fatal("hash of rid %d does not match its uuid (%b)",
51 rid, &uuid);
 
 
52 }
53 blob_reset(&content);
54 }
55 blob_reset(&uuid);
56 }
57
58 /*
59

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button