@@ -532,21 +532,20 @@ void parse_args(int argc, char* argv[])
532
532
}
533
533
534
534
// sha256sum mode
535
- if (( argc == 3 || ( argc == 4 && strcmp ( argv [ 2 ], "--skip-end" ))) && strcmp (argv [1 ], "sha256sum" ) == 0 )
535
+ if (argc == 3 && strcmp (argv [1 ], "sha256sum" ) == 0 )
536
536
{
537
- const bool skip_end = argc == 4 ;
538
537
// Enable stdout printing
539
538
cli_mode = true;
540
539
uint8_t checksum [SHA256_DIGEST_SIZE ];
541
- if (!sha256sum (argv [skip_end ? 3 : 2 ], checksum , skip_end ))
540
+ if (!sha256sum (argv [2 ], checksum , false ))
542
541
exit (EXIT_FAILURE );
543
542
544
543
// Convert checksum to hex string
545
544
char hex [SHA256_DIGEST_SIZE * 2 + 1 ];
546
545
sha256_raw_to_hex (checksum , hex );
547
546
548
547
// Print result
549
- printf ("%s %s\n" , hex , argv [skip_end ? 3 : 2 ]);
548
+ printf ("%s %s\n" , hex , argv [2 ]);
550
549
exit (EXIT_SUCCESS );
551
550
}
552
551
@@ -1097,12 +1096,11 @@ void parse_args(int argc, char* argv[])
1097
1096
printf (" Usage: %spihole-FTL ntp %s[server]%s %s[--update]%s\n\n" , green , cyan , normal , purple , normal );
1098
1097
1099
1098
printf ("%sSHA256 checksum tools:%s\n" , yellow , normal );
1100
- printf (" Calculates the SHA256 checksum of a file.\n\n" );
1099
+ printf (" Calculates the SHA256 checksum of a file. The checksum is\n" );
1100
+ printf (" computed as described in FIPS-180-2 and uses straeaming\n" );
1101
+ printf (" to allow processing arbitrary large files with a small\n" );
1102
+ printf (" memory footprint.\n\n" );
1101
1103
printf (" Usage: %spihole-FTL sha256sum %sfile%s\n\n" , green , cyan , normal );
1102
- printf (" The special flag %s--skip-end%s can be used to skip the last 32\n" , purple , normal );
1103
- printf (" bytes of the file. This is useful for files which have their\n" );
1104
- printf (" checksum appended at the end of the file, e.g., pihole-FTL:\n\n" );
1105
- printf (" %spihole-FTL sha256sum %s--skip_end %sfile%s\n\n" , green , purple , cyan , normal );
1106
1104
1107
1105
printf ("%sOther:%s\n" , yellow , normal );
1108
1106
printf ("\t%sverify%s Verify the integrity of the FTL binary\n" , green , normal );
0 commit comments