summaryrefslogtreecommitdiffstats
path: root/bin/md5/md5.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Add explicit casts to double to quiet a clang warning.millert2020-10-191-2/+2
| | | | OK deraddt@
* Use ferror() to check for write error, not the fflush() return value.millert2020-10-031-2/+3
| | | | | We can't rely on buffering to catch write errors in fflush(). Based on a diff from Demi M. Obenour, OK kn@
* freezero() is of no use here, the computed digest is not a secret.otto2019-05-181-2/+2
| | | | ok millert@
* I am retiring my old email address; replace it with my OpenBSD one.millert2019-01-251-2/+2
|
* fgetln(3) -> getline(3); from Lauri Tirkkonen; ok millert@cheloha2018-09-071-21/+20
|
* Use getrusage(2) for the built-in time trial instead of getttimeofday(2).millert2017-09-111-5/+7
| | | | | | This makes it possible to measure just the ellapsed user time, which is what we really care about when benchmarking an algorithm. OK deraadt@
* obvious use for freezero()deraadt2017-05-221-3/+2
|
* In -C mode, process all checksums that match the specified file(s),millert2017-04-261-6/+22
| | | | not just the first one that matches. OK deraadt@
* Move declaration of an 'i' inside the scope of its use. Which inkrw2016-12-161-4/+3
| | | | | | | turn is inside an #ifdef. Thus making the code clearer by eliminating an #ifdef in the middle of the declarations. Suggested by millert@
* Eliminate some gcc warnings about 'unused variables', mostly bykrw2016-12-161-2/+5
| | | | | | adding appropriate #ifdef's around declarations. ok millert@ (with a tweak I will commit separately)
* add sha512/256 support to check that the libc code is right :)tedu2016-09-031-1/+12
|
* Pull in <sys/time.h> for gettimeofday()guenther2016-08-261-1/+2
|
* all of the update functions take a size_t. correct type and casts.tedu2016-07-291-18/+17
| | | | ok deraadt millert
* Remove NULL-check before free(). ok tb@mmcc2015-12-091-3/+2
|
* normalize the ordering of tame requests (particularily, "rpath wpath cpath",deraadt2015-10-101-2/+2
| | | | | | | which i have put in that order). this is not important, but helps look for outliers which might be strange. it hints that "ioctl" should be reassessed in a few places, to see if "tty" is better; that "unix" may be used in some places where "route" could now work.
* Change all tame callers to namechange to pledge(2).deraadt2015-10-091-5/+5
|
* Repair tame() error check to be == -1deraadt2015-10-041-2/+2
|
* right at startup, this can tame "stdio cpath rpath wpath". after getoptderaadt2015-10-031-1/+7
| | | | | | -h has handled write/creating a file, we can drop to tame "stdio rpath" since md5 will only read files after that. i believe i involved lteo for this.
* cleanup of the SMALL hiding from Mathias Svenssonderaadt2015-01-191-2/+4
|
* Replace <sys/param.h> with <limits.h> and other less dirty headers wherederaadt2015-01-161-5/+5
| | | | | | | | | possible. Annotate <sys/param.h> lines with their current reasons. Switch to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where sensible to avoid pulling in the pollution. These are the files confirmed through binary verification. ok guenther, millert, doug (helped with the verification protocol)
* Replace all queue *_END macro calls except CIRCLEQ_END with NULL.doug2014-09-131-2/+2
| | | | | | | | CIRCLEQ_* is deprecated and not called in the tree. The other queue types have *_END macros which were added for symmetry with CIRCLEQ_END. They are defined as NULL. There's no reason to keep the other *_END macro calls. ok millert@
* Fix memory leak in digest_file() on ferror(). OK tedu@ lteo@millert2014-06-191-1/+5
|
* Ignore the -b option if cksum is called as-is (e.g. "cksum -b /bsd")lteo2014-03-261-2/+2
| | | | | | | as documented on the cksum(1) man page. "looks right" deraadt@ ok millert@
* purge sum and sysvsum code. ok deraadt jmc lteo millerttedu2014-03-201-46/+5
| | | | a few initial leftovers spotted by naddy
* remove insecure MD4 checksum algorithm; ok tedu@, man page ok jmc@naddy2014-03-201-13/+1
| | | | | "A collision attack published in 2007 can find collisions for full MD4 in less than two hash operations."
* When using the -C option, exit with an exit status of 1 if any of thelteo2014-03-071-14/+27
| | | | | | files specified on the command line do not exist in the checklist. ok deraadt@ tedu@
* add -C to the man page, and adjust usage();jmc2014-01-151-4/+4
| | | | ok lteo
* Add support for a -C option. It works on a checklist like -c but onlylteo2014-01-151-14/+35
| | | | | | | | | does the checksum comparison for selected files that are specified on the command line. idea discussed with deraadt@ and tedu@ manpage feedback jmc@ feedback/OK deraadt@ millert@
* Also move case 'c' into the #ifdef for a smaller binary. It will fall intoderaadt2014-01-121-4/+4
| | | | | default, giving a nice failure. I have not removed -c from the usage() or getopt() because it is too much butchering...
* use -DSHA2_ONLY to be more clear about what we are butcheringderaadt2014-01-111-21/+21
| | | | idea from tedu
* catch up to the fact that md5/sha* got merged, and document -c consistently;jmc2014-01-101-8/+7
| | | | | | some style and cleanup tweaks while here ok deraadt
* When using a checklist, print MISSING for non-existent files.lteo2014-01-101-2/+4
| | | | | | Based on an earlier diff by tedu@ Requested by deraadt@ OK deraadt@
* the -c option is really a mode change, incompatible with other options.tedu2014-01-101-3/+5
| | | | | | (there are some others too, but -c is particularly misleading.) split it out in synopsis and usage. ok deraadt
* Fix wrapping of usage message for cksum.millert2014-01-081-3/+3
|
* err() not errx() when fopen fails.millert2014-01-081-6/+6
|
* Remove NHASHES, it is not needed and is incompatible with #ifdef SMALL.millert2014-01-081-37/+28
| | | | | Remove style_hash and style_cksum, adjust the style of the selected algorithms based on rflag and qflag instead.
* Remove pmode, fix hfile open mode, check return value when writingmillert2014-01-081-38/+21
| | | | file name to stdout.
* Add -DSMALL support to kill a lot of the unncecessary hashes and checksumsderaadt2014-01-081-13/+54
| | | | | that the install media won't need ok millert, but he used the word butcher!
* Add support for -h hashfile. This is very useful with with -p, in a pipeline,deraadt2014-01-081-12/+21
| | | | | to deliver the hash output to a different location. ok millert
* install a link as sha512. simplify program internals; there are onlytedu2013-12-231-20/+3
| | | | two modes. ok deraadt gilles jca
* add unsigned char casts for specific calls to ctype.h macros.deraadt2013-11-211-3/+3
| | | | ok guenther step
* SHA-224 is to SHA-256 as SHA-384 is to SHA-512. It was added in amillert2013-04-151-2/+12
| | | | later revision of FIPS-180. OK miod@ jmc@ guenther@ djm@
* Return an exit code of 1 if the file cannot be opened (e.g. file doeslteo2013-03-301-7/+8
| | | | | | | | not exist), or if there is an error reading the file stream. From Patrik Lundin, thanks! ok deraadt
* replace sys/param.h with sys/types.h (and sometimes add limits.h if needed)deraadt2012-12-041-2/+6
| | | | ok guenther
* fix memset sizeof, found by jsg. ok krwtedu2011-07-051-2/+3
|
* Use a 32KB data buffer instead of a 1KB buffer.millert2010-10-271-3/+3
|
* Use stdio when reading in the file to be checksummed. This can improvemillert2010-10-251-26/+25
| | | | | performance due to the internal buffering stdio does wrt the optimal read size (st_blksize). OK mikeb@
* adapt to sha2(3) API changes; ok millert@djm2008-09-061-16/+14
|
* md5(1), sha1(1), rmd160(1), cksum(1) and sum(1) have different options;sobrado2008-07-291-12/+56
| | | | | | | | | while here, some KNF improvements. based on a diff for compress(1) written by millert@, fixes from guenther@ and pyr@. ok millert@, pyr@; (for the manual page tweaks) jmc@
* properly exit >0 when encountering bad md5 in cheklistchl2007-11-071-5/+5
| | | | | | ok gilles@ millert@ From Tim van der Molen <tbvdm.lists at xs4all.nl>