Commit Graph

77 Commits

Author SHA1 Message Date
christos 11c53ad61c 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.
2006-10-30 20:22:53 +00:00
christos 2541a5f2fe use c99 initializer. 2006-10-22 16:14:07 +00:00
elad d4d70cef20 PR/34584: Geoff C. Wing: cksum not closing filescriptors after finishing
processing files.
Applied patch, thanks!
2006-09-22 22:35:57 +00:00
dsl 75469d03e1 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 :-(
2006-09-04 20:01:10 +00:00
wiz 127e5ecbd6 Bump date for previous. 2006-09-02 23:27:45 +00:00
elad 0b20a6d87c mention we support sha2, pointed out by dieter roelants
okay hubertf
2006-08-25 10:40:25 +00:00
hubertf 97c6c066c2 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)
2006-05-07 12:22:55 +00:00
elad 00556c3786 remove -1, -2, -4, -5, -6, -m. 2006-05-05 22:07:22 +00:00
wiz 61152e3f56 Document more explicitly that -c takes an optional file argument. 2006-04-24 22:00:43 +00:00
hubertf 0b4add3077 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
2006-04-24 21:07:43 +00:00
hubertf 1e8e9dee9c 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
2006-04-24 19:41:41 +00:00
wiz f255a1f958 A fix for HTML output; punctuation nits. 2006-04-23 17:45:04 +00:00
hubertf 944a4820a3 Document -w, too. 2006-04-23 16:48:02 +00:00
hubertf f9e91b57ed 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@.
2006-04-23 16:40:16 +00:00
elad ba1244744f sync usage(). 2006-01-15 16:50:05 +00:00
elad a375b7cdb7 Use crypto/rmd160.h. 2005-09-24 22:40:32 +00:00
wiz 3025498c62 Use correct macro. From YOMURA Masanori in private mail. 2005-09-11 23:11:48 +00:00
wiz 775247d100 Punctuation nits. 2005-09-10 22:14:52 +00:00
elad 6383828527 Avoid defining max. hash length ugliness simply by passing NULL for the
buffer to the File routines.

Noted by pooka@.
2005-09-02 17:39:23 +00:00
elad 871155c6cf Forgot +1 for NUL termination. 2005-09-02 16:52:34 +00:00
elad 50b96d774b Use MAXHASHLEN to indicate largest possible hash.
Fixes buffer overflow found by xtraeme@.
2005-09-02 16:52:03 +00:00
tron a73f6299d6 Fix host tool build which got broken when SHA2 support was added. 2005-08-25 09:51:23 +00:00
elad 3722a15dc3 Add support for SHA2 in cksum. 2005-08-24 19:59:08 +00:00
elad eee731374f Fix some lint warnings. 2005-08-24 19:44:45 +00:00
elad d5f9e57cff Put back in information about the deprecated flags in the man-page. Be
explicit about them being removed, and suggest using the ``-a'' flag.
2005-08-23 15:29:48 +00:00
elad b4df0b712a Note about deprecated flags. 2005-08-22 14:47:55 +00:00
elad 7345c13cbb 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.
2005-08-21 19:33:10 +00:00
elad a7d7292dfa 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''.
2005-08-21 18:51:44 +00:00
simonb 61064aebe6 De-register. 2005-02-05 00:13:34 +00:00
xtraeme 691a36f2ea whitespace, remove main() prototype. 2005-01-20 15:44:59 +00:00
xtraeme ea13a7dd7d ANSIfy another function missed in previous. 2005-01-12 17:10:05 +00:00
xtraeme 5c1d419d06 * Kill __P()
* ANSIfy
* No parenthesis are needed around the return value
2005-01-12 17:04:35 +00:00
xtraeme b363f90b86 WARNS=3 2005-01-12 16:42:45 +00:00
wiz 5f59441cc8 -p, -s, -t, and -x are mutually exclusive -- make it obvious in
the SYNOPSIS.
2004-07-09 11:47:59 +00:00
wiz a82c1f4b83 Add missing -n, -1, -2, -4, -5, and -6 to cksum usage.
From Kouichirou Hiratsuka in PR 26195.
2004-07-09 11:44:30 +00:00
jmc b2f782612f 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
2004-06-20 22:20:14 +00:00
simonb 9bc855a931 s/the the/the/ (only in sources that aren't regularly imported from
elsewhere).
2004-04-23 02:58:27 +00:00
kleink 4bd5e026a4 Update to keep file lengths in appropriate data types (off_t, as opposed
to u_int32_t).
2003-12-20 23:41:38 +00:00
lukem 171d653219 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).
2003-10-27 00:12:41 +00:00
agc 89aaa1bb64 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22365, verified by myself.
2003-08-07 11:13:06 +00:00
wiz 7533801933 End sentence with a dot. 2003-06-26 17:00:55 +00:00
lukem 826a14607a 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.
2003-05-18 07:57:31 +00:00
jmmv 59978ac5c6 Fix typo: extra 'a' word in plural sentence. Approved by wiz. 2002-12-26 15:49:37 +00:00
wiz e2a4ec505f Bump date for last. 2002-10-18 22:44:48 +00:00
atatat 9dfabd39b8 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 '
2002-10-18 20:30:12 +00:00
grant be8ae688ae New sentence, new line. 2002-09-30 11:08:56 +00:00
bjh21 8088602c68 Protect __RCSID and __COPYRIGHT from being invoked if not defined. 2002-03-31 14:43:22 +00:00
bjh21 efc4b53dc6 Add the necessary bits to make cksum buildable as a host tool. 2002-03-31 14:30:20 +00:00
ross 2a76afae02 Generate <>& symbolically. I'm avoiding .../dist/... directories for now. 2002-02-08 01:36:18 +00:00
mycroft 201d66a064 Remove calculation of crc_total from here, making the routine approximately
twice as fast.
2001-11-10 05:16:43 +00:00