diff options
author | Jason McIntyre <jmc@cvs.openbsd.org> | 2004-05-04 18:32:52 +0000 |
---|---|---|
committer | Jason McIntyre <jmc@cvs.openbsd.org> | 2004-05-04 18:32:52 +0000 |
commit | 0162323249d08350390f94f368368d6bbef628da (patch) | |
tree | 27edc0ae9e70955d775327552ecc2f08e04ba253 /bin | |
parent | bc0459611ef65a529cbab2cb293ca63c522b9607 (diff) |
- simplify synopses
- correct macros
- various grammatical fixes
ok millert@
Diffstat (limited to 'bin')
-rw-r--r-- | bin/md5/cksum.1 | 87 | ||||
-rw-r--r-- | bin/md5/md5.1 | 19 | ||||
-rw-r--r-- | bin/md5/rmd160.1 | 21 | ||||
-rw-r--r-- | bin/md5/sha1.1 | 21 |
4 files changed, 77 insertions, 71 deletions
diff --git a/bin/md5/cksum.1 b/bin/md5/cksum.1 index ba56407811d..f083de1594e 100644 --- a/bin/md5/cksum.1 +++ b/bin/md5/cksum.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: cksum.1,v 1.1 2004/05/02 17:53:29 millert Exp $ +.\" $OpenBSD: cksum.1,v 1.2 2004/05/04 18:32:51 jmc Exp $ .\" .\" Copyright (c) 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -41,53 +41,49 @@ .Nd display file checksums and block counts .Sh SYNOPSIS .Nm cksum -.Oo Xo -.Fl a Ar cksum | Ar md4 | -.Ar md5 | Ar rmd160 | Ar sha1 | -.Ar sha256 | Ar sha384 | Ar sha512 | -.Ar sum | Ar sysvsum -.Xc -.Oc -.Op Fl o Ar \&1 | Ar \&2 +.Bk -words .Oo -.Fl p | Fl t | Fl x | +.Fl p | t | x | +.Fl c Oo Ar checklist ... Oc | .Fl s Ar string | -.Fl c Ar [ checklist ... ] | .Ar file ... .Oc +.Op Fl a Ar algorithm +.Op Fl o Ar 1 | 2 +.Ek .Nm sum .Op Ar file ... .Sh DESCRIPTION The .Nm cksum -utility writes to the standard output a single line each input file. +utility writes to the standard output a single line for each input file. The format of this line varies with the algorithm being used as follows: .Bl -tag -width Ds .It cksum The output line consists of three whitespace separated fields: a .Tn CRC -checksum, the number of octets in the input +checksum, the number of octets in the input, and name of the file or string. If no file name is specified, the standard input is used and no file name is written. .It sum The output line consists of three whitespace separated fields: a .Tn CRC -checksum, the number of kilobytes in the input +checksum, the number of kilobytes in the input, and name of the file or string. If no file name is specified, the standard input is used and no file name is written. .It sysvsum The output line consists of three whitespace separated fields: a .Tn CRC -checksum, the number of 512-byte blocks in the input +checksum, the number of 512-byte blocks in the input, and name of the file or string. If no file name is specified, the standard input is used and no file name is written. .It all others The output line consists of four whitespace separated fields: the name of the algorithm used, the name of the file or string in -parenthesis, an equal sign and the cryptographic hash of the input. +parentheses, an equals sign, and the cryptographic hash of the input. If no file name is specified, the standard input is used and only the cryptographic hash is output. .El @@ -105,38 +101,40 @@ The options are as follows: .It Fl a Ar algorithm Use the specified algorithm instead of the default (cksum). Supported algorithms include -.Em cksum , -.Em md4 , -.Em md5 , -.Em rmd160 , -.Em sha1 , -.Em sha256 , -.Em sha384 , -.Em sha512 , -.Em sum +.Ar cksum , +.Ar md4 , +.Ar md5 , +.Ar rmd160 , +.Ar sha1 , +.Ar sha256 , +.Ar sha384 , +.Ar sha512 , +.Ar sum , and -.Em sysvsum . +.Ar sysvsum . Algorithms specified by the .Fl a option are case-insensitive. -.It Fl o Ar \&1 No \&| Ar \&2 -Use historic algorithms instead of the (superior) default one -(see below). -.It Fl s Ar string -Prints a checksum of the given -.Ar string . -.It Fl c Ar [ checklist ... ] +.It Xo +.Fl c +.Oo Ar checklist ... Oc +.Xc Compares all checksums contained in the file .Ar checklist with newly computed checksums for the corresponding files. Output consists of the digest used, the file name, and an OK or FAILED for the result of the comparison. -This will validate any of the supported checksums (see -.Xr cksum 1 ). +This will validate any of the supported checksums. If no file is given, stdin is used. +.It Fl o Ar 1 | 2 +Use historic algorithms instead of the (superior) default one +(see below). .It Fl p Echoes stdin to stdout and appends the checksum to stdout. +.It Fl s Ar string +Prints a checksum of the given +.Ar string . .It Fl t Runs a built-in time trial. .It Fl x @@ -144,7 +142,7 @@ Runs a built-in test script. .El .Pp Algorithm 1 (aka -.Em sum ) +.Ar sum ) is the algorithm used by historic .Bx systems as the @@ -160,7 +158,7 @@ This is a 16-bit checksum, with a right rotation before each addition; overflow is discarded. .Pp Algorithm 2 (aka -.Em sysvsum ) +.Ar sysvsum ) is the algorithm used by historic .At V systems as the @@ -175,7 +173,7 @@ cksum = (r % 2^16) + r / 2^16; .Ed .Pp Both algorithm 1 and 2 write to the standard output the same fields as -the default algorithm except that the size of the file in bytes is +the default algorithm, except that the size of the file in bytes is replaced with the size of the file in blocks. For historic reasons, the block size is 1024 for algorithm 1 and 512 for algorithm 2. @@ -187,11 +185,10 @@ used is based on the polynomial used for .Tn CRC error checking in the networking standard -.St -iso8802-3 +.St -iso8802-3 . The .Tn CRC checksum encoding is defined by the generating polynomial: -.Pp .Bd -unfilled -offset indent G(x) = x^32 + x^26 + x^23 + x^22 + x^16 + x^12 + x^11 + x^10 + x^8 + x^7 + x^5 + x^4 + x^2 + x + 1 @@ -241,7 +238,7 @@ utilities exit 0 on success or >0 if an error occurred. The default calculation is identical to that given in pseudo-code in the following .Tn ACM -article. +article: .Rs .%T "Computation of Cyclic Redundancy Checks Via Table Lookup" .%A Dilip V. Sarwate @@ -265,11 +262,11 @@ utility appeared in .Bx 4.4 . .Sh WARNING Do not use the -.Em cksum , -.Em md4 , -.Em sum , +.Ar cksum , +.Ar md4 , +.Ar sum , or -.Em sysvsum +.Ar sysvsum algorithms to detect hostile binary modifications. An attacker can trivially produce backdoored daemons which have the same checksum as the standard versions. diff --git a/bin/md5/md5.1 b/bin/md5/md5.1 index 9cb9140524f..de172c8b0ab 100644 --- a/bin/md5/md5.1 +++ b/bin/md5/md5.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: md5.1,v 1.18 2004/05/02 17:53:29 millert Exp $ +.\" $OpenBSD: md5.1,v 1.19 2004/05/04 18:32:51 jmc Exp $ .\" .\" Copyright (c) 2003, 2004 Todd C. Miller <Todd.Miller@courtesan.com> .\" @@ -27,9 +27,9 @@ .Sh SYNOPSIS .Nm md5 .Oo -.Fl p | Fl t | Fl x | +.Fl p | t | x | +.Fl c Oo Ar checklist ... Oc | .Fl s Ar string | -.Fl c Ar [ checklist ... ] | .Ar file ... .Oc .Sh DESCRIPTION @@ -50,22 +50,25 @@ such as .Pp The options are as follows: .Bl -tag -width Ds -.It Fl s Ar string -Prints a checksum of the given -.Ar string . -.It Fl c Ar [ checklist ... ] +.It Xo +.Fl c +.Op Ar checklist ... +.Xc Compares all checksums contained in the file .Ar checklist with newly computed checksums for the corresponding files. Output consists of the digest used, the file name, and an OK or FAILED for the result of the comparison. This will validate any of the supported checksums (see -.Xr cksum 1 ). +.Xr cksum 1 ) . If no file is given, stdin is used. .It Fl p Echoes stdin to stdout and appends the .Em MD5 sum to stdout. +.It Fl s Ar string +Prints a checksum of the given +.Ar string . .It Fl t Runs a built-in time trial. .It Fl x diff --git a/bin/md5/rmd160.1 b/bin/md5/rmd160.1 index 014973a45a9..3ddabbc732a 100644 --- a/bin/md5/rmd160.1 +++ b/bin/md5/rmd160.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: rmd160.1,v 1.16 2004/05/02 17:53:29 millert Exp $ +.\" $OpenBSD: rmd160.1,v 1.17 2004/05/04 18:32:51 jmc Exp $ .\" .\" Copyright (c) 2003, 2004 Todd C. Miller <Todd.Miller@courtesan.com> .\" @@ -27,9 +27,9 @@ .Sh SYNOPSIS .Nm rmd160 .Oo -.Fl p | Fl t | Fl x | +.Fl p | t | x | +.Fl c Oo Ar checklist ... Oc | .Fl s Ar string | -.Fl c Ar [ checklist ... ] | .Ar file ... .Oc .Sh DESCRIPTION @@ -50,22 +50,25 @@ such as .Pp The options are as follows: .Bl -tag -width Ds -.It Fl s Ar string -Prints a checksum of the given -.Ar string . -.It Fl c Ar [ checklist ... ] -Compares all checksums contained in the file +.It Xo +.Fl c +.Op Ar checklist ... +.Xc +Compares all checksums contained in the file .Ar checklist with newly computed checksums for the corresponding files. Output consists of the digest used, the file name, and an OK or FAILED for the result of the comparison. This will validate any of the supported checksums (see -.Xr cksum 1 ). +.Xr cksum 1 ) . If no file is given, stdin is used. .It Fl p Echoes stdin to stdout and appends the .Em RMD-160 sum to stdout. +.It Fl s Ar string +Prints a checksum of the given +.Ar string . .It Fl t Runs a built-in time trial. .It Fl x diff --git a/bin/md5/sha1.1 b/bin/md5/sha1.1 index ce6f89cba08..f48d2b062fa 100644 --- a/bin/md5/sha1.1 +++ b/bin/md5/sha1.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: sha1.1,v 1.17 2004/05/02 17:53:29 millert Exp $ +.\" $OpenBSD: sha1.1,v 1.18 2004/05/04 18:32:51 jmc Exp $ .\" .\" Copyright (c) 2003, 2004 Todd C. Miller <Todd.Miller@courtesan.com> .\" @@ -18,7 +18,7 @@ .\" Agency (DARPA) and Air Force Research Laboratory, Air Force .\" Materiel Command, USAF, under agreement number F39502-99-1-0512. .\" -.Dd Aprile 30, 2004 +.Dd April 30, 2004 .Dt SHA1 1 .Os .Sh NAME @@ -27,9 +27,9 @@ .Sh SYNOPSIS .Nm sha1 .Oo -.Fl p | Fl t | Fl x | +.Fl p | t | x | +.Fl c Oo Ar checklist ... Oc | .Fl s Ar string | -.Fl c Ar [ checklist ... ] | .Ar file ... .Oc .Sh DESCRIPTION @@ -50,22 +50,25 @@ such as .Pp The options are as follows: .Bl -tag -width Ds -.It Fl s Ar string -Prints a checksum of the given -.Ar string . -.It Fl c Ar [ checklist ... ] +.It Xo +.Fl c +.Op Ar checklist ... +.Xc Compares all checksums contained in the file .Ar checklist with newly computed checksums for the corresponding files. Output consists of the digest used, the file name, and an OK or FAILED for the result of the comparison. This will validate any of the supported checksums (see -.Xr cksum 1 ). +.Xr cksum 1 ) . If no file is given, stdin is used. .It Fl p Echoes stdin to stdout and appends the .Em SHA-1 sum to stdout. +.It Fl s Ar string +Prints a checksum of the given +.Ar string . .It Fl t Runs a built-in time trial. .It Fl x |