Fossil SCM

Add support for variable "hash policies". Increase the version number to 2.1.

drh 2017-03-05 19:51 trunk merge
Commit e92133a548351082f4d1c015c4e2cb198b340da4
+1 -1
--- VERSION
+++ VERSION
@@ -1,1 +1,1 @@
1
-2.0
1
+2.1
22
--- VERSION
+++ VERSION
@@ -1,1 +1,1 @@
1 2.0
2
--- VERSION
+++ VERSION
@@ -1,1 +1,1 @@
1 2.1
2
--- src/clone.c
+++ src/clone.c
@@ -175,10 +175,11 @@
175175
db_initial_setup(0, 0, zDefaultUser);
176176
user_select();
177177
db_set("content-schema", CONTENT_SCHEMA, 0);
178178
db_set("aux-schema", AUX_SCHEMA_MAX, 0);
179179
db_set("rebuilt", get_version(), 0);
180
+ db_unset("hash-policy", 0);
180181
remember_or_get_http_auth(zHttpAuth, urlFlags & URL_REMEMBER, g.argv[2]);
181182
url_remember();
182183
if( g.zSSLIdentity!=0 ){
183184
/* If the --ssl-identity option was specified, store it as a setting */
184185
Blob fn;
185186
--- src/clone.c
+++ src/clone.c
@@ -175,10 +175,11 @@
175 db_initial_setup(0, 0, zDefaultUser);
176 user_select();
177 db_set("content-schema", CONTENT_SCHEMA, 0);
178 db_set("aux-schema", AUX_SCHEMA_MAX, 0);
179 db_set("rebuilt", get_version(), 0);
 
180 remember_or_get_http_auth(zHttpAuth, urlFlags & URL_REMEMBER, g.argv[2]);
181 url_remember();
182 if( g.zSSLIdentity!=0 ){
183 /* If the --ssl-identity option was specified, store it as a setting */
184 Blob fn;
185
--- src/clone.c
+++ src/clone.c
@@ -175,10 +175,11 @@
175 db_initial_setup(0, 0, zDefaultUser);
176 user_select();
177 db_set("content-schema", CONTENT_SCHEMA, 0);
178 db_set("aux-schema", AUX_SCHEMA_MAX, 0);
179 db_set("rebuilt", get_version(), 0);
180 db_unset("hash-policy", 0);
181 remember_or_get_http_auth(zHttpAuth, urlFlags & URL_REMEMBER, g.argv[2]);
182 url_remember();
183 if( g.zSSLIdentity!=0 ){
184 /* If the --ssl-identity option was specified, store it as a setting */
185 Blob fn;
186
--- src/configure.c
+++ src/configure.c
@@ -129,10 +129,11 @@
129129
{ "empty-dirs", CONFIGSET_PROJ },
130130
{ "allow-symlinks", CONFIGSET_PROJ },
131131
{ "dotfiles", CONFIGSET_PROJ },
132132
{ "parent-project-code", CONFIGSET_PROJ },
133133
{ "parent-project-name", CONFIGSET_PROJ },
134
+ { "hash-policy", CONFIGSET_PROJ },
134135
135136
#ifdef FOSSIL_ENABLE_LEGACY_MV_RM
136137
{ "mv-rm-files", CONFIGSET_PROJ },
137138
#endif
138139
139140
--- src/configure.c
+++ src/configure.c
@@ -129,10 +129,11 @@
129 { "empty-dirs", CONFIGSET_PROJ },
130 { "allow-symlinks", CONFIGSET_PROJ },
131 { "dotfiles", CONFIGSET_PROJ },
132 { "parent-project-code", CONFIGSET_PROJ },
133 { "parent-project-name", CONFIGSET_PROJ },
 
134
135 #ifdef FOSSIL_ENABLE_LEGACY_MV_RM
136 { "mv-rm-files", CONFIGSET_PROJ },
137 #endif
138
139
--- src/configure.c
+++ src/configure.c
@@ -129,10 +129,11 @@
129 { "empty-dirs", CONFIGSET_PROJ },
130 { "allow-symlinks", CONFIGSET_PROJ },
131 { "dotfiles", CONFIGSET_PROJ },
132 { "parent-project-code", CONFIGSET_PROJ },
133 { "parent-project-name", CONFIGSET_PROJ },
134 { "hash-policy", CONFIGSET_PROJ },
135
136 #ifdef FOSSIL_ENABLE_LEGACY_MV_RM
137 { "mv-rm-files", CONFIGSET_PROJ },
138 #endif
139
140
--- src/content.c
+++ src/content.c
@@ -528,10 +528,14 @@
528528
blob_reset(&hash);
529529
hname_hash(pBlob, 0, &hash);
530530
}
531531
}else{
532532
blob_init(&hash, zUuid, -1);
533
+ }
534
+ if( g.eHashPolicy==HPOLICY_AUTO && blob_size(&hash)>HNAME_LEN_SHA1 ){
535
+ g.eHashPolicy = HPOLICY_SHA3;
536
+ db_set_int("hash-policy", HPOLICY_SHA3, 0);
533537
}
534538
if( nBlob ){
535539
size = nBlob;
536540
}else{
537541
size = blob_size(pBlob);
538542
--- src/content.c
+++ src/content.c
@@ -528,10 +528,14 @@
528 blob_reset(&hash);
529 hname_hash(pBlob, 0, &hash);
530 }
531 }else{
532 blob_init(&hash, zUuid, -1);
 
 
 
 
533 }
534 if( nBlob ){
535 size = nBlob;
536 }else{
537 size = blob_size(pBlob);
538
--- src/content.c
+++ src/content.c
@@ -528,10 +528,14 @@
528 blob_reset(&hash);
529 hname_hash(pBlob, 0, &hash);
530 }
531 }else{
532 blob_init(&hash, zUuid, -1);
533 }
534 if( g.eHashPolicy==HPOLICY_AUTO && blob_size(&hash)>HNAME_LEN_SHA1 ){
535 g.eHashPolicy = HPOLICY_SHA3;
536 db_set_int("hash-policy", HPOLICY_SHA3, 0);
537 }
538 if( nBlob ){
539 size = nBlob;
540 }else{
541 size = blob_size(pBlob);
542
+17 -3
--- src/db.c
+++ src/db.c
@@ -1485,10 +1485,15 @@
14851485
g.repositoryOpen = 1;
14861486
/* Cache "allow-symlinks" option, because we'll need it on every stat call */
14871487
g.allowSymlinks = db_get_boolean("allow-symlinks",
14881488
db_allow_symlinks_by_default());
14891489
g.zAuxSchema = db_get("aux-schema","");
1490
+ g.eHashPolicy = db_get_int("hash-policy",-1);
1491
+ if( g.eHashPolicy<0 ){
1492
+ g.eHashPolicy = hname_default_policy();
1493
+ db_set_int("hash-policy", g.eHashPolicy, 0);
1494
+ }
14901495
14911496
/* If the ALIAS table is not present, then some on-the-fly schema
14921497
** updates might be required.
14931498
*/
14941499
rebuild_schema_update_2_0(); /* Do the Fossil-2.0 schema updates */
@@ -1828,10 +1833,11 @@
18281833
" AND name NOT GLOB 'project-*'"
18291834
" AND name NOT GLOB 'short-project-*';",
18301835
configure_inop_rhs(CONFIGSET_ALL),
18311836
db_setting_inop_rhs()
18321837
);
1838
+ g.eHashPolicy = db_get_int("hash-policy", g.eHashPolicy);
18331839
db_multi_exec(
18341840
"REPLACE INTO reportfmt SELECT * FROM settingSrc.reportfmt;"
18351841
);
18361842
18371843
/*
@@ -1900,13 +1906,14 @@
19001906
** their associated permissions will not be copied; however, the system
19011907
** default users "anonymous", "nobody", "reader", "developer", and their
19021908
** associated permissions will be copied.
19031909
**
19041910
** Options:
1905
-** --template FILE copy settings from repository file
1906
-** --admin-user|-A USERNAME select given USERNAME as admin user
1907
-** --date-override DATETIME use DATETIME as time of the initial check-in
1911
+** --template FILE Copy settings from repository file
1912
+** --admin-user|-A USERNAME Select given USERNAME as admin user
1913
+** --date-override DATETIME Use DATETIME as time of the initial check-in
1914
+** --sha1 Use a initial hash policy of "sha1"
19081915
**
19091916
** DATETIME may be "now" or "YYYY-MM-DDTHH:MM:SS.SSS". If in
19101917
** year-month-day form, it may be truncated, the "T" may be replaced by
19111918
** a space, and it may also name a timezone offset from UTC as "-HH:MM"
19121919
** (westward) or "+HH:MM" (eastward). Either no timezone suffix or "Z"
@@ -1917,14 +1924,17 @@
19171924
void create_repository_cmd(void){
19181925
char *zPassword;
19191926
const char *zTemplate; /* Repository from which to copy settings */
19201927
const char *zDate; /* Date of the initial check-in */
19211928
const char *zDefaultUser; /* Optional name of the default user */
1929
+ int bUseSha1 = 0; /* True to set the hash-policy to sha1 */
1930
+
19221931
19231932
zTemplate = find_option("template",0,1);
19241933
zDate = find_option("date-override",0,1);
19251934
zDefaultUser = find_option("admin-user","A",1);
1935
+ bUseSha1 = find_option("sha1",0,0)!=0;
19261936
/* We should be done with options.. */
19271937
verify_all_options();
19281938
19291939
if( g.argc!=3 ){
19301940
usage("REPOSITORY-NAME");
@@ -1937,10 +1947,14 @@
19371947
db_create_repository(g.argv[2]);
19381948
db_open_repository(g.argv[2]);
19391949
db_open_config(0, 0);
19401950
if( zTemplate ) db_attach(zTemplate, "settingSrc");
19411951
db_begin_transaction();
1952
+ if( bUseSha1 ){
1953
+ g.eHashPolicy = HPOLICY_SHA1;
1954
+ db_set_int("hash-policy", HPOLICY_SHA1, 0);
1955
+ }
19421956
if( zDate==0 ) zDate = "now";
19431957
db_initial_setup(zTemplate, zDate, zDefaultUser);
19441958
db_end_transaction(0);
19451959
if( zTemplate ) db_detach("settingSrc");
19461960
fossil_print("project-id: %s\n", db_get("project-code", 0));
19471961
--- src/db.c
+++ src/db.c
@@ -1485,10 +1485,15 @@
1485 g.repositoryOpen = 1;
1486 /* Cache "allow-symlinks" option, because we'll need it on every stat call */
1487 g.allowSymlinks = db_get_boolean("allow-symlinks",
1488 db_allow_symlinks_by_default());
1489 g.zAuxSchema = db_get("aux-schema","");
 
 
 
 
 
1490
1491 /* If the ALIAS table is not present, then some on-the-fly schema
1492 ** updates might be required.
1493 */
1494 rebuild_schema_update_2_0(); /* Do the Fossil-2.0 schema updates */
@@ -1828,10 +1833,11 @@
1828 " AND name NOT GLOB 'project-*'"
1829 " AND name NOT GLOB 'short-project-*';",
1830 configure_inop_rhs(CONFIGSET_ALL),
1831 db_setting_inop_rhs()
1832 );
 
