Fossil SCM
Remove a reference to sha1sum from the pre-commit verification logic.
Commit
fc246fc4d1e9e98528b6af2f15f504cb585dd235
Parent
9f17d77ada4dc66…
1 file changed
+4
-6
+4
-6
| --- src/verify.c | ||
| +++ src/verify.c | ||
| @@ -44,17 +44,15 @@ | ||
| 44 | 44 | db_blob(&uuid, "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 45 | 45 | if( !hname_validate(blob_buffer(&uuid), blob_size(&uuid)) ){ |
| 46 | 46 | fossil_fatal("not a valid rid: %d", rid); |
| 47 | 47 | } |
| 48 | 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); | |
| 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); | |
| 54 | 52 | } |
| 55 | - blob_reset(&hash); | |
| 53 | + blob_reset(&content); | |
| 56 | 54 | } |
| 57 | 55 | blob_reset(&uuid); |
| 58 | 56 | } |
| 59 | 57 | |
| 60 | 58 | /* |
| 61 | 59 |
| --- 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 |