#include <stdio.h>
#include <string.h>
#include "hasher/hasher.h"
Include dependency graph for hashsum.c:
Defines | |
#define | COMMENT |
#define | __USE_BSD |
#define | READ_SIZE |
#define | WRAPPER(NAME, ALGO) |
#define | CHECK_ALGO() |
Functions | |
int | misuse (int argL, char *arg[], const char *msg) |
int | hashsum_file (FILE *file, const char *path, const char *app, hasher_t *h, char **msg) |
int | main (int argL, char *arg[]) |
Variables | |
const char* | E_no_hash = "No hash algorithm specified\n" |
const char * | E_no_hash_yet = "File argument found, but no hash algorithm yet specified\n" |
const char * | E_fopen_fail = "Could not open file %s\n" |
const char * | E_error_read = "%s: error reading %s\n" |
const char * | E_blank = "" |
|
Value: {\ if (!algochecked) {\ if (algostr == NULL)\ return misuse(argL, arg, E_no_hash_yet);\ if (strcasecmp(algostr, "md5") == 0)\ fprintf(stderr, "md5 is not secure. Refer to van Oorschot's paper:\n"\ " http://www.rsasecurity.com/rsalabs/faq/3-6-6.html\n");\ algochecked = 1;\ }\ }\ |
|
Value: Created: July 20th, 2001 The following program code is released under the GPL license http://www.gnu.org/copyleft/gpl.html |
|
Value: 1024 |
|
Value: if (strlen(NAME) <= strlen(arg[0])) {\ if (strcasecmp(NAME, &arg[0][strlen(arg[0])-strlen(NAME)]) == 0) {\ algostr = ALGO;\ if (hasher_setup(&H, algostr) != HASHER_OK)\ return misuse(argL, arg, hasher_ret_msg(H.err));\ }\ } |
|
Value: |
|
Calculate and print the digest of a given file pointer
|
|
|
|
Print an error message
|
|
Empty error message |
|
When opening a file fails, eg. directory |
|
When opening a file fails, eg. permission denied |
|
When no algorithm is specified |
|
When files are specified but no algorithm |
![]() |
Confidential |