1833 db_multi_exec(
1834 "REPLACE INTO reportfmt SELECT * FROM settingSrc.reportfmt;"
1835 );
1836
1837 /*
@@ -1900,13 +1906,14 @@
1900 ** their associated permissions will not be copied; however, the system
1901 ** default users "anonymous", "nobody", "reader", "developer", and their
1902 ** associated permissions will be copied.
1903 **
1904 ** Options:
1905 ** --template FILE copy settings from repository file
1906 ** --admin-user|-A USERNAME select given USERNAME as admin user
1907 ** --date-override DATETIME use DATETIME as time of the initial check-in
 
1908 **
1909 ** DATETIME may be "now" or "YYYY-MM-DDTHH:MM:SS.SSS". If in
1910 ** year-month-day form, it may be truncated, the "T" may be replaced by
1911 ** a space, and it may also name a timezone offset from UTC as "-HH:MM"
1912 ** (westward) or "+HH:MM" (eastward). Either no timezone suffix or "Z"
@@ -1917,14 +1924,17 @@
1917 void create_repository_cmd(void){
1918 char *zPassword;
1919 const char *zTemplate; /* Repository from which to copy settings */
1920 const char *zDate; /* Date of the initial check-in */
1921 const char *zDefaultUser; /* Optional name of the default user */
 
 
1922
1923 zTemplate = find_option("template",0,1);
1924 zDate = find_option("date-override",0,1);
1925 zDefaultUser = find_option("admin-user","A",1);
 
