Fossil SCM

For new Docker-generated repositories, use "auto" hash-policy as default: They might be synced with "sha1"-type repositories, this would render those repositories useless.

jan.nijtmans 2017-03-06 12:48 trunk
Commit 9a6256cf0850e9c5a3a94da1cb6b464c0b4123ab
+2 -2
--- src/db.c
+++ src/db.c
@@ -1925,11 +1925,11 @@
19251925
char *zPassword;
19261926
const char *zTemplate; /* Repository from which to copy settings */
19271927
const char *zDate; /* Date of the initial check-in */
19281928
const char *zDefaultUser; /* Optional name of the default user */
19291929
int bUseSha1 = 0; /* True to set the hash-policy to sha1 */
1930
-
1930
+
19311931
19321932
zTemplate = find_option("template",0,1);
19331933
zDate = find_option("date-override",0,1);
19341934
zDefaultUser = find_option("admin-user","A",1);
19351935
bUseSha1 = find_option("sha1",0,0)!=0;
@@ -1950,11 +1950,11 @@
19501950
if( zTemplate ) db_attach(zTemplate, "settingSrc");
19511951
db_begin_transaction();
19521952
if( bUseSha1 ){
19531953
g.eHashPolicy = HPOLICY_SHA1;
19541954
db_set_int("hash-policy", HPOLICY_SHA1, 0);
1955
- }
1955
+ }
19561956
if( zDate==0 ) zDate = "now";
19571957
db_initial_setup(zTemplate, zDate, zDefaultUser);
19581958
db_end_transaction(0);
19591959
if( zTemplate ) db_detach("settingSrc");
19601960
fossil_print("project-id: %s\n", db_get("project-code", 0));
19611961
--- src/db.c
+++ src/db.c
@@ -1925,11 +1925,11 @@
1925 char *zPassword;
1926 const char *zTemplate; /* Repository from which to copy settings */
1927 const char *zDate; /* Date of the initial check-in */
1928 const char *zDefaultUser; /* Optional name of the default user */
1929 int bUseSha1 = 0; /* True to set the hash-policy to sha1 */
1930
1931
1932 zTemplate = find_option("template",0,1);
1933 zDate = find_option("date-override",0,1);
1934 zDefaultUser = find_option("admin-user","A",1);
1935 bUseSha1 = find_option("sha1",0,0)!=0;
@@ -1950,11 +1950,11 @@
1950 if( zTemplate ) db_attach(zTemplate, "settingSrc");
1951 db_begin_transaction();
1952 if( bUseSha1 ){
1953 g.eHashPolicy = HPOLICY_SHA1;
1954 db_set_int("hash-policy", HPOLICY_SHA1, 0);
1955 }
1956 if( zDate==0 ) zDate = "now";
1957 db_initial_setup(zTemplate, zDate, zDefaultUser);
1958 db_end_transaction(0);
1959 if( zTemplate ) db_detach("settingSrc");
1960 fossil_print("project-id: %s\n", db_get("project-code", 0));
1961
--- src/db.c
+++ src/db.c
@@ -1925,11 +1925,11 @@
1925 char *zPassword;
1926 const char *zTemplate; /* Repository from which to copy settings */
1927 const char *zDate; /* Date of the initial check-in */
1928 const char *zDefaultUser; /* Optional name of the default user */
1929 int bUseSha1 = 0; /* True to set the hash-policy to sha1 */
1930
1931
1932 zTemplate = find_option("template",0,1);
1933 zDate = find_option("date-override",0,1);
1934 zDefaultUser = find_option("admin-user","A",1);
1935 bUseSha1 = find_option("sha1",0,0)!=0;
@@ -1950,11 +1950,11 @@
1950 if( zTemplate ) db_attach(zTemplate, "settingSrc");
1951 db_begin_transaction();
1952 if( bUseSha1 ){
1953 g.eHashPolicy = HPOLICY_SHA1;
1954 db_set_int("hash-policy", HPOLICY_SHA1, 0);
1955 }
1956 if( zDate==0 ) zDate = "now";
1957 db_initial_setup(zTemplate, zDate, zDefaultUser);
1958 db_end_transaction(0);
1959 if( zTemplate ) db_detach("settingSrc");
1960 fossil_print("project-id: %s\n", db_get("project-code", 0));
1961
+1 -1
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -152,11 +152,11 @@
152152
** Show the difference between two files, one in memory and one on disk.
153153
**
154154
** The difference is the set of edits needed to transform pFile1 into
155155
** zFile2. The content of pFile1 is in memory. zFile2 exists on disk.
156156
**
157
-** If fSwapDiff is 1, show the set of edits to transform zFile2 into pFile1
157
+** If fSwapDiff is 1, show the set of edits to transform zFile2 into pFile1
158158
** instead of the opposite.
159159
**
160160
** Use the internal diff logic if zDiffCmd is NULL. Otherwise call the
161161
** command zDiffCmd to do the diffing.
162162
**
163163
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -152,11 +152,11 @@
152 ** Show the difference between two files, one in memory and one on disk.
153 **
154 ** The difference is the set of edits needed to transform pFile1 into
155 ** zFile2. The content of pFile1 is in memory. zFile2 exists on disk.
156 **
157 ** If fSwapDiff is 1, show the set of edits to transform zFile2 into pFile1
158 ** instead of the opposite.
159 **
160 ** Use the internal diff logic if zDiffCmd is NULL. Otherwise call the
161 ** command zDiffCmd to do the diffing.
162 **
163
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -152,11 +152,11 @@
152 ** Show the difference between two files, one in memory and one on disk.
153 **
154 ** The difference is the set of edits needed to transform pFile1 into
155 ** zFile2. The content of pFile1 is in memory. zFile2 exists on disk.
156 **
157 ** If fSwapDiff is 1, show the set of edits to transform zFile2 into pFile1
158 ** instead of the opposite.
159 **
160 ** Use the internal diff logic if zDiffCmd is NULL. Otherwise call the
161 ** command zDiffCmd to do the diffing.
162 **
163
+1 -1
--- src/encode.c
+++ src/encode.c
@@ -361,11 +361,11 @@
361361
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
362362
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
363363
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
364364
0x00, 0x01, 0x02, 0x03, 0x00, 0x01, 0x00, 0x00,
365365
};
366
-
366
+
367367
c = *((*pz)++);
368368
if( c>=0xc0 ){
369369
c = utf8Trans1[c-0xc0];
370370
while( (*(*pz) & 0xc0)==0x80 ){
371371
c = (c<<6) + (0x3f & *((*pz)++));
372372
--- src/encode.c
+++ src/encode.c
@@ -361,11 +361,11 @@
361 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
362 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
363 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
364 0x00, 0x01, 0x02, 0x03, 0x00, 0x01, 0x00, 0x00,
365 };
366
367 c = *((*pz)++);
368 if( c>=0xc0 ){
369 c = utf8Trans1[c-0xc0];
370 while( (*(*pz) & 0xc0)==0x80 ){
371 c = (c<<6) + (0x3f & *((*pz)++));
372
--- src/encode.c
+++ src/encode.c
@@ -361,11 +361,11 @@
361 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
362 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
363 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
364 0x00, 0x01, 0x02, 0x03, 0x00, 0x01, 0x00, 0x00,
365 };
366
367 c = *((*pz)++);
368 if( c>=0xc0 ){
369 c = utf8Trans1[c-0xc0];
370 while( (*(*pz) & 0xc0)==0x80 ){
371 c = (c<<6) + (0x3f & *((*pz)++));
372
+8 -7
--- src/hname.c
+++ src/hname.c
@@ -162,17 +162,18 @@
162162
** Depending on the hash policy, the alternative hash may be disallowed.
163163
** If the alterative hash is disallowed, the routine returns 0. This
164164
** routine returns 1 if iHType>0 and the alternative hash is allowed,
165165
** and it always returns 1 when iHType==0.
166166
**
167
-** Alternative hash is disallowed for all hash policies except sha1
168
-** and sha3.
167
+** Alternative hash is disallowed for all hash policies except auto,
168
+** sha1 and sha3.
169169
*/
170170
int hname_hash(const Blob *pContent, unsigned int iHType, Blob *pHashOut){
171171
assert( iHType==0 || iHType==1 );
172172
if( iHType==1 ){
173173
switch( g.eHashPolicy ){
174
+ case HPOLICY_AUTO:
174175
case HPOLICY_SHA1:
175176
sha3sum_blob(pContent, 256, pHashOut);
176177
return 1;
177178
case HPOLICY_SHA3:
178179
sha1sum_blob(pContent, pHashOut);
@@ -199,25 +200,25 @@
199200
/*
200201
** Return the default hash policy for repositories that do not currently
201202
** have an assigned hash policy.
202203
**
203204
** Make the default HPOLICY_AUTO if there are SHA1 artficates but no SHA3
204
-** artifacts in the repository. Make the default HPOLICY_SHA3 if there
205
+** artifacts in the repository. Make the default HPOLICY_SHA3 if there
205206
** are one or more SHA3 artifacts or if the repository is initially empty.
206207
*/
207208
int hname_default_policy(void){
208
- if( db_exists("SELECT 1 FROM blob WHERE length(uuid)>40")
209
+ if( db_exists("SELECT 1 FROM blob WHERE length(uuid)>40")
209210
|| !db_exists("SELECT 1 FROM blob WHERE length(uuid)==40")
210211
){
211212
return HPOLICY_SHA3;
212213
}else{
213214
return HPOLICY_AUTO;
214215
}
215216
}
216217
217218
/*
218
-** Names of the hash policies.
219
+** Names of the hash policies.
219220
*/
220221
static const char *azPolicy[] = {
221222
"sha1", "auto", "sha3", "sha3-only", "shun-sha1"
222223
};
223224
@@ -266,18 +267,18 @@
266267
return;
267268
}
268269
for(i=HPOLICY_SHA1; i<=HPOLICY_SHUN_SHA1; i++){
269270
if( fossil_strcmp(g.argv[2],azPolicy[i])==0 ){
270271
if( i==HPOLICY_AUTO
271
- && db_exists("SELECT 1 FROM blob WHERE length(uuid)>40")
272
+ && db_exists("SELECT 1 FROM blob WHERE length(uuid)>40")
272273
){
273274
i = HPOLICY_SHA3;
274
- }
275
+ }
275276
g.eHashPolicy = i;
276277
db_set_int("hash-policy", i, 0);
277278
fossil_print("%s\n", azPolicy[i]);
278279
return;
279280
}
280281
}
281282
fossil_fatal("unknown hash policy \"%s\" - should be one of: sha1 auto"
282283
" sha3 sha3-only shun-sha1", g.argv[2]);
283284
}
284285
--- src/hname.c
+++ src/hname.c
@@ -162,17 +162,18 @@
162 ** Depending on the hash policy, the alternative hash may be disallowed.
163 ** If the alterative hash is disallowed, the routine returns 0. This
164 ** routine returns 1 if iHType>0 and the alternative hash is allowed,
165 ** and it always returns 1 when iHType==0.
166 **
167 ** Alternative hash is disallowed for all hash policies except sha1
168 ** and sha3.
169 */
170 int hname_hash(const Blob *pContent, unsigned int iHType, Blob *pHashOut){
171 assert( iHType==0 || iHType==1 );
172 if( iHType==1 ){
173 switch( g.eHashPolicy ){
 
174 case HPOLICY_SHA1:
175 sha3sum_blob(pContent, 256, pHashOut);
176 return 1;
177 case HPOLICY_SHA3:
178 sha1sum_blob(pContent, pHashOut);
@@ -199,25 +200,25 @@
199 /*
200 ** Return the default hash policy for repositories that do not currently
201 ** have an assigned hash policy.
202 **
203 ** Make the default HPOLICY_AUTO if there are SHA1 artficates but no SHA3
204 ** artifacts in the repository. Make the default HPOLICY_SHA3 if there
205 ** are one or more SHA3 artifacts or if the repository is initially empty.
206 */
207 int hname_default_policy(void){
208 if( db_exists("SELECT 1 FROM blob WHERE length(uuid)>40")
209 || !db_exists("SELECT 1 FROM blob WHERE length(uuid)==40")
210 ){
211 return HPOLICY_SHA3;
212 }else{
213 return HPOLICY_AUTO;
214 }
215 }
216
217 /*
218 ** Names of the hash policies.
219 */
220 static const char *azPolicy[] = {
221 "sha1", "auto", "sha3", "sha3-only", "shun-sha1"
222 };
223
@@ -266,18 +267,18 @@
266 return;
267 }
268 for(i=HPOLICY_SHA1; i<=HPOLICY_SHUN_SHA1; i++){
269 if( fossil_strcmp(g.argv[2],azPolicy[i])==0 ){
270 if( i==HPOLICY_AUTO
271 && db_exists("SELECT 1 FROM blob WHERE length(uuid)>40")
272 ){
273 i = HPOLICY_SHA3;
274 }
275 g.eHashPolicy = i;
276 db_set_int("hash-policy", i, 0);
277 fossil_print("%s\n", azPolicy[i]);
278 return;
279 }
280 }
281 fossil_fatal("unknown hash policy \"%s\" - should be one of: sha1 auto"
282 " sha3 sha3-only shun-sha1", g.argv[2]);
283 }
284
--- src/hname.c
+++ src/hname.c
@@ -162,17 +162,18 @@
162 ** Depending on the hash policy, the alternative hash may be disallowed.
163 ** If the alterative hash is disallowed, the routine returns 0. This
164 ** routine returns 1 if iHType>0 and the alternative hash is allowed,
165 ** and it always returns 1 when iHType==0.
166 **
167 ** Alternative hash is disallowed for all hash policies except auto,
168 ** sha1 and sha3.
169 */
170 int hname_hash(const Blob *pContent, unsigned int iHType, Blob *pHashOut){
171 assert( iHType==0 || iHType==1 );
172 if( iHType==1 ){
173 switch( g.eHashPolicy ){
174 case HPOLICY_AUTO:
175 case HPOLICY_SHA1:
176 sha3sum_blob(pContent, 256, pHashOut);
177 return 1;
178 case HPOLICY_SHA3:
179 sha1sum_blob(pContent, pHashOut);
@@ -199,25 +200,25 @@
200 /*
201 ** Return the default hash policy for repositories that do not currently
202 ** have an assigned hash policy.
203 **
204 ** Make the default HPOLICY_AUTO if there are SHA1 artficates but no SHA3
205 ** artifacts in the repository. Make the default HPOLICY_SHA3 if there
206 ** are one or more SHA3 artifacts or if the repository is initially empty.
207 */
208 int hname_default_policy(void){
209 if( db_exists("SELECT 1 FROM blob WHERE length(uuid)>40")
210 || !db_exists("SELECT 1 FROM blob WHERE length(uuid)==40")
211 ){
212 return HPOLICY_SHA3;
213 }else{
214 return HPOLICY_AUTO;
215 }
216 }
217
218 /*
219 ** Names of the hash policies.
220 */
221 static const char *azPolicy[] = {
222 "sha1", "auto", "sha3", "sha3-only", "shun-sha1"
223 };
224
@@ -266,18 +267,18 @@
267 return;
268 }
269 for(i=HPOLICY_SHA1; i<=HPOLICY_SHUN_SHA1; i++){
270 if( fossil_strcmp(g.argv[2],azPolicy[i])==0 ){
271 if( i==HPOLICY_AUTO
272 && db_exists("SELECT 1 FROM blob WHERE length(uuid)>40")
273 ){
274 i = HPOLICY_SHA3;
275 }
276 g.eHashPolicy = i;
277 db_set_int("hash-policy", i, 0);
278 fossil_print("%s\n", azPolicy[i]);
279 return;
280 }
281 }
282 fossil_fatal("unknown hash policy \"%s\" - should be one of: sha1 auto"
283 " sha3 sha3-only shun-sha1", g.argv[2]);
284 }
285
+3 -3
--- src/stash.c
+++ src/stash.c
@@ -429,11 +429,11 @@
429429
**
430430
** fossil stash show|cat ?STASHID? ?DIFF-OPTIONS?
431431
** fossil stash gshow|gcat ?STASHID? ?DIFF-OPTIONS?
432432
**
433433
** Show the contents of a stash as a diff against it's baseline.
434
-** With gshow and gcat, gdiff-command is used instead of internal
434
+** With gshow and gcat, gdiff-command is used instead of internal
435435
** diff logic.
436436
**
437437
** fossil stash pop
438438
** fossil stash apply ?STASHID?
439439
**
@@ -456,11 +456,11 @@
456456
**
457457
** fossil stash diff ?STASHID? ?DIFF-OPTIONS?
458458
** fossil stash gdiff ?STASHID? ?DIFF-OPTIONS?
459459
**
460460
** Show diffs of the current working directory and what that
461
-** directory would be if STASHID were applied. With gdiff,
461
+** directory would be if STASHID were applied. With gdiff,
462462
** gdiff-command is used instead of internal diff logic.
463463
**
464464
** SUMMARY:
465465
** fossil stash
466466
** fossil stash save ?-m|--comment COMMENT? ?FILES...?
@@ -659,11 +659,11 @@
659659
|| memcmp(zCmd, "gcat", nCmd)==0
660660
){
661661
const char *zDiffCmd = 0;
662662
const char *zBinGlob = 0;
663663
int fIncludeBinary = 0;
664
- int fBaseline = 0;
664
+ int fBaseline = 0;
665665
u64 diffFlags;
666666
667667
if( strstr(zCmd,"show")!=0 || strstr(zCmd,"cat")!=0 ){
668668
fBaseline = 1;
669669
}
670670
--- src/stash.c
+++ src/stash.c
@@ -429,11 +429,11 @@
429 **
430 ** fossil stash show|cat ?STASHID? ?DIFF-OPTIONS?
431 ** fossil stash gshow|gcat ?STASHID? ?DIFF-OPTIONS?
432 **
433 ** Show the contents of a stash as a diff against it's baseline.
434 ** With gshow and gcat, gdiff-command is used instead of internal
435 ** diff logic.
436 **
437 ** fossil stash pop
438 ** fossil stash apply ?STASHID?
439 **
@@ -456,11 +456,11 @@
456 **
457 ** fossil stash diff ?STASHID? ?DIFF-OPTIONS?
458 ** fossil stash gdiff ?STASHID? ?DIFF-OPTIONS?
459 **
460 ** Show diffs of the current working directory and what that
461 ** directory would be if STASHID were applied. With gdiff,
462 ** gdiff-command is used instead of internal diff logic.
463 **
464 ** SUMMARY:
465 ** fossil stash
466 ** fossil stash save ?-m|--comment COMMENT? ?FILES...?
@@ -659,11 +659,11 @@
659 || memcmp(zCmd, "gcat", nCmd)==0
660 ){
661 const char *zDiffCmd = 0;
662 const char *zBinGlob = 0;
663 int fIncludeBinary = 0;
664 int fBaseline = 0;
665 u64 diffFlags;
666
667 if( strstr(zCmd,"show")!=0 || strstr(zCmd,"cat")!=0 ){
668 fBaseline = 1;
669 }
670
--- src/stash.c
+++ src/stash.c
@@ -429,11 +429,11 @@
429 **
430 ** fossil stash show|cat ?STASHID? ?DIFF-OPTIONS?
431 ** fossil stash gshow|gcat ?STASHID? ?DIFF-OPTIONS?
432 **
433 ** Show the contents of a stash as a diff against it's baseline.
434 ** With gshow and gcat, gdiff-command is used instead of internal
435 ** diff logic.
436 **
437 ** fossil stash pop
438 ** fossil stash apply ?STASHID?
439 **
@@ -456,11 +456,11 @@
456 **
457 ** fossil stash diff ?STASHID? ?DIFF-OPTIONS?
458 ** fossil stash gdiff ?STASHID? ?DIFF-OPTIONS?
459 **
460 ** Show diffs of the current working directory and what that
461 ** directory would be if STASHID were applied. With gdiff,
462 ** gdiff-command is used instead of internal diff logic.
463 **
464 ** SUMMARY:
465 ** fossil stash
466 ** fossil stash save ?-m|--comment COMMENT? ?FILES...?
@@ -659,11 +659,11 @@
659 || memcmp(zCmd, "gcat", nCmd)==0
660 ){
661 const char *zDiffCmd = 0;
662 const char *zBinGlob = 0;
663 int fIncludeBinary = 0;
664 int fBaseline = 0;
665 u64 diffFlags;
666
667 if( strstr(zCmd,"show")!=0 || strstr(zCmd,"cat")!=0 ){
668 fBaseline = 1;
669 }
670
--- www/hashpolicy.wiki
+++ www/hashpolicy.wiki
@@ -3,21 +3,21 @@
33
<h2> Executive Summary, Or How To Avoid Reading This Article </h2>
44
55
There is much angst over the [http://www.shattered.io|Shattered attack]
66
against SHA1. If you are concerned about this and its implications for
77
Fossil, simply upgrade to Fossil 2.0 or later and the problem will go away.
8
-Everything will continue to work as before. All of your legacy repositories
9
-will continue to work and all of your old check-ins will still have the
8
+Everything will continue to work as before. All of your legacy repositories
9
+will continue to work and all of your old check-ins will still have the
1010
same name. Your workflow will be unchanged.
1111
1212
But if you are curious and want a deeper understanding of what is
1313
going on, read on...
1414
1515
1616
<h2> Introduction </h2>
1717
18
-The first snapshot-based distributed version control system
18
+The first snapshot-based distributed version control system
1919
was [http://www.monotone.ca|Monotone]. Many of the ideas behind the design
2020
of Fossil were copied from Monotone, including the use of a SHA1 hash to
2121
assign names to artifacts. Git and Mercurial did the same thing.
2222
2323
The SHA1 hash algorithm is used only to create names for artifacts in Fossil
@@ -31,11 +31,11 @@
3131
3232
This article describes how that migration is occurring.
3333
3434
<h2>Use Of Hardened SHA1</h2>
3535
36
-In Fossil version 2.0 ([/timeline?c=version-2.0|2017-03-03]),
36
+In Fossil version 2.0 ([/timeline?c=version-2.0|2017-03-03]),
3737
the internal SHA1 implementation was changed from a generic
3838
FIPS PUB 180-4 SHA1 implementation to a "Hardened SHA1"
3939
&#91;[https://github.com/cr-marcstevens/sha1collisiondetection|1]&#93;
4040
&#91;[https://marc-stevens.nl/research/papers/C13-S.pdf|2]&#93;.
4141
@@ -61,11 +61,11 @@
6161
<em>Hardened SHA1</em> not generic SHA1 and Hardened SHA1 is <em>not</em>
6262
broken.
6363
6464
<h2>Support For SHA3-256</h2>
6565
66
-Prior to Fossil version 2.0 ([/timeline?c=version-2.0|2017-03-03]),
66
+Prior to Fossil version 2.0 ([/timeline?c=version-2.0|2017-03-03]),
6767
all artifacts in all Fossil repositories were named
6868
by only a SHA1 hash.
6969
Version 2.0 extended the [./fileformat.wiki|Fossil file format]
7070
to allow artifacts to be named by either SHA1 or SHA3-256 hashes.
7171
(SHA3-256 is the only variant of SHA3 that
@@ -137,19 +137,19 @@
137137
138138
When a new repository is created by cloning, the hash policy is copied
139139
from the parent.
140140
141141
For new repositories created using the
142
-[/help?cmd=new|fossil new] command the default hash policy is "sha3".
142
+[/help?cmd=new|fossil new] command the default hash policy is "sha3".
143143
That means new repositories
144144
will normally hold nothing except SHA3 hashes. The hash policy for new
145145
repositories can be overridden using the "--sha1" option to the
146146
"fossil new" command.
147147
148148
Even after upgrading to Fossil 2.1, Fossil will continue to use nothing
149
-but SHA1 hashes on legacy repositories, thus preserving complete
150
-compatibility with Fossil 1.37 and before. If you want Fossil to go
149
+but SHA1 hashes on legacy repositories, thus preserving complete
150
+compatibility with Fossil 1.37 and before. If you want Fossil to go
151151
ahead and start using SHA3 hashes, change the hash policy to
152152
"sha3" using a command like this:
153153
154154
<blockquote><verbatim>
155155
fossil hash-policy sha3
156156
--- www/hashpolicy.wiki
+++ www/hashpolicy.wiki
@@ -3,21 +3,21 @@
3 <h2> Executive Summary, Or How To Avoid Reading This Article </h2>
4
5 There is much angst over the [http://www.shattered.io|Shattered attack]
6 against SHA1. If you are concerned about this and its implications for
7 Fossil, simply upgrade to Fossil 2.0 or later and the problem will go away.
8 Everything will continue to work as before. All of your legacy repositories
9 will continue to work and all of your old check-ins will still have the
10 same name. Your workflow will be unchanged.
11
12 But if you are curious and want a deeper understanding of what is
13 going on, read on...
14
15
16 <h2> Introduction </h2>
17
18 The first snapshot-based distributed version control system
19 was [http://www.monotone.ca|Monotone]. Many of the ideas behind the design
20 of Fossil were copied from Monotone, including the use of a SHA1 hash to
21 assign names to artifacts. Git and Mercurial did the same thing.
22
23 The SHA1 hash algorithm is used only to create names for artifacts in Fossil
@@ -31,11 +31,11 @@
31
32 This article describes how that migration is occurring.
33
34 <h2>Use Of Hardened SHA1</h2>
35
36 In Fossil version 2.0 ([/timeline?c=version-2.0|2017-03-03]),
37 the internal SHA1 implementation was changed from a generic
38 FIPS PUB 180-4 SHA1 implementation to a "Hardened SHA1"
39 &#91;[https://github.com/cr-marcstevens/sha1collisiondetection|1]&#93;
40 &#91;[https://marc-stevens.nl/research/papers/C13-S.pdf|2]&#93;.
41
@@ -61,11 +61,11 @@
61 <em>Hardened SHA1</em> not generic SHA1 and Hardened SHA1 is <em>not</em>
62 broken.
63
64 <h2>Support For SHA3-256</h2>
65
66 Prior to Fossil version 2.0 ([/timeline?c=version-2.0|2017-03-03]),
67 all artifacts in all Fossil repositories were named
68 by only a SHA1 hash.
69 Version 2.0 extended the [./fileformat.wiki|Fossil file format]
70 to allow artifacts to be named by either SHA1 or SHA3-256 hashes.
71 (SHA3-256 is the only variant of SHA3 that
@@ -137,19 +137,19 @@
137
138 When a new repository is created by cloning, the hash policy is copied
139 from the parent.
140
141 For new repositories created using the
142 [/help?cmd=new|fossil new] command the default hash policy is "sha3".
143 That means new repositories
144 will normally hold nothing except SHA3 hashes. The hash policy for new
145 repositories can be overridden using the "--sha1" option to the
146 "fossil new" command.
147
148 Even after upgrading to Fossil 2.1, Fossil will continue to use nothing
149 but SHA1 hashes on legacy repositories, thus preserving complete
150 compatibility with Fossil 1.37 and before. If you want Fossil to go
151 ahead and start using SHA3 hashes, change the hash policy to
152 "sha3" using a command like this:
153
154 <blockquote><verbatim>
155 fossil hash-policy sha3
156
--- www/hashpolicy.wiki
+++ www/hashpolicy.wiki
@@ -3,21 +3,21 @@
3 <h2> Executive Summary, Or How To Avoid Reading This Article </h2>
4
5 There is much angst over the [http://www.shattered.io|Shattered attack]
6 against SHA1. If you are concerned about this and its implications for
7 Fossil, simply upgrade to Fossil 2.0 or later and the problem will go away.
8 Everything will continue to work as before. All of your legacy repositories
9 will continue to work and all of your old check-ins will still have the
10 same name. Your workflow will be unchanged.
11
12 But if you are curious and want a deeper understanding of what is
13 going on, read on...
14
15
16 <h2> Introduction </h2>
17
18 The first snapshot-based distributed version control system
19 was [http://www.monotone.ca|Monotone]. Many of the ideas behind the design
20 of Fossil were copied from Monotone, including the use of a SHA1 hash to
21 assign names to artifacts. Git and Mercurial did the same thing.
22
23 The SHA1 hash algorithm is used only to create names for artifacts in Fossil
@@ -31,11 +31,11 @@
31
32 This article describes how that migration is occurring.
33
34 <h2>Use Of Hardened SHA1</h2>
35
36 In Fossil version 2.0 ([/timeline?c=version-2.0|2017-03-03]),
37 the internal SHA1 implementation was changed from a generic
38 FIPS PUB 180-4 SHA1 implementation to a "Hardened SHA1"
39 &#91;[https://github.com/cr-marcstevens/sha1collisiondetection|1]&#93;
40 &#91;[https://marc-stevens.nl/research/papers/C13-S.pdf|2]&#93;.
41
@@ -61,11 +61,11 @@
61 <em>Hardened SHA1</em> not generic SHA1 and Hardened SHA1 is <em>not</em>
62 broken.
63
64 <h2>Support For SHA3-256</h2>
65
66 Prior to Fossil version 2.0 ([/timeline?c=version-2.0|2017-03-03]),
67 all artifacts in all Fossil repositories were named
68 by only a SHA1 hash.
69 Version 2.0 extended the [./fileformat.wiki|Fossil file format]
70 to allow artifacts to be named by either SHA1 or SHA3-256 hashes.
71 (SHA3-256 is the only variant of SHA3 that
@@ -137,19 +137,19 @@
137
138 When a new repository is created by cloning, the hash policy is copied
139 from the parent.
140
141 For new repositories created using the
142 [/help?cmd=new|fossil new] command the default hash policy is "sha3".
143 That means new repositories
144 will normally hold nothing except SHA3 hashes. The hash policy for new
145 repositories can be overridden using the "--sha1" option to the
146 "fossil new" command.
147
148 Even after upgrading to Fossil 2.1, Fossil will continue to use nothing
149 but SHA1 hashes on legacy repositories, thus preserving complete
150 compatibility with Fossil 1.37 and before. If you want Fossil to go
151 ahead and start using SHA3 hashes, change the hash policy to
152 "sha3" using a command like this:
153
154 <blockquote><verbatim>
155 fossil hash-policy sha3
156

Keyboard Shortcuts

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