Home | History | Annotate | only in /src/usr.bin/cksum
History log of /src/usr.bin/cksum
RevisionDateAuthorComments
 1.17 15-Dec-2019  christos PR/54768: elo: Missing cksum(1) convenience links (and docs) for new sha2
functions.
 1.16 14-Apr-2009  lukem branches: 1.16.46;
Enable WARNS=4 by default for usr.bin, except for:
awk bdes checknr compile_et error gss hxtool kgetcred kinit
klist ldd less lex locale login m4 man menuc mk_cmds
mklocale msgc openssl rpcgen rpcinfo sdiff spell ssh
string2key telnet tn3270 verify_krb5_conf xlint
 1.15 08-Oct-2008  lukem branches: 1.15.4;
WARNS=4
 1.14 24-Aug-2005  elad Add support for SHA2 in cksum.
 1.13 12-Jan-2005  xtraeme branches: 1.13.2;
WARNS=3
 1.12 18-May-2003  lukem Now that <bsd.prog.mk> DTRT if HOSTPROG is defined (i.e, it is a no-op),
there's no need to special-case .include-ing it.
 1.11 31-Mar-2002  bjh21 Add the necessary bits to make cksum buildable as a host tool.
 1.10 20-Mar-2001  atatat Add MD2, MD4, SHA1, and RMD160 support to cksum. Adding new hashes to
cksum(1) should now be easy.
 1.9 18-Oct-1997  lukem don' define WARNS=1 here
 1.8 17-Oct-1997  lukem WARNSify
 1.7 30-Jan-1997  thorpej Add support for generating MD5 checksums, partially derived from the
FreeBSD md5(1) program. MD5 checksums may be generated by using the
"-m" flag to cksum, or by invoking this program as "md5".
 1.6 02-Sep-1995  jtc Sync with 4.4lite2
 1.5 26-Mar-1995  glass merged with 4.4Lite
 1.4 15-Jan-1995  mycroft Add sum(1) alias, per Matt Green. Various other cleanup. Someone should
finish the addition to the HISTORY section.
 1.3 02-Nov-1993  cgd update to the latest cksum utility from uunet. this one is posix