1926 /* We should be done with options.. */
1927 verify_all_options();
1928
1929 if( g.argc!=3 ){
1930 usage("REPOSITORY-NAME");
@@ -1937,10 +1947,14 @@
1937 db_create_repository(g.argv[2]);
1938 db_open_repository(g.argv[2]);
1939 db_open_config(0, 0);
1940 if( zTemplate ) db_attach(zTemplate, "settingSrc");
1941 db_begin_transaction();
 
 
 
 
1942 if( zDate==0 ) zDate = "now";
1943 db_initial_setup(zTemplate, zDate, zDefaultUser);
1944 db_end_transaction(0);
1945 if( zTemplate ) db_detach("settingSrc");
1946 fossil_print("project-id: %s\n", db_get("project-code", 0));
1947
--- src/db.c
+++ src/db.c
@@ -1485,10 +1485,15 @@
1485 g.repositoryOpen = 1;
1486 /* Cache "allow-symlinks" option, because we'll need it on every stat call */
1487 g.allowSymlinks = db_get_boolean("allow-symlinks",
1488 db_allow_symlinks_by_default());
1489 g.zAuxSchema = db_get("aux-schema","");
1490 g.eHashPolicy = db_get_int("hash-policy",-1);
1491 if( g.eHashPolicy<0 ){
1492 g.eHashPolicy = hname_default_policy();
1493 db_set_int("hash-policy", g.eHashPolicy, 0);
1494 }
1495
1496 /* If the ALIAS table is not present, then some on-the-fly schema
1497 ** updates might be required.
1498 */
1499 rebuild_schema_update_2_0(); /* Do the Fossil-2.0 schema updates */
@@ -1828,10 +1833,11 @@
1833 " AND name NOT GLOB 'project-*'"
1834 " AND name NOT GLOB 'short-project-*';",
1835 configure_inop_rhs(CONFIGSET_ALL),
1836 db_setting_inop_rhs()
1837 );
1838 g.eHashPolicy = db_get_int("hash-policy", g.eHashPolicy);
1839 db_multi_exec(
1840 "REPLACE INTO reportfmt SELECT * FROM settingSrc.reportfmt;"
1841 );
1842
1843 /*
@@ -1900,13 +1906,14 @@
1906 ** their associated permissions will not be copied; however, the system
1907 ** default users "anonymous", "nobody", "reader", "developer", and their
1908 ** associated permissions will be copied.
1909 **
1910 ** Options:
1911 ** --template FILE Copy settings from repository file
1912 ** --admin-user|-A USERNAME Select given USERNAME as admin user
1913 ** --date-override DATETIME Use DATETIME as time of the initial check-in
1914 ** --sha1 Use a initial hash policy of "sha1"
1915 **
1916 ** DATETIME may be "now" or "YYYY-MM-DDTHH:MM:SS.SSS". If in
1917 ** year-month-day form, it may be truncated, the "T" may be replaced by
1918 ** a space, and it may also name a timezone offset from UTC as "-HH:MM"
1919 ** (westward) or "+HH:MM" (eastward). Either no timezone suffix or "Z"
@@ -1917,14 +1924,17 @@
1924 void create_repository_cmd(void){
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;
1936 /* We should be done with options.. */
1937 verify_all_options();
1938
1939 if( g.argc!=3 ){
1940 usage("REPOSITORY-NAME");
@@ -1937,10 +1947,14 @@
1947 db_create_repository(g.argv[2]);
1948 db_open_repository(g.argv[2]);
1949 db_open_config(0, 0);
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
+136 -20
--- src/hname.c
+++ src/hname.c
@@ -16,11 +16,13 @@
1616
*******************************************************************************
1717
**
1818
** This file contains generic code for dealing with hashes used for
1919
** naming artifacts. Specific hash algorithms are implemented separately
2020
** (for example in sha1.c and sha3.c). This file contains the generic
21
-** interface code.
21
+** interface logic.
22
+**
23
+** "hname" is intended to be an abbreviation of "hash name".
2224
*/
2325
#include "config.h"
2426
#include "hname.h"
2527
2628
@@ -47,10 +49,19 @@
4749
/*
4850
** The number of distinct hash algorithms:
4951
*/
5052
#define HNAME_COUNT 2 /* Just SHA1 and SHA3-256. Let's keep it that way! */
5153
54
+/*
55
+** Hash naming policies
56
+*/
57
+#define HPOLICY_SHA1 0 /* Use SHA1 hashes */
58
+#define HPOLICY_AUTO 1 /* SHA1 but auto-promote to SHA3 */
59
+#define HPOLICY_SHA3 2 /* Use SHA3 hashes */
60
+#define HPOLICY_SHA3_ONLY 3 /* Use SHA3 hashes exclusively */
61
+#define HPOLICY_SHUN_SHA1 4 /* Shun all SHA1 objects */
62
+
5263
#endif /* INTERFACE */
5364
5465
/*
5566
** Return a human-readable name for the hash algorithm given a hash with
5667
** a length of nHash hexadecimal digits.
@@ -142,26 +153,131 @@
142153
143154
/*
144155
** Compute a hash on blob pContent. Write the hash into blob pHashOut.
145156
** This routine assumes that pHashOut is uninitialized.
146157
**
147
-** The preferred hash is used for iHType==0, and various alternative hashes
148
-** are used for iHType>0 && iHType<NHAME_COUNT.
158
+** The preferred hash is used for iHType==0 and the alternative hash is
159
+** used if iHType==1. (The interface is designed to accommodate more than
160
+** just two hashes, but HNAME_COUNT is currently fixed at 2.)
161
+**
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);
179
+ return 1;
180
+ }
181
+ }
182
+ if( iHType==0 ){
183
+ switch( g.eHashPolicy ){
184
+ case HPOLICY_SHA1:
185
+ case HPOLICY_AUTO:
186
+ sha1sum_blob(pContent, pHashOut);
187
+ return 1;
188
+ case HPOLICY_SHA3:
189
+ case HPOLICY_SHA3_ONLY:
190
+ case HPOLICY_SHUN_SHA1:
191
+ sha3sum_blob(pContent, 256, pHashOut);
192
+ return 1;
193
+ }
194
+ }
195
+ blob_init(pHashOut, 0, 0);
196
+ return 0;
197
+}
198
+
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
+
224
+/* Return the name of the current hash policy.
225
+*/
226
+const char *hpolicy_name(void){
227
+ return azPolicy[g.eHashPolicy];
228
+}
229
+
230
+
231
+/*
232
+** COMMAND: hash-policy*
233
+**
234
+** Usage: fossil hash-policy ?NEW-POLICY?
235
+**
236
+** Query or set the hash policy for the current repository. Available hash
237
+** policies are as follows:
238
+**
239
+** sha1 New artifact names are created using SHA1
240
+**
241
+** auto New artifact names are created using SHA1, but
242
+** automatically change the policy to "sha3" when
243
+** any SHA3 artifact enters the repository.
244
+**
245
+** sha3 New artifact names are created using SHA3, but
246
+** older artifacts with SHA1 names may be reused.
247
+**
248
+** sha3-only Use only SHA3 artifact names. Do not reuse legacy
249
+** SHA1 names.
250
+**
251
+** shun-sha1 Shun any SHA1 artifacts received by sync operations
252
+** other than clones. Older legacy SHA1 artifacts are
253
+** are allowed during a clone.
254
+**
255
+** The default hash policy for existing repositories is "auto", which will
256
+** immediately promote to "sha3" if the repository contains one or more
257
+** artifacts with SHA3 names. The default hash policy for new repositories
258
+** is "shun-sha1".
149259
*/
150
-void hname_hash(const Blob *pContent, unsigned int iHType, Blob *pHashOut){
151
-#if RELEASE_VERSION_NUMBER>=20100
152
- /* For Fossil 2.1 and later, the preferred hash algorithm is SHA3-256 and
153
- ** SHA1 is the secondary hash algorithm. */
154
- switch( iHType ){
155
- case 0: sha3sum_blob(pContent, 256, pHashOut); break;
156
- case 1: sha1sum_blob(pContent, pHashOut); break;
157
- }
158
-#else
159
- /* Prior to Fossil 2.1, the preferred hash algorithm is SHA1 (for backwards
160
- ** compatibility with Fossil 1.x) and SHA3-256 is the only auxiliary
161
- ** algorithm */
162
- switch( iHType ){
163
- case 0: sha1sum_blob(pContent, pHashOut); break;
164
- case 1: sha3sum_blob(pContent, 256, pHashOut); break;
165
- }
166
-#endif
260
+void hash_policy_command(void){
261
+ int i;
262
+ db_find_and_open_repository(0, 0);
263
+ if( g.argc!=2 && g.argc!=3 ) usage("?NEW-POLICY?");
264
+ if( g.argc==2 ){
265
+ fossil_print("%s\n", azPolicy[g.eHashPolicy]);
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]);
167283
}
168284
--- src/hname.c
+++ src/hname.c
@@ -16,11 +16,13 @@
16 *******************************************************************************
17 **
18 ** This file contains generic code for dealing with hashes used for
19 ** naming artifacts. Specific hash algorithms are implemented separately
20 ** (for example in sha1.c and sha3.c). This file contains the generic
21 ** interface code.
 
 
22 */
23 #include "config.h"
24 #include "hname.h"
25
26
@@ -47,10 +49,19 @@
47 /*
48 ** The number of distinct hash algorithms:
49 */
50 #define HNAME_COUNT 2 /* Just SHA1 and SHA3-256. Let's keep it that way! */
51
 
 
 
 
 
 
 
 
 
52 #endif /* INTERFACE */
53
54 /*
55 ** Return a human-readable name for the hash algorithm given a hash with
56 ** a length of nHash hexadecimal digits.
@@ -142,26 +153,131 @@
142
143 /*
144 ** Compute a hash on blob pContent. Write the hash into blob pHashOut.
145 ** This routine assumes that pHashOut is uninitialized.
146 **
147 ** The preferred hash is used for iHType==0, and various alternative hashes
148 ** are used for iHType>0 && iHType<NHAME_COUNT.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
149 */
150 void hname_hash(const Blob *pContent, unsigned int iHType, Blob *pHashOut){
151 #if RELEASE_VERSION_NUMBER>=20100
152 /* For Fossil 2.1 and later, the preferred hash algorithm is SHA3-256 and
153 ** SHA1 is the secondary hash algorithm. */
154 switch( iHType ){
155 case 0: sha3sum_blob(pContent, 256, pHashOut); break;
156 case 1: sha1sum_blob(pContent, pHashOut); break;
157 }
158 #else
159 /* Prior to Fossil 2.1, the preferred hash algorithm is SHA1 (for backwards
160 ** compatibility with Fossil 1.x) and SHA3-256 is the only auxiliary
161 ** algorithm */
162 switch( iHType ){
163 case 0: sha1sum_blob(pContent, pHashOut); break;
164 case 1: sha3sum_blob(pContent, 256, pHashOut); break;
165 }
166 #endif
 
 
 
 
 
 
167 }
168
--- src/hname.c
+++ src/hname.c
@@ -16,11 +16,13 @@
16 *******************************************************************************
17 **
18 ** This file contains generic code for dealing with hashes used for
19 ** naming artifacts. Specific hash algorithms are implemented separately
20 ** (for example in sha1.c and sha3.c). This file contains the generic
21 ** interface logic.
22 **
23 ** "hname" is intended to be an abbreviation of "hash name".
24 */
25 #include "config.h"
26 #include "hname.h"
27
28
@@ -47,10 +49,19 @@
49 /*
50 ** The number of distinct hash algorithms:
51 */
52 #define HNAME_COUNT 2 /* Just SHA1 and SHA3-256. Let's keep it that way! */
53
54 /*
55 ** Hash naming policies
56 */
57 #define HPOLICY_SHA1 0 /* Use SHA1 hashes */
58 #define HPOLICY_AUTO 1 /* SHA1 but auto-promote to SHA3 */
59 #define HPOLICY_SHA3 2 /* Use SHA3 hashes */
60 #define HPOLICY_SHA3_ONLY 3 /* Use SHA3 hashes exclusively */
61 #define HPOLICY_SHUN_SHA1 4 /* Shun all SHA1 objects */
62
63 #endif /* INTERFACE */
64
65 /*
66 ** Return a human-readable name for the hash algorithm given a hash with
67 ** a length of nHash hexadecimal digits.
@@ -142,26 +153,131 @@
153
154 /*
155 ** Compute a hash on blob pContent. Write the hash into blob pHashOut.
156 ** This routine assumes that pHashOut is uninitialized.
157 **
158 ** The preferred hash is used for iHType==0 and the alternative hash is
159 ** used if iHType==1. (The interface is designed to accommodate more than
160 ** just two hashes, but HNAME_COUNT is currently fixed at 2.)
161 **
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);
179 return 1;
180 }
181 }
182 if( iHType==0 ){
183 switch( g.eHashPolicy ){
184 case HPOLICY_SHA1:
185 case HPOLICY_AUTO:
186 sha1sum_blob(pContent, pHashOut);
187 return 1;
188 case HPOLICY_SHA3:
189 case HPOLICY_SHA3_ONLY:
190 case HPOLICY_SHUN_SHA1:
191 sha3sum_blob(pContent, 256, pHashOut);
192 return 1;
193 }
194 }
195 blob_init(pHashOut, 0, 0);
196 return 0;
197 }
198
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
224 /* Return the name of the current hash policy.
225 */
226 const char *hpolicy_name(void){
227 return azPolicy[g.eHashPolicy];
228 }
229
230
231 /*
232 ** COMMAND: hash-policy*
233 **
234 ** Usage: fossil hash-policy ?NEW-POLICY?
235 **
236 ** Query or set the hash policy for the current repository. Available hash
237 ** policies are as follows:
238 **
239 ** sha1 New artifact names are created using SHA1
240 **
241 ** auto New artifact names are created using SHA1, but
242 ** automatically change the policy to "sha3" when
243 ** any SHA3 artifact enters the repository.
244 **
245 ** sha3 New artifact names are created using SHA3, but
246 ** older artifacts with SHA1 names may be reused.
247 **
248 ** sha3-only Use only SHA3 artifact names. Do not reuse legacy
249 ** SHA1 names.
250 **
251 ** shun-sha1 Shun any SHA1 artifacts received by sync operations
252 ** other than clones. Older legacy SHA1 artifacts are
253 ** are allowed during a clone.
254 **
255 ** The default hash policy for existing repositories is "auto", which will
256 ** immediately promote to "sha3" if the repository contains one or more
257 ** artifacts with SHA3 names. The default hash policy for new repositories
258 ** is "shun-sha1".
259 */
260 void hash_policy_command(void){
261 int i;
262 db_find_and_open_repository(0, 0);
263 if( g.argc!=2 && g.argc!=3 ) usage("?NEW-POLICY?");
264 if( g.argc==2 ){
265 fossil_print("%s\n", azPolicy[g.eHashPolicy]);
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
+1
--- src/main.c
+++ src/main.c
@@ -140,10 +140,11 @@
140140
char *zLocalDbName; /* Name of the local database file */
141141
char *zOpenRevision; /* Check-in version to use during database open */
142142
int localOpen; /* True if the local database is open */
143143
char *zLocalRoot; /* The directory holding the local database */
144144
int minPrefix; /* Number of digits needed for a distinct UUID */
145
+ int eHashPolicy; /* Current hash policy. On of HPOLICY_* */
145146
int fNoDirSymlinks; /* True if --no-dir-symlinks flag is present */
146147
int fSqlTrace; /* True if --sqltrace flag is present */
147148
int fSqlStats; /* True if --sqltrace or --sqlstats are present */
148149
int fSqlPrint; /* True if -sqlprint flag is present */
149150
int fQuiet; /* True if -quiet flag is present */
150151
--- src/main.c
+++ src/main.c
@@ -140,10 +140,11 @@
140 char *zLocalDbName; /* Name of the local database file */
141 char *zOpenRevision; /* Check-in version to use during database open */
142 int localOpen; /* True if the local database is open */
143 char *zLocalRoot; /* The directory holding the local database */
144 int minPrefix; /* Number of digits needed for a distinct UUID */
 
145 int fNoDirSymlinks; /* True if --no-dir-symlinks flag is present */
146 int fSqlTrace; /* True if --sqltrace flag is present */
147 int fSqlStats; /* True if --sqltrace or --sqlstats are present */
148 int fSqlPrint; /* True if -sqlprint flag is present */
149 int fQuiet; /* True if -quiet flag is present */
150
--- src/main.c
+++ src/main.c
@@ -140,10 +140,11 @@
140 char *zLocalDbName; /* Name of the local database file */
141 char *zOpenRevision; /* Check-in version to use during database open */
142 int localOpen; /* True if the local database is open */
143 char *zLocalRoot; /* The directory holding the local database */
144 int minPrefix; /* Number of digits needed for a distinct UUID */
145 int eHashPolicy; /* Current hash policy. On of HPOLICY_* */
146 int fNoDirSymlinks; /* True if --no-dir-symlinks flag is present */
147 int fSqlTrace; /* True if --sqltrace flag is present */
148 int fSqlStats; /* True if --sqltrace or --sqlstats are present */
149 int fSqlPrint; /* True if -sqlprint flag is present */
150 int fQuiet; /* True if -quiet flag is present */
151
+1
--- src/shun.c
+++ src/shun.c
@@ -26,10 +26,11 @@
2626
*/
2727
int uuid_is_shunned(const char *zUuid){
2828
static Stmt q;
2929
int rc;
3030
if( zUuid==0 || zUuid[0]==0 ) return 0;
31
+ if( g.eHashPolicy==HPOLICY_SHUN_SHA1 && zUuid[HNAME_LEN_SHA1]==0 ) return 1;
3132
db_static_prepare(&q, "SELECT 1 FROM shun WHERE uuid=:uuid");
3233
db_bind_text(&q, ":uuid", zUuid);
3334
rc = db_step(&q);
3435
db_reset(&q);
3536
return rc==SQLITE_ROW;
3637
--- src/shun.c
+++ src/shun.c
@@ -26,10 +26,11 @@
26 */
27 int uuid_is_shunned(const char *zUuid){
28 static Stmt q;
29 int rc;
30 if( zUuid==0 || zUuid[0]==0 ) return 0;
 
31 db_static_prepare(&q, "SELECT 1 FROM shun WHERE uuid=:uuid");
32 db_bind_text(&q, ":uuid", zUuid);
33 rc = db_step(&q);
34 db_reset(&q);
35 return rc==SQLITE_ROW;
36
--- src/shun.c
+++ src/shun.c
@@ -26,10 +26,11 @@
26 */
27 int uuid_is_shunned(const char *zUuid){
28 static Stmt q;
29 int rc;
30 if( zUuid==0 || zUuid[0]==0 ) return 0;
31 if( g.eHashPolicy==HPOLICY_SHUN_SHA1 && zUuid[HNAME_LEN_SHA1]==0 ) return 1;
32 db_static_prepare(&q, "SELECT 1 FROM shun WHERE uuid=:uuid");
33 db_bind_text(&q, ":uuid", zUuid);
34 rc = db_step(&q);
35 db_reset(&q);
36 return rc==SQLITE_ROW;
37
+6 -1
--- src/stat.c
+++ src/stat.c
@@ -183,11 +183,16 @@
183183
@ (%h(RELEASE_VERSION)) <a href='version?verbose=1'>(details)</a>
184184
@ </td></tr>
185185
@ <tr><th>SQLite&nbsp;Version:</th><td>%.19s(sqlite3_sourceid())
186186
@ [%.10s(&sqlite3_sourceid()[20])] (%s(sqlite3_libversion()))
187187
@ <a href='version?verbose=2'>(details)</a></td></tr>
188
- @ <tr><th>Schema&nbsp;Version:</th><td>%h(g.zAuxSchema)</td></tr>
188
+ if( g.eHashPolicy!=HPOLICY_AUTO ){
189
+ @ <tr><th>Schema&nbsp;Version:</th><td>%h(g.zAuxSchema),
190
+ @ %s(hpolicy_name())</td></tr>
191
+ }else{
192
+ @ <tr><th>Schema&nbsp;Version:</th><td>%h(g.zAuxSchema)</td></tr>
193
+ }
189194
@ <tr><th>Repository Rebuilt:</th><td>
190195
@ %h(db_get_mtime("rebuilt","%Y-%m-%d %H:%M:%S","Never"))
191196
@ By Fossil %h(db_get("rebuilt","Unknown"))</td></tr>
192197
@ <tr><th>Database&nbsp;Stats:</th><td>
193198
@ %d(db_int(0, "PRAGMA repository.page_count")) pages,
194199
195200
ADDED www/hashpolicy.wiki
--- src/stat.c
+++ src/stat.c
@@ -183,11 +183,16 @@
183 @ (%h(RELEASE_VERSION)) <a href='version?verbose=1'>(details)</a>
184 @ </td></tr>
185 @ <tr><th>SQLite&nbsp;Version:</th><td>%.19s(sqlite3_sourceid())
186 @ [%.10s(&sqlite3_sourceid()[20])] (%s(sqlite3_libversion()))
187 @ <a href='version?verbose=2'>(details)</a></td></tr>
188 @ <tr><th>Schema&nbsp;Version:</th><td>%h(g.zAuxSchema)</td></tr>
 
 
 
 
 
189 @ <tr><th>Repository Rebuilt:</th><td>
190 @ %h(db_get_mtime("rebuilt","%Y-%m-%d %H:%M:%S","Never"))
191 @ By Fossil %h(db_get("rebuilt","Unknown"))</td></tr>
192 @ <tr><th>Database&nbsp;Stats:</th><td>
193 @ %d(db_int(0, "PRAGMA repository.page_count")) pages,
194
195 DDED www/hashpolicy.wiki
--- src/stat.c
+++ src/stat.c
@@ -183,11 +183,16 @@
183 @ (%h(RELEASE_VERSION)) <a href='version?verbose=1'>(details)</a>
184 @ </td></tr>
185 @ <tr><th>SQLite&nbsp;Version:</th><td>%.19s(sqlite3_sourceid())
186 @ [%.10s(&sqlite3_sourceid()[20])] (%s(sqlite3_libversion()))
187 @ <a href='version?verbose=2'>(details)</a></td></tr>
188 if( g.eHashPolicy!=HPOLICY_AUTO ){
189 @ <tr><th>Schema&nbsp;Version:</th><td>%h(g.zAuxSchema),
190 @ %s(hpolicy_name())</td></tr>
191 }else{
192 @ <tr><th>Schema&nbsp;Version:</th><td>%h(g.zAuxSchema)</td></tr>
193 }
194 @ <tr><th>Repository Rebuilt:</th><td>
195 @ %h(db_get_mtime("rebuilt","%Y-%m-%d %H:%M:%S","Never"))
196 @ By Fossil %h(db_get("rebuilt","Unknown"))</td></tr>
197 @ <tr><th>Database&nbsp;Stats:</th><td>
198 @ %d(db_int(0, "PRAGMA repository.page_count")) pages,
199
200 DDED www/hashpolicy.wiki
--- a/www/hashpolicy.wiki
+++ b/www/hashpolicy.wiki
@@ -0,0 +1,20 @@
1
+<title>Hash Policy</title>
2
+
3
+<h2> Executive Summary, Orcutive Summary</h2>
4
+
5
+<b>Or: How To </h2>
6
+
7
+There i This Article</b>
8
+
9
+Thham now
10
+upgraded to
11
+change texpected to be
12
+replaced ot expected to be
13
+replaced until Ma
14
+out o
15
+Debian 9 is implement0 or later
16
+
17
+work and
18
+Hash Policy</title>
19
+
20
+<h2>< Introduction ha", not generic SHA1sequel panded the to allow artifacts to
--- a/www/hashpolicy.wiki
+++ b/www/hashpolicy.wiki
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
--- a/www/hashpolicy.wiki
+++ b/www/hashpolicy.wiki
@@ -0,0 +1,20 @@
1 <title>Hash Policy</title>
2
3 <h2> Executive Summary, Orcutive Summary</h2>
4
5 <b>Or: How To </h2>
6
7 There i This Article</b>
8
9 Thham now
10 upgraded to
11 change texpected to be
12 replaced ot expected to be
13 replaced until Ma
14 out o
15 Debian 9 is implement0 or later
16
17 work and
18 Hash Policy</title>
19
20 <h2>< Introduction ha", not generic SHA1sequel panded the to allow artifacts to
--- www/mkindex.tcl
+++ www/mkindex.tcl
@@ -36,10 +36,11 @@
3636
fiveminutes.wiki {Update and Running in 5 Minutes as a Single User}
3737
foss-cklist.wiki {Checklist For Successful Open-Source Projects}
3838
fossil-from-msvc.wiki {Integrating Fossil in the Microsoft Express 2010 IDE}
3939
fossil-v-git.wiki {Fossil Versus Git}
4040
hacker-howto.wiki {Hacker How-To}
41
+ hashpolicy.wiki {Hash Policy: Choosing Between SHA1 and SHA3-256}
4142
/help {Lists of Commands and Webpages}
4243
hints.wiki {Fossil Tips And Usage Hints}
4344
index.wiki {Home Page}
4445
inout.wiki {Import And Export To And From Git}
4546
makefile.wiki {The Fossil Build Process}
4647
--- www/mkindex.tcl
+++ www/mkindex.tcl
@@ -36,10 +36,11 @@
36 fiveminutes.wiki {Update and Running in 5 Minutes as a Single User}
37 foss-cklist.wiki {Checklist For Successful Open-Source Projects}
38 fossil-from-msvc.wiki {Integrating Fossil in the Microsoft Express 2010 IDE}
39 fossil-v-git.wiki {Fossil Versus Git}
40 hacker-howto.wiki {Hacker How-To}
 
41 /help {Lists of Commands and Webpages}
42 hints.wiki {Fossil Tips And Usage Hints}
43 index.wiki {Home Page}
44 inout.wiki {Import And Export To And From Git}
45 makefile.wiki {The Fossil Build Process}
46
--- www/mkindex.tcl
+++ www/mkindex.tcl
@@ -36,10 +36,11 @@
36 fiveminutes.wiki {Update and Running in 5 Minutes as a Single User}
37 foss-cklist.wiki {Checklist For Successful Open-Source Projects}
38 fossil-from-msvc.wiki {Integrating Fossil in the Microsoft Express 2010 IDE}
39 fossil-v-git.wiki {Fossil Versus Git}
40 hacker-howto.wiki {Hacker How-To}
41 hashpolicy.wiki {Hash Policy: Choosing Between SHA1 and SHA3-256}
42 /help {Lists of Commands and Webpages}
43 hints.wiki {Fossil Tips And Usage Hints}
44 index.wiki {Home Page}
45 inout.wiki {Import And Export To And From Git}
46 makefile.wiki {The Fossil Build Process}
47
--- www/permutedindex.html
+++ www/permutedindex.html
@@ -29,10 +29,11 @@
2929
<li><a href="blame.wiki">Annotate/Blame Algorithm Of Fossil &mdash; The</a></li>
3030
<li><a href="customskin.md">Appearance of Web Pages &mdash; Theming: Customizing The</a></li>
3131
<li><a href="faq.wiki">Asked Questions &mdash; Frequently</a></li>
3232
<li><a href="password.wiki">Authentication &mdash; Password Management And</a></li>
3333
<li><a href="whyusefossil.wiki"><b>Benefits Of Version Control</b></a></li>
34
+<li><a href="hashpolicy.wiki">Between SHA1 and SHA3-256 &mdash; Hash Policy: Choosing</a></li>
3435
<li><a href="antibot.wiki">Bots &mdash; Defense against Spiders and</a></li>
3536
<li><a href="private.wiki">Branches &mdash; Creating, Syncing, and Deleting Private</a></li>
3637
<li><a href="branching.wiki"><b>Branching, Forking, Merging, and Tagging</b></a></li>
3738
<li><a href="bugtheory.wiki"><b>Bug Tracking In Fossil</b></a></li>
3839
<li><a href="makefile.wiki">Build Process &mdash; The Fossil</a></li>
@@ -43,10 +44,11 @@
4344
<li><a href="checkin.wiki">Checklist &mdash; Check-in</a></li>
4445
<li><a href="../test/release-checklist.wiki">Checklist &mdash; Pre-Release Testing</a></li>
4546
<li><a href="foss-cklist.wiki"><b>Checklist For Successful Open-Source Projects</b></a></li>
4647
<li><a href="selfcheck.wiki">Checks &mdash; Fossil Repository Integrity Self</a></li>
4748
<li><a href="childprojects.wiki"><b>Child Projects</b></a></li>
49
+<li><a href="hashpolicy.wiki">Choosing Between SHA1 and SHA3-256 &mdash; Hash Policy:</a></li>
4850
<li><a href="contribute.wiki">Code or Documentation To The Fossil Project &mdash; Contributing</a></li>
4951
<li><a href="style.wiki">Code Style Guidelines &mdash; Source</a></li>
5052
<li><a href="../../../help">Commands and Webpages &mdash; Lists of</a></li>
5153
<li><a href="build.wiki"><b>Compiling and Installing Fossil</b></a></li>
5254
<li><a href="concepts.wiki">Concepts &mdash; Fossil Core</a></li>
@@ -111,10 +113,11 @@
111113
<li><a href="customgraph.md">Graph &mdash; Theming: Customizing the Timeline</a></li>
112114
<li><a href="quickstart.wiki">Guide &mdash; Fossil Quick Start</a></li>
113115
<li><a href="style.wiki">Guidelines &mdash; Source Code Style</a></li>
114116
<li><a href="hacker-howto.wiki"><b>Hacker How-To</b></a></li>
115117
<li><a href="adding_code.wiki"><b>Hacking Fossil</b></a></li>
118
+<li><a href="hashpolicy.wiki"><b>Hash Policy: Choosing Between SHA1 and SHA3-256</b></a></li>
116119
<li><a href="hints.wiki">Hints &mdash; Fossil Tips And Usage</a></li>
117120
<li><a href="index.wiki"><b>Home Page</b></a></li>
118121
<li><a href="selfhost.wiki">Hosting Repositories &mdash; Fossil Self</a></li>
119122
<li><a href="aboutcgi.wiki"><b>How CGI Works In Fossil</b></a></li>
120123
<li><a href="server.wiki"><b>How To Configure A Fossil Server</b></a></li>
@@ -147,10 +150,11 @@
147150
<li><a href="index.wiki">Page &mdash; Home</a></li>
148151
<li><a href="customskin.md">Pages &mdash; Theming: Customizing The Appearance of Web</a></li>
149152
<li><a href="password.wiki"><b>Password Management And Authentication</b></a></li>
150153
<li><a href="quotes.wiki">People Are Saying About Fossil, Git, and DVCSes in General &mdash; Quotes: What</a></li>
151154
<li><a href="stats.wiki"><b>Performance Statistics</b></a></li>
155
+<li><a href="hashpolicy.wiki">Policy: Choosing Between SHA1 and SHA3-256 &mdash; Hash</a></li>
152156
<li><a href="../test/release-checklist.wiki"><b>Pre-Release Testing Checklist</b></a></li>
153157
<li><a href="pop.wiki"><b>Principles Of Operation</b></a></li>
154158
<li><a href="private.wiki">Private Branches &mdash; Creating, Syncing, and Deleting</a></li>
155159
<li><a href="makefile.wiki">Process &mdash; The Fossil Build</a></li>
156160
<li><a href="contribute.wiki">Project &mdash; Contributing Code or Documentation To The Fossil</a></li>
@@ -174,10 +178,12 @@
174178
<li><a href="th1.md">Scripting Language &mdash; The TH1</a></li>
175179
<li><a href="selfcheck.wiki">Self Checks &mdash; Fossil Repository Integrity</a></li>
176180
<li><a href="selfhost.wiki">Self Hosting Repositories &mdash; Fossil</a></li>
177181
<li><a href="server.wiki">Server &mdash; How To Configure A Fossil</a></li>
178182
<li><a href="settings.wiki">Settings &mdash; Fossil</a></li>
183
+<li><a href="hashpolicy.wiki">SHA1 and SHA3-256 &mdash; Hash Policy: Choosing Between</a></li>
184
+<li><a href="hashpolicy.wiki">SHA3-256 &mdash; Hash Policy: Choosing Between SHA1 and</a></li>
179185
<li><a href="shunning.wiki"><b>Shunning: Deleting Content From Fossil</b></a></li>
180186
<li><a href="fiveminutes.wiki">Single User &mdash; Update and Running in 5 Minutes as a</a></li>
181187
<li><a href="../../../sitemap"><b>Site Map</b></a></li>
182188
<li><a href="style.wiki"><b>Source Code Style Guidelines</b></a></li>
183189
<li><a href="antibot.wiki">Spiders and Bots &mdash; Defense against</a></li>
184190
--- www/permutedindex.html
+++ www/permutedindex.html
@@ -29,10 +29,11 @@
29 <li><a href="blame.wiki">Annotate/Blame Algorithm Of Fossil &mdash; The</a></li>
30 <li><a href="customskin.md">Appearance of Web Pages &mdash; Theming: Customizing The</a></li>
31 <li><a href="faq.wiki">Asked Questions &mdash; Frequently</a></li>
32 <li><a href="password.wiki">Authentication &mdash; Password Management And</a></li>
33 <li><a href="whyusefossil.wiki"><b>Benefits Of Version Control</b></a></li>
 
34 <li><a href="antibot.wiki">Bots &mdash; Defense against Spiders and</a></li>
35 <li><a href="private.wiki">Branches &mdash; Creating, Syncing, and Deleting Private</a></li>
36 <li><a href="branching.wiki"><b>Branching, Forking, Merging, and Tagging</b></a></li>
37 <li><a href="bugtheory.wiki"><b>Bug Tracking In Fossil</b></a></li>
38 <li><a href="makefile.wiki">Build Process &mdash; The Fossil</a></li>
@@ -43,10 +44,11 @@
43 <li><a href="checkin.wiki">Checklist &mdash; Check-in</a></li>
44 <li><a href="../test/release-checklist.wiki">Checklist &mdash; Pre-Release Testing</a></li>
45 <li><a href="foss-cklist.wiki"><b>Checklist For Successful Open-Source Projects</b></a></li>
46 <li><a href="selfcheck.wiki">Checks &mdash; Fossil Repository Integrity Self</a></li>
47 <li><a href="childprojects.wiki"><b>Child Projects</b></a></li>
 
48 <li><a href="contribute.wiki">Code or Documentation To The Fossil Project &mdash; Contributing</a></li>
49 <li><a href="style.wiki">Code Style Guidelines &mdash; Source</a></li>
50 <li><a href="../../../help">Commands and Webpages &mdash; Lists of</a></li>
51 <li><a href="build.wiki"><b>Compiling and Installing Fossil</b></a></li>
52 <li><a href="concepts.wiki">Concepts &mdash; Fossil Core</a></li>
@@ -111,10 +113,11 @@
111 <li><a href="customgraph.md">Graph &mdash; Theming: Customizing the Timeline</a></li>
112 <li><a href="quickstart.wiki">Guide &mdash; Fossil Quick Start</a></li>
113 <li><a href="style.wiki">Guidelines &mdash; Source Code Style</a></li>
114 <li><a href="hacker-howto.wiki"><b>Hacker How-To</b></a></li>
115 <li><a href="adding_code.wiki"><b>Hacking Fossil</b></a></li>
 
116 <li><a href="hints.wiki">Hints &mdash; Fossil Tips And Usage</a></li>
117 <li><a href="index.wiki"><b>Home Page</b></a></li>
118 <li><a href="selfhost.wiki">Hosting Repositories &mdash; Fossil Self</a></li>
119 <li><a href="aboutcgi.wiki"><b>How CGI Works In Fossil</b></a></li>
120 <li><a href="server.wiki"><b>How To Configure A Fossil Server</b></a></li>
@@ -147,10 +150,11 @@
147 <li><a href="index.wiki">Page &mdash; Home</a></li>
148 <li><a href="customskin.md">Pages &mdash; Theming: Customizing The Appearance of Web</a></li>
149 <li><a href="password.wiki"><b>Password Management And Authentication</b></a></li>
150 <li><a href="quotes.wiki">People Are Saying About Fossil, Git, and DVCSes in General &mdash; Quotes: What</a></li>
151 <li><a href="stats.wiki"><b>Performance Statistics</b></a></li>
 
152 <li><a href="../test/release-checklist.wiki"><b>Pre-Release Testing Checklist</b></a></li>
153 <li><a href="pop.wiki"><b>Principles Of Operation</b></a></li>
154 <li><a href="private.wiki">Private Branches &mdash; Creating, Syncing, and Deleting</a></li>
155 <li><a href="makefile.wiki">Process &mdash; The Fossil Build</a></li>
156 <li><a href="contribute.wiki">Project &mdash; Contributing Code or Documentation To The Fossil</a></li>
@@ -174,10 +178,12 @@
174 <li><a href="th1.md">Scripting Language &mdash; The TH1</a></li>
175 <li><a href="selfcheck.wiki">Self Checks &mdash; Fossil Repository Integrity</a></li>
176 <li><a href="selfhost.wiki">Self Hosting Repositories &mdash; Fossil</a></li>
177 <li><a href="server.wiki">Server &mdash; How To Configure A Fossil</a></li>
178 <li><a href="settings.wiki">Settings &mdash; Fossil</a></li>
 
 
179 <li><a href="shunning.wiki"><b>Shunning: Deleting Content From Fossil</b></a></li>
180 <li><a href="fiveminutes.wiki">Single User &mdash; Update and Running in 5 Minutes as a</a></li>
181 <li><a href="../../../sitemap"><b>Site Map</b></a></li>
182 <li><a href="style.wiki"><b>Source Code Style Guidelines</b></a></li>
183 <li><a href="antibot.wiki">Spiders and Bots &mdash; Defense against</a></li>
184
--- www/permutedindex.html
+++ www/permutedindex.html
@@ -29,10 +29,11 @@
29 <li><a href="blame.wiki">Annotate/Blame Algorithm Of Fossil &mdash; The</a></li>
30 <li><a href="customskin.md">Appearance of Web Pages &mdash; Theming: Customizing The</a></li>
31 <li><a href="faq.wiki">Asked Questions &mdash; Frequently</a></li>
32 <li><a href="password.wiki">Authentication &mdash; Password Management And</a></li>
33 <li><a href="whyusefossil.wiki"><b>Benefits Of Version Control</b></a></li>
34 <li><a href="hashpolicy.wiki">Between SHA1 and SHA3-256 &mdash; Hash Policy: Choosing</a></li>
35 <li><a href="antibot.wiki">Bots &mdash; Defense against Spiders and</a></li>
36 <li><a href="private.wiki">Branches &mdash; Creating, Syncing, and Deleting Private</a></li>
37 <li><a href="branching.wiki"><b>Branching, Forking, Merging, and Tagging</b></a></li>
38 <li><a href="bugtheory.wiki"><b>Bug Tracking In Fossil</b></a></li>
39 <li><a href="makefile.wiki">Build Process &mdash; The Fossil</a></li>
@@ -43,10 +44,11 @@
44 <li><a href="checkin.wiki">Checklist &mdash; Check-in</a></li>
45 <li><a href="../test/release-checklist.wiki">Checklist &mdash; Pre-Release Testing</a></li>
46 <li><a href="foss-cklist.wiki"><b>Checklist For Successful Open-Source Projects</b></a></li>
47 <li><a href="selfcheck.wiki">Checks &mdash; Fossil Repository Integrity Self</a></li>
48 <li><a href="childprojects.wiki"><b>Child Projects</b></a></li>
49 <li><a href="hashpolicy.wiki">Choosing Between SHA1 and SHA3-256 &mdash; Hash Policy:</a></li>
50 <li><a href="contribute.wiki">Code or Documentation To The Fossil Project &mdash; Contributing</a></li>
51 <li><a href="style.wiki">Code Style Guidelines &mdash; Source</a></li>
52 <li><a href="../../../help">Commands and Webpages &mdash; Lists of</a></li>
53 <li><a href="build.wiki"><b>Compiling and Installing Fossil</b></a></li>
54 <li><a href="concepts.wiki">Concepts &mdash; Fossil Core</a></li>
@@ -111,10 +113,11 @@
113 <li><a href="customgraph.md">Graph &mdash; Theming: Customizing the Timeline</a></li>
114 <li><a href="quickstart.wiki">Guide &mdash; Fossil Quick Start</a></li>
115 <li><a href="style.wiki">Guidelines &mdash; Source Code Style</a></li>
116 <li><a href="hacker-howto.wiki"><b>Hacker How-To</b></a></li>
117 <li><a href="adding_code.wiki"><b>Hacking Fossil</b></a></li>
118 <li><a href="hashpolicy.wiki"><b>Hash Policy: Choosing Between SHA1 and SHA3-256</b></a></li>
119 <li><a href="hints.wiki">Hints &mdash; Fossil Tips And Usage</a></li>
120 <li><a href="index.wiki"><b>Home Page</b></a></li>
121 <li><a href="selfhost.wiki">Hosting Repositories &mdash; Fossil Self</a></li>
122 <li><a href="aboutcgi.wiki"><b>How CGI Works In Fossil</b></a></li>
123 <li><a href="server.wiki"><b>How To Configure A Fossil Server</b></a></li>
@@ -147,10 +150,11 @@
150 <li><a href="index.wiki">Page &mdash; Home</a></li>
151 <li><a href="customskin.md">Pages &mdash; Theming: Customizing The Appearance of Web</a></li>
152 <li><a href="password.wiki"><b>Password Management And Authentication</b></a></li>
153 <li><a href="quotes.wiki">People Are Saying About Fossil, Git, and DVCSes in General &mdash; Quotes: What</a></li>
154 <li><a href="stats.wiki"><b>Performance Statistics</b></a></li>
155 <li><a href="hashpolicy.wiki">Policy: Choosing Between SHA1 and SHA3-256 &mdash; Hash</a></li>
156 <li><a href="../test/release-checklist.wiki"><b>Pre-Release Testing Checklist</b></a></li>
157 <li><a href="pop.wiki"><b>Principles Of Operation</b></a></li>
158 <li><a href="private.wiki">Private Branches &mdash; Creating, Syncing, and Deleting</a></li>
159 <li><a href="makefile.wiki">Process &mdash; The Fossil Build</a></li>
160 <li><a href="contribute.wiki">Project &mdash; Contributing Code or Documentation To The Fossil</a></li>
@@ -174,10 +178,12 @@
178 <li><a href="th1.md">Scripting Language &mdash; The TH1</a></li>
179 <li><a href="selfcheck.wiki">Self Checks &mdash; Fossil Repository Integrity</a></li>
180 <li><a href="selfhost.wiki">Self Hosting Repositories &mdash; Fossil</a></li>
181 <li><a href="server.wiki">Server &mdash; How To Configure A Fossil</a></li>
182 <li><a href="settings.wiki">Settings &mdash; Fossil</a></li>
183 <li><a href="hashpolicy.wiki">SHA1 and SHA3-256 &mdash; Hash Policy: Choosing Between</a></li>
184 <li><a href="hashpolicy.wiki">SHA3-256 &mdash; Hash Policy: Choosing Between SHA1 and</a></li>
185 <li><a href="shunning.wiki"><b>Shunning: Deleting Content From Fossil</b></a></li>
186 <li><a href="fiveminutes.wiki">Single User &mdash; Update and Running in 5 Minutes as a</a></li>
187 <li><a href="../../../sitemap"><b>Site Map</b></a></li>
188 <li><a href="style.wiki"><b>Source Code Style Guidelines</b></a></li>
189 <li><a href="antibot.wiki">Spiders and Bots &mdash; Defense against</a></li>
190

Keyboard Shortcuts

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