Imported Upstream version 2.7
[ossec-hids.git] / src / os_crypto / sha1 / main.c
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <string.h>
4
5 #include "sha1_op.h"
6
7 void usage(char **argv)
8 {
9     printf("%s file\n", argv[0]);
10     exit(1);
11 }
12
13 /* make main to compile (after the make md5)
14  * Example of the md5 API use
15  * Daniel B. Cid, dcid@ossec.net
16  */
17 int main(int argc, char ** argv)
18 {
19     os_sha1 filesum;
20
21     if(argc < 2)
22         usage(argv);
23
24
25     if(OS_SHA1_File(argv[1], filesum) == 0)
26     {
27         printf("SHA1Sum for \"%s\" is: %s\n",argv[1],filesum);
28     }
29     else
30     {
31         printf("SHA1Sum for \"%s\" failed\n", argv[1]);
32     }
33     return(0);
34 }
35
36 /* EOF */