Support reading checksums from stdin
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
/* See LICENSE file for copyright and license details. */
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
@@ -25,16 +26,18 @@ main(int argc, char *argv[])
|
||||
{
|
||||
uint8_t md[SHA1_DIGEST_LENGTH];
|
||||
char *checkfile = NULL;
|
||||
bool cflag = false;
|
||||
|
||||
ARGBEGIN {
|
||||
case 'c':
|
||||
checkfile = EARGF(usage());
|
||||
cflag = true;
|
||||
checkfile = ARGF();
|
||||
break;
|
||||
default:
|
||||
usage();
|
||||
} ARGEND;
|
||||
|
||||
if(checkfile)
|
||||
if(cflag)
|
||||
return cryptcheck(checkfile, argc, argv, &sha1_ops, md, sizeof(md));
|
||||
return cryptmain(argc, argv, &sha1_ops, md, sizeof(md));
|
||||
}
|
||||
|
Reference in New Issue
Block a user