Fossil SCM

Fix the "fossil sha3sum" command so that it accepts "-" to mean stdin. Clarify the algorithm used.

drh 2017-06-07 15:55 trunk
Commit 86fa03adb1119b7eb187c57ba30e54c6bf3a52f2223cb095578882d34245b407
2 files changed +1 -1 +3
+1 -1
--- src/main.c
+++ src/main.c
@@ -889,11 +889,11 @@
889889
** an error message and quit.
890890
*/
891891
void verify_all_options(void){
892892
int i;
893893
for(i=1; i<g.argc; i++){
894
- if( g.argv[i][0]=='-' ){
894
+ if( g.argv[i][0]=='-' && g.argv[i][1]!=0 ){
895895
fossil_fatal(
896896
"unrecognized command-line option, or missing argument: %s",
897897
g.argv[i]);
898898
}
899899
}
900900
--- src/main.c
+++ src/main.c
@@ -889,11 +889,11 @@
889 ** an error message and quit.
890 */
891 void verify_all_options(void){
892 int i;
893 for(i=1; i<g.argc; i++){
894 if( g.argv[i][0]=='-' ){
895 fossil_fatal(
896 "unrecognized command-line option, or missing argument: %s",
897 g.argv[i]);
898 }
899 }
900
--- src/main.c
+++ src/main.c
@@ -889,11 +889,11 @@
889 ** an error message and quit.
890 */
891 void verify_all_options(void){
892 int i;
893 for(i=1; i<g.argc; i++){
894 if( g.argv[i][0]=='-' && g.argv[i][1]!=0 ){
895 fossil_fatal(
896 "unrecognized command-line option, or missing argument: %s",
897 g.argv[i]);
898 }
899 }
900
+3
--- src/sha3.c
+++ src/sha3.c
@@ -624,10 +624,13 @@
624624
** Usage: %fossil sha3sum FILE...
625625
**
626626
** Compute an SHA3 checksum of all files named on the command-line.
627627
** If a file is named "-" then take its content from standard input.
628628
**
629
+** To be clear: The official NIST FIPS-202 implementation of SHA3
630
+** with the added 01 padding is used, not the original Keccak submission.
631
+**
629632
** Options:
630633
**
631634
** --224 Compute a SHA3-224 hash
632635
** --256 Compute a SHA3-256 hash (the default)
633636
** --384 Compute a SHA3-384 hash
634637
--- src/sha3.c
+++ src/sha3.c
@@ -624,10 +624,13 @@
624 ** Usage: %fossil sha3sum FILE...
625 **
626 ** Compute an SHA3 checksum of all files named on the command-line.
627 ** If a file is named "-" then take its content from standard input.
628 **
 
 
 
629 ** Options:
630 **
631 ** --224 Compute a SHA3-224 hash
632 ** --256 Compute a SHA3-256 hash (the default)
633 ** --384 Compute a SHA3-384 hash
634
--- src/sha3.c
+++ src/sha3.c
@@ -624,10 +624,13 @@
624 ** Usage: %fossil sha3sum FILE...
625 **
626 ** Compute an SHA3 checksum of all files named on the command-line.
627 ** If a file is named "-" then take its content from standard input.
628 **
629 ** To be clear: The official NIST FIPS-202 implementation of SHA3
630 ** with the added 01 padding is used, not the original Keccak submission.
631 **
632 ** Options:
633 **
634 ** --224 Compute a SHA3-224 hash
635 ** --256 Compute a SHA3-256 hash (the default)
636 ** --384 Compute a SHA3-384 hash
637

Keyboard Shortcuts

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