]> www.wagner.pp.ru Git - openssl-gost/engine.git/commitdiff
Added manual pages. Fixed help messages
authorVictor Wagner <vitus@wagner.pp.ru>
Wed, 2 Aug 2017 18:15:24 +0000 (21:15 +0300)
committerVictor Wagner <vitus@wagner.pp.ru>
Wed, 2 Aug 2017 18:15:24 +0000 (21:15 +0300)
gost12sum.1 [new file with mode: 0644]
gost12sum.c
gostsum.1 [new file with mode: 0644]

diff --git a/gost12sum.1 b/gost12sum.1
new file mode 100644 (file)
index 0000000..9c49e18
--- /dev/null
@@ -0,0 +1,84 @@
+.\" Hey, Emacs!  This is an -*- nroff -*- source file.
+.TH GOST12SUM 1 "02 Aug 2016" "Openssl" "Debian GNU/Linux"
+.SH NAME
+gost12sum \- generates or checks GOST R34.11-2012 message digests
+
+.SH SYNOPSIS
+.B gost12sum
+[\-bvl] [\-c [file]] | [file...]
+
+.SH DESCRIPTION
+.B gost12sum
+generates or checks GOST hash sums. The algorithm to generate the
+is reasonably fast and strong enough for most cases. Exact
+specification of the algorithm is in
+.I GOST R34.11-2012.
+
+Normally
+.B gost12sum
+generates checksums of all files given to it as a parameter and prints
+the checksums followed by the filenames. If, however,
+.B \-c
+is specified, only one filename parameter is allowed. This file should
+contain checksums and filenames to which these checksums refer to, and
+the files listed in that file are checked against the checksums listed
+there. See option
+.B \-c
+for more information.
+
+.SS OPTIONS
+.TP
+.B \-b
+Use binary mode. In unix environment, only difference between this and
+the normal mode is an asterisk preceding the filename in the output.
+.TP
+.B \-c
+Check gost hashes of all files listed in
+.I file
+against the checksum listed in the same file. The actual format of that
+file is the same as output of
+.B md5sum.
+That is, each line in the file describes a file. A line looks like:
+
+.B <hashsum>  <filename>
+
+So, for example, if a file was created and its message digest calculated
+like so:
+
+.B echo foo > hash\-test\-file; gost12sum hash\-test\-file
+
+.B gost12sum
+would report:
+
+3d4a51ee7713e6467442facefe06f153a303e7bdefbe7f9bdf2edb4ae9c866ff hash\-test\-file
+
+When invoked with \-c option
+.B gost12sum 
+normally works silently unless error found. Use \-v if you want to see
+list of successfully checked files
+
+.TP
+.B \-v
+Be more verbose. Print filenames when checking (with \-c).
+
+.TP
+.B -l 
+Use long (512-bit) hash instead of short (256-bit).
+
+.SH BUGS
+
+This manpage is not quite accurate and has formatting inconsistent
+with other manpages.
+
+.B gost12sum
+does not accept standard options like
+.BR \-\-help .
+
+.SH AUTHOR
+
+.B gost12sum
+utility written by Cryptocom LTD
+
+This manual page is written by Victor Wagner <vitus@wagner.pp.ru> for
+Debian GNU/Linux
+
index 4936d7e4b27217edeafd4ac3e1f6cae20d86be83..7c02c8e8918cfff81ab7c0b059a57b00c3a94820 100644 (file)
@@ -34,17 +34,18 @@ int hash_file(gost_hash_ctx * ctx, char *filename, char *sum, int mode);
 int hash_stream(gost_hash_ctx * ctx, int fd, char *sum);
 int get_line(FILE *f, char *hash, char *filename, int verbose);
 
-void help()
+void help(const char *progname)
 {
     fprintf(stderr, "Calculates GOST R 34.11-2012 hash function\n\n");
-    fprintf(stderr, "gostsum12 [-bvl] [-c [file]]| [files]|-x\n"
+    fprintf(stderr, "%s [-bvl] [-c [file]]| [files]|-x\n"
             "\t-c check message digests (default is generate)\n"
             "\t-v verbose, print file names when checking\n"
             "\t-b read files in binary mode\n"
             "\t-l use 512 bit hash (default 256 bit)\n"
             "\t-x read filenames from stdin rather than from arguments \n"
             "The input for -c should be the list of message digests and file names\n"
-            "that is printed on stdout by this program when it generates digests.\n");
+                  "that is printed on stdout by this program when it generates"
+                  "digests.\n", progname);
     exit(3);
 }
 
@@ -107,7 +108,7 @@ int main(int argc, char **argv)
             break;
         default:
             fprintf(stderr, "invalid option %c", optopt);
-            help();
+            help(argv[0]);
         }
     }
     if (check_file) {
diff --git a/gostsum.1 b/gostsum.1
new file mode 100644 (file)
index 0000000..cfd20f6
--- /dev/null
+++ b/gostsum.1
@@ -0,0 +1,79 @@
+.\" Hey, Emacs!  This is an -*- nroff -*- source file.
+.TH GOSTSUM 1 "02 Aug 2017" "Openssl" "Debian GNU/Linux"
+.SH NAME
+gostsum \- generates or checks GOST R34.11-94 message digests
+
+.SH SYNOPSIS
+.B gostsum
+[\-bvt] [\-c [file]] | [file...]
+
+.SH DESCRIPTION
+.B gostsum
+generates or checks GOST hash sums. The algorithm to generate the
+is reasonably fast and strong enough for most cases. Exact
+specification of the algorithm is in
+.I GOST R34.11-94.
+
+Normally
+.B gostsum
+generates checksums of all files given to it as a parameter and prints
+the checksums followed by the filenames. If, however,
+.B \-c
+is specified, only one filename parameter is allowed. This file should
+contain checksums and filenames to which these checksums refer to, and
+the files listed in that file are checked against the checksums listed
+there. See option
+.B \-c
+for more information.
+
+.SS OPTIONS
+.TP
+.B \-b
+Use binary mode. In unix environment, only difference between this and
+the normal mode is an asterisk preceding the filename in the output.
+.TP
+.B \-c
+Check gost hashes of all files listed in
+.I file
+against the checksum listed in the same file. The actual format of that
+file is the same as output of
+.B md5sum.
+That is, each line in the file describes a file. A line looks like:
+
+.B <hashsum>  <filename>
+
+So, for example, if a file was created and its message digest calculated
+like so:
+
+.B echo foo > hash\-test\-file; gostsum hash\-test\-file
+
+.B gostsum
+would report:
+
+1541e09d0aa5971f732991ae1bdfb63f2609edd7536b40f8c2ae7c1e2f99e072 hash-test-file
+
+.TP
+.B \-v
+Be more verbose. Print filenames when checking (with \-c).
+
+.TP
+.B -t 
+Use test parameter set. 
+.B gostsum supports two sets of parameters (which are really parameters
+of GOST 28147-89 block cipher) specified in the IETF draft 
+.B draft-popov-cryptopro-cpalgs-02.txt
+By default, cryptopro paramset is used. This option enables use of test
+paramset as specified in appendices to the GOST.
+
+.SH BUGS
+
+This manpage is not quite accurate and has formatting inconsistent
+with other manpages.
+
+.B gostsum
+does not accept standard options like
+.BR \-\-help .
+
+.SH AUTHOR
+       Victor Wagner <vitus@wagner.pp.ru>
+