Fossil

Check-in [86fa03ad]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix the "fossil sha3sum" command so that it accepts "-" to mean stdin. Clarify the algorithm used.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:86fa03adb1119b7eb187c57ba30e54c6bf3a52f2223cb095578882d34245b407
User & Date: drh 2017-06-07 15:55:47
Context
2017-06-08
12:50
Make sure fossil_strndup() always adds a zero terminator. check-in: 8707e869 user: drh tags: trunk
2017-06-07
15:55
Fix the "fossil sha3sum" command so that it accepts "-" to mean stdin. Clarify the algorithm used. check-in: 86fa03ad user: drh tags: trunk
2017-06-06
17:53
Bug fix in the sha3sum() routine. Also comment-out that routine since it is not used anyplace in the code. check-in: 6419592d user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/main.c.

887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
** Verify that there are no unprocessed command-line options.  If
** Any remaining command-line argument begins with "-" print
** an error message and quit.
*/
void verify_all_options(void){
  int i;
  for(i=1; i<g.argc; i++){
    if( g.argv[i][0]=='-' ){
      fossil_fatal(
        "unrecognized command-line option, or missing argument: %s",
        g.argv[i]);
    }
  }
}








|







887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
** Verify that there are no unprocessed command-line options.  If
** Any remaining command-line argument begins with "-" print
** an error message and quit.
*/
void verify_all_options(void){
  int i;
  for(i=1; i<g.argc; i++){
    if( g.argv[i][0]=='-' && g.argv[i][1]!=0 ){
      fossil_fatal(
        "unrecognized command-line option, or missing argument: %s",
        g.argv[i]);
    }
  }
}

Changes to src/sha3.c.

622
623
624
625
626
627
628



629
630
631
632
633
634
635
** COMMAND: sha3sum*
**
** Usage: %fossil sha3sum FILE...
**
** Compute an SHA3 checksum of all files named on the command-line.
** If a file is named "-" then take its content from standard input.
**



** Options:
**
**    --224        Compute a SHA3-224 hash
**    --256        Compute a SHA3-256 hash (the default)
**    --384        Compute a SHA3-384 hash
**    --512        Compute a SHA3-512 hash
**    --size N     An N-bit hash.  N must be a multiple of 32 between 128







>
>
>







622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
** COMMAND: sha3sum*
**
** Usage: %fossil sha3sum FILE...
**
** Compute an SHA3 checksum of all files named on the command-line.
** If a file is named "-" then take its content from standard input.
**
** To be clear:  The official NIST FIPS-202 implementation of SHA3
** with the added 01 padding is used, not the original Keccak submission.
**
** Options:
**
**    --224        Compute a SHA3-224 hash
**    --256        Compute a SHA3-256 hash (the default)
**    --384        Compute a SHA3-384 hash
**    --512        Compute a SHA3-512 hash
**    --size N     An N-bit hash.  N must be a multiple of 32 between 128