compliant (i think), and fixes a bogon in the old CRC calculation.
yes, that's right, the CRC's it generates are different.
 1.2 31-Jul-1993  mycroft Add RCS indentifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.3 02-Sep-1995  jtc imported from 44lite2
 1.1.1.2 26-Mar-1995  glass Import from 4.4Lite
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.13.2.1 12-Sep-2005  tron Apply patch (requested by elad in ticket #754):
- Deprecate -1, -2, -4, -5, -6, -m flags.
- Add -a <algorithm> flag.
- Support SHA2 hashing.
cksum(1) now supports ``sha256'', ``sha384'', and ``sha512''.
 1.15.4.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.16.46.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.50 15-Dec-2019  christos bump date
 1.49 15-Dec-2019  christos PR/54768: elo: Missing cksum(1) convenience links (and docs) for new sha2
functions.
 1.48 03-Jul-2017  wiz branches: 1.48.6;
Remove workaround for ancient HTML generation code.
 1.47 31-Aug-2014  wiz New sentence, new line.
 1.46 31-Aug-2014  christos PR/49134: Kamil Rytarowski: Add -q flag.
 1.45 28-Mar-2013  njoly branches: 1.45.6;
Remove unknown \*(tN and \*(sP macros.

ok wiz.
 1.44 25-Jun-2012  riastradh branches: 1.44.2;
Omit outdated cryptographic claims as noted in PR 44160.

Interested readers can follow the references or read Wikipedia; this
is the wrong place to explain cryptographic hash functions and give
security advice.
 1.43 14-May-2010  joerg branches: 1.43.6; 1.43.8;
Use plain \* not \\*. Fix trailing whitespace
 1.42 13-Mar-2009  joerg Don't use macros for the synopsis. Improve markup to break argument
groups together by not splitting opening and closing macro over lines.
 1.41 02-Jan-2009  lukem branches: 1.41.2;
Clean up the usage display to match reality.
Allow 'sum' to take '-a algorithm', so that its usage matches 'cksum'.
Per discussion with Igor Sobrado resulting from PR 39658.
 1.40 02-Sep-2006  wiz branches: 1.40.2; 1.40.12; 1.40.24; 1.40.26; 1.40.30;
Bump date for previous.
 1.39 25-Aug-2006  elad mention we support sha2, pointed out by dieter roelants

okay hubertf
 1.38 05-May-2006  elad remove -1, -2, -4, -5, -6, -m.
 1.37 24-Apr-2006  wiz Document more explicitly that -c takes an optional file argument.
 1.36 24-Apr-2006  hubertf Allow reading the checksum list from stdin if no file is given with -c.
This allows verifying the checksums e.g. after downloading a NetBSD
release:
cat BSDSUM CKSUM MD5 SHA512 SYSVSUM | cksum -c
 1.35 23-Apr-2006  wiz A fix for HTML output; punctuation nits.
 1.34 23-Apr-2006  hubertf Document -w, too.
 1.33 23-Apr-2006  hubertf Add a switch "-c file" to verify a list of checksums generated by the
cksum program and stored in file against files on disk. E.g. first
run "md5 *.tgz >MD5" to generate a list of MD5 checksums in MD5, then
use the following command to verify them use "md5 -c MD5"

Inspired by Linux' md5sum,
called for by Jukka Salmi <j+nbsd@2006.salmi.ch>on netbsd-help@,
reviewed by rui@.
 1.32 11-Sep-2005  wiz Use correct macro. From YOMURA Masanori in private mail.
 1.31 10-Sep-2005  wiz Punctuation nits.
 1.30 24-Aug-2005  elad Add support for SHA2 in cksum.
 1.29 23-Aug-2005  elad Put back in information about the deprecated flags in the man-page. Be
explicit about them being removed, and suggest using the ``-a'' flag.
 1.28 22-Aug-2005  elad Note about deprecated flags.
 1.27 21-Aug-2005  elad Add comments about intentionally not documenting the deprecated -1, -2, -4,
-5, -6, and -m flags so they are not mistakenly get documented again in the
future.
 1.26 21-Aug-2005  elad Some changes to cksum:

1. Deprecate the -1, -2, -4, -5, -6, and -m flags. For now, simply remove
them from the documentation.

2. Add and document ``-a algorithm''.
 1.25 09-Jul-2004  wiz branches: 1.25.2;
-p, -s, -t, and -x are mutually exclusive -- make it obvious in
the SYNOPSIS.
 1.24 23-Apr-2004  simonb s/the the/the/ (only in sources that aren't regularly imported from
elsewhere).
 1.23 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22365, verified by myself.
 1.22 26-Jun-2003  wiz End sentence with a dot.
 1.21 26-Dec-2002  jmmv Fix typo: extra 'a' word in plural sentence. Approved by wiz.
 1.20 18-Oct-2002  wiz Bump date for last.
 1.19 18-Oct-2002  atatat Add a -n flag for the hash output forms, so that the output is
"normal", ie, "hash filename" (like all the simple checksum output
forms) as opposed to "hashname (filename) = hash". This output form
is, imho, somewhat more useful because you can pass it directly to
sort to find identical files. For example:

md5 * | sort | uniq -c | grep -v ' 1 '
 1.18 30-Sep-2002  grant New sentence, new line.
 1.17 08-Feb-2002  ross branches: 1.17.2;
Generate <>& symbolically. I'm avoiding .../dist/... directories for now.
 1.16 04-Apr-2001  wiz Add sections to xrefs, and remove some unnecessary whitespace while I'm
here.
 1.15 20-Mar-2001  atatat Add MD2, MD4, SHA1, and RMD160 support to cksum. Adding new hashes to
cksum(1) should now be easy.
 1.14 03-Jul-2000  enami - Don't overstrike the |.
- Use the default .Ar argument.
 1.13 22-Mar-1999  garbled branches: 1.13.10;
More and more .Os cleanups. .Os is defined in the tmac.doc-common file,
so we shouldn't override it with versions in the manpages. Many more to
come.
 1.12 11-Nov-1997  mrg add missing .Nm sections.
 1.11 17-Oct-1997  lukem branches: 1.11.2;
WARNSify
 1.10 18-Mar-1997  thorpej Fix typo, per Dave Huang <khym@bga.com>, PR #3345.
 1.9 30-Jan-1997  thorpej Add support for generating MD5 checksums, partially derived from the
FreeBSD md5(1) program. MD5 checksums may be generated by using the
"-m" flag to cksum, or by invoking this program as "md5".
 1.8 02-Sep-1995  jtc Sync with 4.4lite2
 1.7 26-Mar-1995  glass merged with 4.4Lite
 1.6 15-Jan-1995  mycroft Add sum(1) alias, per Matt Green. Various other cleanup. Someone should
finish the addition to the HISTORY section.
 1.5 20-May-1994  jtc Fix formatting bug: a "1" or "2" argument to -o is manditory.
 1.4 30-Nov-1993  jtc Use ".St -p1003.2-92" macro instead of spelling it out.
 1.3 02-Nov-1993  cgd update to the latest cksum utility from uunet. this one is posix
compliant (i think), and fixes a bogon in the old CRC calculation.
yes, that's right, the CRC's it generates are different.
 1.2 01-Aug-1993  mycroft Add RCS indentifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.3 02-Sep-1995  jtc imported from 44lite2
 1.1.1.2 26-Mar-1995  glass Import from 4.4Lite
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.11.2.1 11-Nov-1997  mrg pull up from trunk: add missing .Nm sections.
 1.13.10.1 26-Apr-2001  he Pull up revision 1.16 (requested by wiz):
Add section to cross references, and whitespace fixes.
 1.17.2.1 05-Jan-2003  jmc Pull up revisisions 1.20-1.21 (requested by jmmv in ticket #1051)
Fix typo: extra 'a' word in plural sentence.
 1.25.2.1 12-Sep-2005  tron Apply patch (requested by elad in ticket #754):
- Deprecate -1, -2, -4, -5, -6, -m flags.
- Add -a <algorithm> flag.
- Support SHA2 hashing.
cksum(1) now supports ``sha256'', ``sha384'', and ``sha512''.
 1.40.30.1 22-Aug-2012  bouyer Pull up following revision(s) (requested by dholland in ticket #1778):
usr.bin/cksum/cksum.1: revision 1.44 via patch
Omit outdated cryptographic claims as noted in PR 44160.
Interested readers can follow the references or read Wikipedia; this
is the wrong place to explain cryptographic hash functions and give
security advice.
 1.40.26.1 22-Aug-2012  bouyer Pull up following revision(s) (requested by dholland in ticket #1778):
usr.bin/cksum/cksum.1: revision 1.44 via patch
Omit outdated cryptographic claims as noted in PR 44160.
Interested readers can follow the references or read Wikipedia; this
is the wrong place to explain cryptographic hash functions and give
security advice.
 1.40.24.1 22-Aug-2012  bouyer Pull up following revision(s) (requested by dholland in ticket #1778):
usr.bin/cksum/cksum.1: revision 1.44 via patch
Omit outdated cryptographic claims as noted in PR 44160.
Interested readers can follow the references or read Wikipedia; this
is the wrong place to explain cryptographic hash functions and give
security advice.
 1.40.12.1 22-Aug-2012  bouyer Pull up following revision(s) (requested by dholland in ticket #1453):
usr.bin/cksum/cksum.1: revision 1.44 via patch
Omit outdated cryptographic claims as noted in PR 44160.
Interested readers can follow the references or read Wikipedia; this
is the wrong place to explain cryptographic hash functions and give
security advice.
 1.40.2.1 22-Aug-2012  bouyer Pull up following revision(s) (requested by dholland in ticket #1453):
usr.bin/cksum/cksum.1: revision 1.44 via patch
Omit outdated cryptographic claims as noted in PR 44160.
Interested readers can follow the references or read Wikipedia; this
is the wrong place to explain cryptographic hash functions and give
security advice.
 1.41.2.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.43.8.1 02-Jul-2012  jdc Pull up revision 1.44 (requested by dholland in ticket #374).

Omit outdated cryptographic claims as noted in PR 44160.

Interested readers can follow the references or read Wikipedia; this
is the wrong place to explain cryptographic hash functions and give
security advice.
 1.43.6.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.43.6.1 30-Oct-2012  yamt sync with head
 1.44.2.1 23-Jun-2013  tls resync from head
 1.45.6.1 31-Aug-2014  riz Pull up following revision(s) (requested by christos in ticket #73):
usr.bin/cksum/cksum.1: revision 1.46
usr.bin/cksum/cksum.1: revision 1.47
usr.bin/cksum/cksum.c: revision 1.47
PR/49134: Kamil Rytarowski: Add -q flag.
New sentence, new line.
 1.48.6.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.52 25-Jun-2022  gutteridge cksum.c: don't fault if the hash algorithm is fed invalid data

Addresses PR bin/56897 from RVP, who provided the patch.
 1.51 25-Aug-2021  rillig cksum: remove trailing whitespace
 1.50 25-Aug-2021  rillig cksum: fix lint warning about wrong call to isspace
 1.49 18-Mar-2021  cheusov cksum: use POSIX type uint32_t instead of u_int32_t
 1.48 16-Jun-2015  christos fix some error handling.
 1.47 31-Aug-2014  christos PR/49134: Kamil Rytarowski: Add -q flag.
 1.46 18-Oct-2013  christos branches: 1.46.4;
fix unused variable warnings
 1.45 29-Aug-2011  joerg branches: 1.45.2; 1.45.8;
static + __dead
 1.44 02-Jan-2009  lukem Clean up the usage display to match reality.
Allow 'sum' to take '-a algorithm', so that its usage matches 'cksum'.
Per discussion with Igor Sobrado resulting from PR 39658.
 1.43 08-Oct-2008  lukem use a const struct hash pointer
 1.42 21-Jul-2008  lukem Remove the \n and tabs from the __COPYRIGHT() strings.
Tweak to use a consistent format.
 1.41 17-Jan-2007  hubertf branches: 1.41.12;
Remove duplicate #includes
From Slava Semushin <slava.semushin@gmail.com>, via private mail
 1.40 30-Oct-2006  christos kill crypto/rmd160.h and crypto/sha2.h, and instead make symlinks to
/usr/include from /usr/include/sys. This makes all the one way hash
header handling identical.
 1.39 22-Oct-2006  christos use c99 initializer.
 1.38 22-Sep-2006  elad PR/34584: Geoff C. Wing: cksum not closing filescriptors after finishing
processing files.
Applied patch, thanks!
 1.37 07-May-2006  hubertf Be more liberal about whitespaces when verifying checksums.
This allows checking md5/sha1 shecksums generates on Linux, which
add more whitespace.

Based on patch by Jukka Salmi (j+nbsd at 2006 dot salmi dot ch)
 1.36 05-May-2006  elad remove -1, -2, -4, -5, -6, -m.
 1.35 24-Apr-2006  hubertf Allow reading the checksum list from stdin if no file is given with -c.
This allows verifying the checksums e.g. after downloading a NetBSD
release:
cat BSDSUM CKSUM MD5 SHA512 SYSVSUM | cksum -c
 1.34 24-Apr-2006  hubertf Try guessing hash types. Prefix output with hash type,
the output format was inspired by Linux & OpenBSD.

This now allows doing something like:

miyu% ( md4 *.c ; md5 *.c ; sha1 *.c ) > /tmp/x
miyu% md5 -c /tmp/x
miyu% cksum -c /tmp/x
miyu% echo $?
0
miyu% date >test.c
miyu% cksum -c /tmp/x
(MD4) test.c: FAILED
(MD5) test.c: FAILED
(SHA1) test.c: FAILED
miyu% echo $?
1
 1.33 23-Apr-2006  hubertf Add a switch "-c file" to verify a list of checksums generated by the
cksum program and stored in file against files on disk. E.g. first
run "md5 *.tgz >MD5" to generate a list of MD5 checksums in MD5, then
use the following command to verify them use "md5 -c MD5"

Inspired by Linux' md5sum,
called for by Jukka Salmi <j+nbsd@2006.salmi.ch>on netbsd-help@,
reviewed by rui@.
 1.32 15-Jan-2006  elad sync usage().
 1.31 24-Sep-2005  elad Use crypto/rmd160.h.
 1.30 02-Sep-2005  elad Avoid defining max. hash length ugliness simply by passing NULL for the
buffer to the File routines.

Noted by pooka@.
 1.29 02-Sep-2005  elad Forgot +1 for NUL termination.
 1.28 02-Sep-2005  elad Use MAXHASHLEN to indicate largest possible hash.
Fixes buffer overflow found by xtraeme@.
 1.27 24-Aug-2005  elad Add support for SHA2 in cksum.
 1.26 21-Aug-2005  elad Add comments about intentionally not documenting the deprecated -1, -2, -4,
-5, -6, and -m flags so they are not mistakenly get documented again in the
future.
 1.25 21-Aug-2005  elad Some changes to cksum:

1. Deprecate the -1, -2, -4, -5, -6, and -m flags. For now, simply remove
them from the documentation.

2. Add and document ``-a algorithm''.
 1.24 05-Feb-2005  simonb branches: 1.24.2;
De-register.
 1.23 20-Jan-2005  xtraeme whitespace, remove main() prototype.
 1.22 12-Jan-2005  xtraeme * Kill __P()
* ANSIfy
* No parenthesis are needed around the return value
 1.21 09-Jul-2004  wiz Add missing -n, -1, -2, -4, -5, and -6 to cksum usage.
From Kouichirou Hiratsuka in PR 26195.
 1.20 20-Jun-2004  jmc Completely rework how tools/compat is done. Purge all uses/references to
_NETBSD_SOURCE as this makes cross building from older/newer versions of
NetBSD harder, not easier (and also makes the resulting tools 'different')

Wrap all required code with the inclusion of nbtool_config.h, attempt to
only use POSIX code in all places (or when reasonable test w. configure and
provide definitions: ala u_int, etc).

Reviewed by lukem. Tested on FreeBSD 4.9, Redhat Linux ES3, NetBSD 1.6.2 x86
NetBSD current (x86 and amd64) and Solaris 9.

Fixes PR's: PR#17762 PR#25944
 1.19 20-Dec-2003  kleink branches: 1.19.2;
Update to keep file lengths in appropriate data types (off_t, as opposed
to u_int32_t).
 1.18 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22365, verified by myself.
 1.17 18-Oct-2002  atatat Add a -n flag for the hash output forms, so that the output is
"normal", ie, "hash filename" (like all the simple checksum output
forms) as opposed to "hashname (filename) = hash". This output form
is, imho, somewhat more useful because you can pass it directly to
sort to find identical files. For example:

md5 * | sort | uniq -c | grep -v ' 1 '
 1.16 31-Mar-2002  bjh21 branches: 1.16.2;
Protect __RCSID and __COPYRIGHT from being invoked if not defined.
 1.15 21-Mar-2001  atatat Apparently changing crc() to ccrc() was bad, since mtree does a reachover.
Revert ccrc() to crc() and change local variables called crc to thecrc
instead.
 1.14 20-Mar-2001  atatat Rename the crc() function to ccrc() since that removes a compiler warning
when WARNS=2.
 1.13 20-Mar-2001  atatat Add MD2, MD4, SHA1, and RMD160 support to cksum. Adding new hashes to
cksum(1) should now be easy.
 1.12 19-Feb-2001  cgd convert to use getprogname()
 1.11 05-Feb-2001  christos fix nested extern
 1.10 17-Oct-1997  lukem WARNSify
 1.9 26-Jun-1997  kleink POSIX.2 utilities must call setlocale(LC_ALL, "");
 1.8 30-Jan-1997  thorpej Add support for generating MD5 checksums, partially derived from the
FreeBSD md5(1) program. MD5 checksums may be generated by using the
"-m" flag to cksum, or by invoking this program as "md5".
 1.7 02-Sep-1995  jtc Sync with 4.4lite2
 1.6 26-Mar-1995  glass merged with 4.4Lite
 1.5 15-Jan-1995  mycroft Add sum(1) alias, per Matt Green. Various other cleanup. Someone should
finish the addition to the HISTORY section.
 1.4 24-Dec-1994  cgd cksum uses 32-bit quantites, internally
 1.3 02-Nov-1993  cgd update to the latest cksum utility from uunet. this one is posix
compliant (i think), and fixes a bogon in the old CRC calculation.
yes, that's right, the CRC's it generates are different.
 1.2 01-Aug-1993  mycroft Add RCS identifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.3 02-Sep-1995  jtc imported from 44lite2
 1.1.1.2 26-Mar-1995  glass Import from 4.4Lite
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.16.2.1 21-Dec-2003  tron Pull up revision 1.19 (requested by kleink in ticket #1580):
Update to keep file lengths in appropriate data types (off_t, as opposed
to u_int32_t).
 1.19.2.1 22-Jun-2004  tron Pull up revision 1.20 (requested by jmc in ticket #527):
Completely rework how tools/compat is done. Purge all uses/references to
_NETBSD_SOURCE as this makes cross building from older/newer versions of
NetBSD harder, not easier (and also makes the resulting tools 'different')
Wrap all required code with the inclusion of nbtool_config.h, attempt to
only use POSIX code in all places (or when reasonable test w. configure and
provide definitions: ala u_int, etc).
Reviewed by lukem. Tested on FreeBSD 4.9, Redhat Linux ES3, NetBSD 1.6.2 x86
NetBSD current (x86 and amd64) and Solaris 9.
Fixes PR's: PR#17762 PR#25944
 1.24.2.1 12-Sep-2005  tron Apply patch (requested by elad in ticket #754):
- Deprecate -1, -2, -4, -5, -6, -m flags.
- Add -a <algorithm> flag.
- Support SHA2 hashing.
cksum(1) now supports ``sha256'', ``sha384'', and ``sha512''.
 1.41.12.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.45.8.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.45.2.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.46.4.1 31-Aug-2014  riz Pull up following revision(s) (requested by christos in ticket #73):
usr.bin/cksum/cksum.1: revision 1.46
usr.bin/cksum/cksum.1: revision 1.47
usr.bin/cksum/cksum.c: revision 1.47
PR/49134: Kamil Rytarowski: Add -q flag.
New sentence, new line.
 1.22 18-Mar-2021  cheusov cksum: use POSIX type uint32_t instead of u_int32_t
 1.21 27-Apr-2020  martin Explicitly cast the number of bytes passed to crc_buf() to size_t, as
we made sure it is positive already.
Fixes the build.
 1.20 27-Apr-2020  riastradh Speed up cksum word-by-word with a 15 KB table generated dynamically.

(Really we could generate the main table dynamically too.)

From anonymous.
 1.19 29-Oct-2014  uebayasi Fix build.
 1.18 04-Sep-2006  dsl branches: 1.18.60;
Separate out the CRC functions in a manner that actually makes them useful
for other program binaries.
Fixes build of 'config' where I added code (commented out) to use the CRC
function - but didn't comment out the #include :-(
 1.17 05-Feb-2005  simonb De-register.
 1.16 12-Jan-2005  xtraeme * Kill __P()
* ANSIfy
* No parenthesis are needed around the return value
 1.15 20-Jun-2004  jmc Completely rework how tools/compat is done. Purge all uses/references to
_NETBSD_SOURCE as this makes cross building from older/newer versions of
NetBSD harder, not easier (and also makes the resulting tools 'different')

Wrap all required code with the inclusion of nbtool_config.h, attempt to
only use POSIX code in all places (or when reasonable test w. configure and
provide definitions: ala u_int, etc).

Reviewed by lukem. Tested on FreeBSD 4.9, Redhat Linux ES3, NetBSD 1.6.2 x86
NetBSD current (x86 and amd64) and Solaris 9.

Fixes PR's: PR#17762 PR#25944
 1.14 20-Dec-2003  kleink branches: 1.14.2;
Update to keep file lengths in appropriate data types (off_t, as opposed
to u_int32_t).
 1.13 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22365, verified by myself.
 1.12 31-Mar-2002  bjh21 branches: 1.12.2;
Protect __RCSID and __COPYRIGHT from being invoked if not defined.
 1.11 10-Nov-2001  mycroft Remove calculation of crc_total from here, making the routine approximately
twice as fast.
 1.10 21-Mar-2001  atatat Apparently changing crc() to ccrc() was bad, since mtree does a reachover.
Revert ccrc() to crc() and change local variables called crc to thecrc
instead.
 1.9 20-Mar-2001  atatat Rename the crc() function to ccrc() since that removes a compiler warning
when WARNS=2.
 1.8 17-Oct-1997  lukem WARNSify
 1.7 27-Feb-1996  jtc use const qualifer for crctab
 1.6 27-Feb-1996  cgd what's the point of having prototypes if they're not actually _used_
in the appropriate places? include extern.h in these files, and fix
up the bugs that its inclusion uncovered.
 1.5 26-Mar-1995  glass merged with 4.4Lite
 1.4 24-Dec-1994  cgd cksum uses 32-bit quantites, internally
 1.3 02-Nov-1993  cgd update to the latest cksum utility from uunet. this one is posix
compliant (i think), and fixes a bogon in the old CRC calculation.
yes, that's right, the CRC's it generates are different.
 1.2 01-Aug-1993  mycroft Add RCS identifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 26-Mar-1995  glass Import from 4.4Lite
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.12.2.1 21-Dec-2003  tron Pull up revision 1.14 (requested by kleink in ticket #1580):
Update to keep file lengths in appropriate data types (off_t, as opposed
to u_int32_t).
 1.14.2.1 22-Jun-2004  tron Pull up revision 1.15 (requested by jmc in ticket #527):
Completely rework how tools/compat is done. Purge all uses/references to
_NETBSD_SOURCE as this makes cross building from older/newer versions of
NetBSD harder, not easier (and also makes the resulting tools 'different')
Wrap all required code with the inclusion of nbtool_config.h, attempt to
only use POSIX code in all places (or when reasonable test w. configure and
provide definitions: ala u_int, etc).
Reviewed by lukem. Tested on FreeBSD 4.9, Redhat Linux ES3, NetBSD 1.6.2 x86
NetBSD current (x86 and amd64) and Solaris 9.
Fixes PR's: PR#17762 PR#25944
 1.18.60.1 06-Mar-2015  snj Pull up following revision(s) (requested by mrg in ticket #572):
usr.bin/cksum/crc.c: revision 1.19
Fix build.
 1.2 18-Mar-2021  cheusov cksum: use POSIX type uint32_t instead of u_int32_t
 1.1 04-Sep-2006  dsl Separate out the CRC functions in a manner that actually makes them useful
for other program binaries.
Fixes build of 'config' where I added code (commented out) to use the CRC
function - but didn't comment out the #include :-(
 1.20 18-Mar-2021  cheusov cksum: use POSIX type uint32_t instead of u_int32_t
 1.19 04-Sep-2006  dsl Separate out the CRC functions in a manner that actually makes them useful
for other program binaries.
Fixes build of 'config' where I added code (commented out) to use the CRC
function - but didn't comment out the #include :-(
 1.18 02-Sep-2005  elad Avoid defining max. hash length ugliness simply by passing NULL for the
buffer to the File routines.

Noted by pooka@.
 1.17 02-Sep-2005  elad Use MAXHASHLEN to indicate largest possible hash.
Fixes buffer overflow found by xtraeme@.
 1.16 24-Aug-2005  elad Add support for SHA2 in cksum.
 1.15 20-Jan-2005  xtraeme branches: 1.15.2;
whitespace, remove main() prototype.
 1.14 12-Jan-2005  xtraeme * Kill __P()
* ANSIfy
* No parenthesis are needed around the return value
 1.13 20-Dec-2003  kleink Update to keep file lengths in appropriate data types (off_t, as opposed
to u_int32_t).
 1.12 27-Oct-2003  lukem Overhaul how `build.sh tools' are used:

* Rename "config.h" to "nbtool_config.h" and
HAVE_CONFIG_H to HAVE_NBTOOL_CONFIG_H.
This makes in more obvious in the source when we're using
tools/compat/config.h versus "standard autoconf" config.h

* Consistently move the inclusion of nbtool_config.h to before
<sys/cdefs.h> so that the former can provide __RCSID() (et al),
and there's no need to protect those macros any more.

These changes should make it easier to "tool-ify" a program by adding:
#if HAVE_NBTOOL_CONFIG_H
#include "nbtool_config.h"
#endif
to the top of the source files (for the general case).
 1.11 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22365, verified by myself.
 1.10 31-Mar-2002  bjh21 branches: 1.10.2;
Add the necessary bits to make cksum buildable as a host tool.
 1.9 21-Mar-2001  atatat Apparently changing crc() to ccrc() was bad, since mtree does a reachover.
Revert ccrc() to crc() and change local variables called crc to thecrc
instead.
 1.8 20-Mar-2001  atatat Rename the crc() function to ccrc() since that removes a compiler warning
when WARNS=2.
 1.7 20-Mar-2001  atatat Add MD2, MD4, SHA1, and RMD160 support to cksum. Adding new hashes to
cksum(1) should now be easy.
 1.6 30-Jan-1997  thorpej Add support for generating MD5 checksums, partially derived from the
FreeBSD md5(1) program. MD5 checksums may be generated by using the
"-m" flag to cksum, or by invoking this program as "md5".
 1.5 26-Mar-1995  glass merged with 4.4Lite
 1.4 24-Dec-1994  cgd cksum uses 32-bit quantites, internally
 1.3 02-Nov-1993  cgd update to the latest cksum utility from uunet. this one is posix
compliant (i think), and fixes a bogon in the old CRC calculation.
yes, that's right, the CRC's it generates are different.
 1.2 01-Aug-1993  mycroft Add RCS identifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 26-Mar-1995  glass Import from 4.4Lite
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.10.2.1 21-Dec-2003  tron Pull up revision 1.13 (requested by kleink in ticket #1580):
Update to keep file lengths in appropriate data types (off_t, as opposed
to u_int32_t).
 1.15.2.1 12-Sep-2005  tron Apply patch (requested by elad in ticket #754):
- Deprecate -1, -2, -4, -5, -6, -m flags.
- Add -a <algorithm> flag.
- Support SHA2 hashing.
cksum(1) now supports ``sha256'', ``sha384'', and ``sha512''.
 1.1 20-Mar-2001  atatat Add MD2, MD4, SHA1, and RMD160 support to cksum. Adding new hashes to
cksum(1) should now be easy.
 1.1 20-Mar-2001  atatat Add MD2, MD4, SHA1, and RMD160 support to cksum. Adding new hashes to
cksum(1) should now be easy.
 1.10 29-Dec-2008  christos fix 64 bit time_t
 1.9 24-Aug-2005  elad Fix some lint warnings.
 1.8 20-Jan-2005  xtraeme branches: 1.8.2;
whitespace, remove main() prototype.
 1.7 12-Jan-2005  xtraeme ANSIfy another function missed in previous.
 1.6 12-Jan-2005  xtraeme * Kill __P()
* ANSIfy
* No parenthesis are needed around the return value
 1.5 20-Jun-2004  jmc Completely rework how tools/compat is done. Purge all uses/references to
_NETBSD_SOURCE as this makes cross building from older/newer versions of
NetBSD harder, not easier (and also makes the resulting tools 'different')

Wrap all required code with the inclusion of nbtool_config.h, attempt to
only use POSIX code in all places (or when reasonable test w. configure and
provide definitions: ala u_int, etc).

Reviewed by lukem. Tested on FreeBSD 4.9, Redhat Linux ES3, NetBSD 1.6.2 x86
NetBSD current (x86 and amd64) and Solaris 9.

Fixes PR's: PR#17762 PR#25944
 1.4 31-Mar-2002  bjh21 branches: 1.4.4;
Protect __RCSID and __COPYRIGHT from being invoked if not defined.
 1.3 20-Mar-2001  atatat Add MD2, MD4, SHA1, and RMD160 support to cksum. Adding new hashes to
cksum(1) should now be easy.
 1.2 17-Oct-1997  lukem WARNSify
 1.1 30-Jan-1997  thorpej Add support for generating MD5 checksums, partially derived from the
FreeBSD md5(1) program. MD5 checksums may be generated by using the
"-m" flag to cksum, or by invoking this program as "md5".
 1.4.4.1 22-Jun-2004  tron Pull up revision 1.5 (requested by jmc in ticket #527):
Completely rework how tools/compat is done. Purge all uses/references to
_NETBSD_SOURCE as this makes cross building from older/newer versions of
NetBSD harder, not easier (and also makes the resulting tools 'different')
Wrap all required code with the inclusion of nbtool_config.h, attempt to
only use POSIX code in all places (or when reasonable test w. configure and
provide definitions: ala u_int, etc).
Reviewed by lukem. Tested on FreeBSD 4.9, Redhat Linux ES3, NetBSD 1.6.2 x86
NetBSD current (x86 and amd64) and Solaris 9.
Fixes PR's: PR#17762 PR#25944
 1.8.2.1 12-Sep-2005  tron Apply patch (requested by elad in ticket #754):
- Deprecate -1, -2, -4, -5, -6, -m flags.
- Add -a <algorithm> flag.
- Support SHA2 hashing.
cksum(1) now supports ``sha256'', ``sha384'', and ``sha512''.
 1.12 18-Mar-2021  cheusov cksum: use POSIX type uint32_t instead of u_int32_t
 1.11 12-Jan-2005  xtraeme * Kill __P()
* ANSIfy
* No parenthesis are needed around the return value
 1.10 20-Jun-2004  jmc Completely rework how tools/compat is done. Purge all uses/references to
_NETBSD_SOURCE as this makes cross building from older/newer versions of
NetBSD harder, not easier (and also makes the resulting tools 'different')

Wrap all required code with the inclusion of nbtool_config.h, attempt to
only use POSIX code in all places (or when reasonable test w. configure and
provide definitions: ala u_int, etc).

Reviewed by lukem. Tested on FreeBSD 4.9, Redhat Linux ES3, NetBSD 1.6.2 x86
NetBSD current (x86 and amd64) and Solaris 9.

Fixes PR's: PR#17762 PR#25944
 1.9 20-Dec-2003  kleink branches: 1.9.2;
Update to keep file lengths in appropriate data types (off_t, as opposed
to u_int32_t).
 1.8 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22365, verified by myself.
 1.7 31-Mar-2002  bjh21 branches: 1.7.2;
Protect __RCSID and __COPYRIGHT from being invoked if not defined.
 1.6 17-Oct-1997  lukem WARNSify
 1.5 26-Mar-1995  glass merged with 4.4Lite
 1.4 24-Dec-1994  cgd cksum uses 32-bit quantites, internally
 1.3 02-Nov-1993  cgd update to the latest cksum utility from uunet. this one is posix
compliant (i think), and fixes a bogon in the old CRC calculation.
yes, that's right, the CRC's it generates are different.
 1.2 01-Aug-1993  mycroft Add RCS identifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 26-Mar-1995  glass Import from 4.4Lite
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.7.2.1 21-Dec-2003  tron Pull up revision 1.9 (requested by kleink in ticket #1580):
Update to keep file lengths in appropriate data types (off_t, as opposed
to u_int32_t).
 1.9.2.1 22-Jun-2004  tron Pull up revision 1.10 (requested by jmc in ticket #527):
Completely rework how tools/compat is done. Purge all uses/references to
_NETBSD_SOURCE as this makes cross building from older/newer versions of
NetBSD harder, not easier (and also makes the resulting tools 'different')
Wrap all required code with the inclusion of nbtool_config.h, attempt to
only use POSIX code in all places (or when reasonable test w. configure and
provide definitions: ala u_int, etc).
Reviewed by lukem. Tested on FreeBSD 4.9, Redhat Linux ES3, NetBSD 1.6.2 x86
NetBSD current (x86 and amd64) and Solaris 9.
Fixes PR's: PR#17762 PR#25944
 1.3 30-Oct-2006  christos kill crypto/rmd160.h and crypto/sha2.h, and instead make symlinks to
/usr/include from /usr/include/sys. This makes all the one way hash
header handling identical.
 1.2 24-Sep-2005  elad Use crypto/rmd160.h.
 1.1 20-Mar-2001  atatat Add MD2, MD4, SHA1, and RMD160 support to cksum. Adding new hashes to
cksum(1) should now be easy.
 1.1 20-Mar-2001  atatat Add MD2, MD4, SHA1, and RMD160 support to cksum. Adding new hashes to
cksum(1) should now be easy.
 1.3 30-Oct-2006  christos kill crypto/rmd160.h and crypto/sha2.h, and instead make symlinks to
/usr/include from /usr/include/sys. This makes all the one way hash
header handling identical.
 1.2 25-Aug-2005  tron branches: 1.2.2;
Fix host tool build which got broken when SHA2 support was added.
 1.1 24-Aug-2005  elad Add support for SHA2 in cksum.
 1.2.2.2 12-Sep-2005  tron Apply patch (requested by elad in ticket #754):
- Deprecate -1, -2, -4, -5, -6, -m flags.
- Add -a <algorithm> flag.
- Support SHA2 hashing.
cksum(1) now supports ``sha256'', ``sha384'', and ``sha512''.
 1.2.2.1 25-Aug-2005  tron file sha256.c was added on branch netbsd-3 on 2005-09-12 12:18:33 +0000
 1.3 30-Oct-2006  christos kill crypto/rmd160.h and crypto/sha2.h, and instead make symlinks to
/usr/include from /usr/include/sys. This makes all the one way hash
header handling identical.
 1.2 25-Aug-2005  tron branches: 1.2.2;
Fix host tool build which got broken when SHA2 support was added.
 1.1 24-Aug-2005  elad Add support for SHA2 in cksum.
 1.2.2.2 12-Sep-2005  tron Apply patch (requested by elad in ticket #754):
- Deprecate -1, -2, -4, -5, -6, -m flags.
- Add -a <algorithm> flag.
- Support SHA2 hashing.
cksum(1) now supports ``sha256'', ``sha384'', and ``sha512''.
 1.2.2.1 25-Aug-2005  tron file sha384.c was added on branch netbsd-3 on 2005-09-12 12:18:33 +0000
 1.3 30-Oct-2006  christos kill crypto/rmd160.h and crypto/sha2.h, and instead make symlinks to
/usr/include from /usr/include/sys. This makes all the one way hash
header handling identical.
 1.2 25-Aug-2005  tron branches: 1.2.2;
Fix host tool build which got broken when SHA2 support was added.
 1.1 24-Aug-2005  elad Add support for SHA2 in cksum.
 1.2.2.2 12-Sep-2005  tron Apply patch (requested by elad in ticket #754):
- Deprecate -1, -2, -4, -5, -6, -m flags.
- Add -a <algorithm> flag.
- Support SHA2 hashing.
cksum(1) now supports ``sha256'', ``sha384'', and ``sha512''.
 1.2.2.1 25-Aug-2005  tron file sha512.c was added on branch netbsd-3 on 2005-09-12 12:18:33 +0000
 1.14 18-Mar-2021  cheusov cksum: use POSIX type uint32_t instead of u_int32_t
 1.13 05-Feb-2005  simonb De-register.
 1.12 12-Jan-2005  xtraeme * Kill __P()
* ANSIfy
* No parenthesis are needed around the return value
 1.11 20-Jun-2004  jmc Completely rework how tools/compat is done. Purge all uses/references to
_NETBSD_SOURCE as this makes cross building from older/newer versions of
NetBSD harder, not easier (and also makes the resulting tools 'different')

Wrap all required code with the inclusion of nbtool_config.h, attempt to
only use POSIX code in all places (or when reasonable test w. configure and
provide definitions: ala u_int, etc).

Reviewed by lukem. Tested on FreeBSD 4.9, Redhat Linux ES3, NetBSD 1.6.2 x86
NetBSD current (x86 and amd64) and Solaris 9.

Fixes PR's: PR#17762 PR#25944
 1.10 20-Dec-2003  kleink branches: 1.10.2;
Update to keep file lengths in appropriate data types (off_t, as opposed
to u_int32_t).
 1.9 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22365, verified by myself.
 1.8 31-Mar-2002  bjh21 branches: 1.8.2;
Protect __RCSID and __COPYRIGHT from being invoked if not defined.
 1.7 21-Mar-2001  atatat Apparently changing crc() to ccrc() was bad, since mtree does a reachover.
Revert ccrc() to crc() and change local variables called crc to thecrc
instead.
 1.6 17-Oct-1997  lukem WARNSify
 1.5 27-Feb-1996  cgd what's the point of having prototypes if they're not actually _used_
in the appropriate places? include extern.h in these files, and fix
up the bugs that its inclusion uncovered.
 1.4 26-Mar-1995  glass merged with 4.4Lite
 1.3 02-Nov-1993  cgd update to the latest cksum utility from uunet. this one is posix
compliant (i think), and fixes a bogon in the old CRC calculation.
yes, that's right, the CRC's it generates are different.
 1.2 01-Aug-1993  mycroft Add RCS identifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 26-Mar-1995  glass Import from 4.4Lite
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.8.2.1 21-Dec-2003  tron Pull up revision 1.10 (requested by kleink in ticket #1580):
Update to keep file lengths in appropriate data types (off_t, as opposed
to u_int32_t).
 1.10.2.1 22-Jun-2004  tron Pull up revision 1.11 (requested by jmc in ticket #527):
Completely rework how tools/compat is done. Purge all uses/references to
_NETBSD_SOURCE as this makes cross building from older/newer versions of
NetBSD harder, not easier (and also makes the resulting tools 'different')
Wrap all required code with the inclusion of nbtool_config.h, attempt to
only use POSIX code in all places (or when reasonable test w. configure and
provide definitions: ala u_int, etc).
Reviewed by lukem. Tested on FreeBSD 4.9, Redhat Linux ES3, NetBSD 1.6.2 x86
NetBSD current (x86 and amd64) and Solaris 9.
Fixes PR's: PR#17762 PR#25944
 1.14 18-Mar-2021  cheusov cksum: use POSIX type uint32_t instead of u_int32_t
 1.13 05-Feb-2005  simonb De-register.
 1.12 12-Jan-2005  xtraeme * Kill __P()
* ANSIfy
* No parenthesis are needed around the return value
 1.11 20-Jun-2004  jmc Completely rework how tools/compat is done. Purge all uses/references to
_NETBSD_SOURCE as this makes cross building from older/newer versions of
NetBSD harder, not easier (and also makes the resulting tools 'different')

Wrap all required code with the inclusion of nbtool_config.h, attempt to
only use POSIX code in all places (or when reasonable test w. configure and
provide definitions: ala u_int, etc).

Reviewed by lukem. Tested on FreeBSD 4.9, Redhat Linux ES3, NetBSD 1.6.2 x86
NetBSD current (x86 and amd64) and Solaris 9.

Fixes PR's: PR#17762 PR#25944
 1.10 20-Dec-2003  kleink branches: 1.10.2;
Update to keep file lengths in appropriate data types (off_t, as opposed
to u_int32_t).
 1.9 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22365, verified by myself.
 1.8 31-Mar-2002  bjh21 branches: 1.8.2;
Protect __RCSID and __COPYRIGHT from being invoked if not defined.
 1.7 21-Mar-2001  atatat Apparently changing crc() to ccrc() was bad, since mtree does a reachover.
Revert ccrc() to crc() and change local variables called crc to thecrc
instead.
 1.6 17-Oct-1997  lukem WARNSify
 1.5 27-Feb-1996  cgd what's the point of having prototypes if they're not actually _used_
in the appropriate places? include extern.h in these files, and fix
up the bugs that its inclusion uncovered.
 1.4 26-Mar-1995  glass merged with 4.4Lite
 1.3 02-Nov-1993  cgd update to the latest cksum utility from uunet. this one is posix
compliant (i think), and fixes a bogon in the old CRC calculation.
yes, that's right, the CRC's it generates are different.
 1.2 01-Aug-1993  mycroft Add RCS identifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 26-Mar-1995  glass Import from 4.4Lite
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.8.2.1 21-Dec-2003  tron Pull up revision 1.10 (requested by kleink in ticket #1580):
Update to keep file lengths in appropriate data types (off_t, as opposed
to u_int32_t).
 1.10.2.1 22-Jun-2004  tron Pull up revision 1.11 (requested by jmc in ticket #527):
Completely rework how tools/compat is done. Purge all uses/references to
_NETBSD_SOURCE as this makes cross building from older/newer versions of
NetBSD harder, not easier (and also makes the resulting tools 'different')
Wrap all required code with the inclusion of nbtool_config.h, attempt to
only use POSIX code in all places (or when reasonable test w. configure and
provide definitions: ala u_int, etc).
Reviewed by lukem. Tested on FreeBSD 4.9, Redhat Linux ES3, NetBSD 1.6.2 x86
NetBSD current (x86 and amd64) and Solaris 9.
Fixes PR's: PR#17762 PR#25944

RSS XML Feed