From: tedu Date: Mon, 12 Jul 2010 23:16:55 +0000 (+0000) Subject: replace rmd160 links with sha256. it's way more popular and more better, too. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=0017bcc4a99032e617ec68476348f8d8bd31bbac;p=openbsd replace rmd160 links with sha256. it's way more popular and more better, too. too many oks to enumerate. while here, add Xr to the relevant libc functions in each page. --- diff --git a/bin/md5/Makefile b/bin/md5/Makefile index 455eca04731..38daaa89146 100644 --- a/bin/md5/Makefile +++ b/bin/md5/Makefile @@ -1,10 +1,10 @@ -# $OpenBSD: Makefile,v 1.10 2005/05/24 21:57:47 millert Exp $ +# $OpenBSD: Makefile,v 1.11 2010/07/12 23:16:55 tedu Exp $ PROG= md5 SRCS= crc.c md5.c -MAN= cksum.1 md5.1 sha1.1 rmd160.1 +MAN= cksum.1 md5.1 sha1.1 sha256.1 LINKS= ${BINDIR}/md5 ${BINDIR}/sha1 \ - ${BINDIR}/md5 ${BINDIR}/rmd160 \ + ${BINDIR}/md5 ${BINDIR}/sha256 \ ${BINDIR}/md5 ${BINDIR}/cksum \ ${BINDIR}/md5 ${BINDIR}/sum MLINKS= cksum.1 sum.1 diff --git a/bin/md5/cksum.1 b/bin/md5/cksum.1 index b32d8c7759b..2108ebf5c56 100644 --- a/bin/md5/cksum.1 +++ b/bin/md5/cksum.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: cksum.1,v 1.21 2010/03/26 19:30:40 jmc Exp $ +.\" $OpenBSD: cksum.1,v 1.22 2010/07/12 23:16:55 tedu Exp $ .\" .\" Copyright (c) 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -32,7 +32,7 @@ .\" .\" @(#)cksum.1 8.2 (Berkeley) 4/28/95 .\" -.Dd $Mdocdate: March 26 2010 $ +.Dd $Mdocdate: July 12 2010 $ .Dt CKSUM 1 .Os .Sh NAME @@ -271,8 +271,8 @@ and utilities exit 0 on success or \*(Gt0 if an error occurred. .Sh SEE ALSO .Xr md5 1 , -.Xr rmd160 1 , -.Xr sha1 1 +.Xr sha1 1 , +.Xr sha256 1 .Pp The default calculation is identical to that given in pseudo-code in the following ACM article: diff --git a/bin/md5/md5.1 b/bin/md5/md5.1 index 4cc67e52a17..0abf5b35766 100644 --- a/bin/md5/md5.1 +++ b/bin/md5/md5.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: md5.1,v 1.28 2007/05/31 19:19:15 jmc Exp $ +.\" $OpenBSD: md5.1,v 1.29 2010/07/12 23:16:55 tedu Exp $ .\" .\" Copyright (c) 2003, 2004, 2006 Todd C. Miller .\" @@ -18,7 +18,7 @@ .\" Agency (DARPA) and Air Force Research Laboratory, Air Force .\" Materiel Command, USAF, under agreement number F39502-99-1-0512. .\" -.Dd $Mdocdate: May 31 2007 $ +.Dd $Mdocdate: July 12 2010 $ .Dt MD5 1 .Os .Sh NAME @@ -96,8 +96,9 @@ options are processed. .Ex -std md5 .Sh SEE ALSO .Xr cksum 1 , -.Xr rmd160 1 , -.Xr sha1 1 +.Xr sha1 1 , +.Xr sha256 1 , +.Xr md5 3 .Rs .%A R. Rivest .%T The MD5 Message-Digest Algorithm diff --git a/bin/md5/rmd160.1 b/bin/md5/rmd160.1 deleted file mode 100644 index c4f60ede694..00000000000 --- a/bin/md5/rmd160.1 +++ /dev/null @@ -1,99 +0,0 @@ -.\" $OpenBSD: rmd160.1,v 1.24 2007/05/31 19:19:15 jmc Exp $ -.\" -.\" Copyright (c) 2003, 2004, 2006 Todd C. Miller -.\" -.\" Permission to use, copy, modify, and distribute this software for any -.\" purpose with or without fee is hereby granted, provided that the above -.\" copyright notice and this permission notice appear in all copies. -.\" -.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -.\" -.\" Sponsored in part by the Defense Advanced Research Projects -.\" Agency (DARPA) and Air Force Research Laboratory, Air Force -.\" Materiel Command, USAF, under agreement number F39502-99-1-0512. -.\" -.Dd $Mdocdate: May 31 2007 $ -.Dt RMD160 1 -.Os -.Sh NAME -.Nm rmd160 -.Nd calculate a message-digest fingerprint (checksum) for a file -.Sh SYNOPSIS -.Nm rmd160 -.Op Fl bpqrtx -.Op Fl c Op Ar checklist ... -.Op Fl s Ar string -.Op Ar -.Sh DESCRIPTION -.Nm -takes as input a message of arbitrary length and produces -as output a 160-bit "fingerprint" or "message digest" of the input. -It is conjectured that it is computationally infeasible to produce -two messages having the same message digest, or to produce any -message having a given prespecified target message digest. -.Pp -The -.Em RMD-160 -algorithm is intended for digital signature applications, where a -large file must be "compressed" in a secure manner before being -encrypted with a private (secret) key under a public-key cryptosystem -such as -.Em RSA . -.Pp -The options are as follows: -.Bl -tag -width Ds -.It Fl b -Output checksums in base64 notation, not hexadecimal. -.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 ) . -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 q -Only print the checksum (quiet mode). -.It Fl r -Reverse the format of the hash algorithm output, making -it match the output format used by -.Xr cksum 1 . -.It Fl s Ar string -Prints a checksum of the given -.Ar string . -.It Fl t -Runs a built-in time trial. -Specifying -.Fl t -multiple times results in the number of rounds being multiplied -by 10 for each additional flag. -.It Fl x -Runs a built-in test script. -.El -.Pp -The RMD-160 sum of each file listed on the command line is printed after -the options are processed. -.Pp -.Ex -std rmd160 -.Sh SEE ALSO -.Xr cksum 1 , -.Xr md5 1 , -.Xr sha1 1 -.Pp -RMD-160 is part of the ISO draft standard -.Qq ISO/IEC DIS 10118-3 -on dedicated hash functions. diff --git a/bin/md5/sha1.1 b/bin/md5/sha1.1 index b9c34db68df..94e82810046 100644 --- a/bin/md5/sha1.1 +++ b/bin/md5/sha1.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: sha1.1,v 1.26 2007/05/31 19:19:15 jmc Exp $ +.\" $OpenBSD: sha1.1,v 1.27 2010/07/12 23:16:55 tedu Exp $ .\" .\" Copyright (c) 2003, 2004, 2006 Todd C. Miller .\" @@ -18,7 +18,7 @@ .\" Agency (DARPA) and Air Force Research Laboratory, Air Force .\" Materiel Command, USAF, under agreement number F39502-99-1-0512. .\" -.Dd $Mdocdate: May 31 2007 $ +.Dd $Mdocdate: July 12 2010 $ .Dt SHA1 1 .Os .Sh NAME @@ -105,7 +105,8 @@ sha256, sha384 and sha512. .Sh SEE ALSO .Xr cksum 1 , .Xr md5 1 , -.Xr rmd160 1 +.Xr sha256 1 , +.Xr sha1 3 .Rs .%A J. Burrows .%T The Secure Hash Standard diff --git a/bin/md5/sha256.1 b/bin/md5/sha256.1 new file mode 100644 index 00000000000..a3c7c9be06d --- /dev/null +++ b/bin/md5/sha256.1 @@ -0,0 +1,108 @@ +.\" $OpenBSD: sha256.1,v 1.1 2010/07/12 23:16:55 tedu Exp $ +.\" +.\" Copyright (c) 2003, 2004, 2006 Todd C. Miller +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.\" Sponsored in part by the Defense Advanced Research Projects +.\" Agency (DARPA) and Air Force Research Laboratory, Air Force +.\" Materiel Command, USAF, under agreement number F39502-99-1-0512. +.\" +.Dd $Mdocdate: July 12 2010 $ +.Dt SHA1 1 +.Os +.Sh NAME +.Nm sha256 +.Nd calculate a message-digest fingerprint (checksum) for a file +.Sh SYNOPSIS +.Nm sha256 +.Op Fl bpqrtx +.Op Fl c Op Ar checklist ... +.Op Fl s Ar string +.Op Ar +.Sh DESCRIPTION +.Nm +takes as input a message of arbitrary length and produces +as output a 256-bit "fingerprint" or "message digest" of the input. +It is conjectured that it is computationally infeasible to produce +two messages having the same message digest, or to produce any +message having a given prespecified target message digest. +.Pp +The +.Em SHA2-256 +algorithm is intended for digital signature applications, where a +large file must be "compressed" in a secure manner before being +encrypted with a private (secret) key under a public-key cryptosystem +such as +.Em RSA . +.Pp +The options are as follows: +.Bl -tag -width Ds +.It Fl b +Output checksums in base64 notation, not hexadecimal. +.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 ) . +If no file is given, stdin is used. +.It Fl p +Echoes stdin to stdout and appends the +.Em SHA2-256 +sum to stdout. +.It Fl q +Only print the checksum (quiet mode). +.It Fl r +Reverse the format of the hash algorithm output, making +it match the output format used by +.Xr cksum 1 . +.It Fl s Ar string +Prints a checksum of the given +.Ar string . +.It Fl t +Runs a built-in time trial. +Specifying +.Fl t +multiple times results in the number of rounds being multiplied +by 10 for each additional flag. +.It Fl x +Runs a built-in test script. +.El +.Pp +The SHA2-256 +sum of each file listed on the command line is printed after the options +are processed. +.Pp +The +.Nm +command is shorthand for +.Bd -literal -offset indent +cksum -a sha256 +.Ed +.Pp +.Ex -std sha256 +.Sh SEE ALSO +.Xr cksum 1 , +.Xr md5 1 , +.Xr sha1 1, +.Xr sha2 3 +.Rs +.%T Secure Hash Standard +.%O FIPS PUB 180-2 +.Re