History log of /freebsd-11-stable/lib/libmd/
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
336346 16-Jul-2018 kevans

MFC r304910, r304912, r304915, r304952, r325019, r328164, r331094, r332664,
r335341-r335345, r335347, r335379-r335380, r335382

r304910:
Introduce cnv man page.

r304912:
Add missed header file for cnv.h .

r304915:
Bump date in the man page.

r304952:
Remove duplicated declaration.

r325019:
Introduce cnvlist_name() and cnvlist_type() functions.

Those function can be used when we are iterating over nvlist to reduce
amount of extra variables we need to declare.

r328164:
libnv: Use mallocarray(9) for the nv_calloc.

r331094:
Fix formatting errors that resulted in apropos(1) output looking weird.

r332664:
Add missing argument in the cnv man page.

r335341:
libnv: change name of cookie from cookiep to cookie.

The name was inconsistent with rest of the library.
No functional change intended.

r335342:
libnv: add const to cookies arguments

r335343:
libnv: Remove nvlist argument from cnvlist_{take,free}_* functions.

All information which are need for those operations is already stored in
the cookie.

We decided not to bump libnv version because this API is not used yet in the
base system.

r335344:
libnv: clean parent in nvlist_array when removing it.

When we are removing element form the nvlist we should also clean parent,
because the array is not a part of the nvlist anymore.

r335345:
libnv: add regression test for r335344.

r335347:
libnv: Add nvlist_append_*_array() family of functions.

The nvlist_append_{bool,number,string,nvlist,descriptor}_array() functions
allows to dynamically extend array stored in the nvlist.

r335379:
Set prev to NULL so its garaunteed to have a value of some kind and
gcc doesn't explode. Feel free to fix this correctly or whatever for
gcc builds.

This *should* quiesce tinderbox after r335347 for the gcc builds.

r335380:
style(9) fix, I was also going to silence gcc.

r335382:
Really fix the style.

315724 22-Mar-2017 bdrewery

MFC r314709,r314790,r314794:

r314709:
Fix bootstrapping mtree after r313404 for older systems.
r314790:
Added comments for why nmtree/libmd are bootstrapped.
r314794:
Fix bootstrapping libmd on older systems after r314709.

PR: 217673

313538 10-Feb-2017 ngie

MFC r312452-r312512:

r312452-r312512:

- Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

This simplifies pathing in make/displayed output

- Use .CURDIR:H instead of .CURDIR to simplify pathing in output, etc


/freebsd-11-stable/lib/csu/aarch64/Makefile
/freebsd-11-stable/lib/csu/amd64/Makefile
/freebsd-11-stable/lib/csu/arm/Makefile
/freebsd-11-stable/lib/csu/i386/Makefile
/freebsd-11-stable/lib/csu/mips/Makefile
/freebsd-11-stable/lib/csu/powerpc/Makefile
/freebsd-11-stable/lib/csu/powerpc64/Makefile
/freebsd-11-stable/lib/csu/riscv/Makefile
/freebsd-11-stable/lib/csu/sparc64/Makefile
/freebsd-11-stable/lib/libalias/libalias/Makefile
/freebsd-11-stable/lib/libalias/modules/Makefile
/freebsd-11-stable/lib/libalias/modules/Makefile.inc
/freebsd-11-stable/lib/libarchive/Makefile
/freebsd-11-stable/lib/libauditd/Makefile
/freebsd-11-stable/lib/libbegemot/Makefile
/freebsd-11-stable/lib/libblocksruntime/Makefile
/freebsd-11-stable/lib/libbluetooth/Makefile
/freebsd-11-stable/lib/libbsm/Makefile
/freebsd-11-stable/lib/libbsnmp/libbsnmp/Makefile
/freebsd-11-stable/lib/libbz2/Makefile
/freebsd-11-stable/lib/libc++/Makefile
/freebsd-11-stable/lib/libc_nonshared/Makefile
/freebsd-11-stable/lib/libcam/Makefile
/freebsd-11-stable/lib/libcom_err/Makefile
/freebsd-11-stable/lib/libcompat/Makefile
/freebsd-11-stable/lib/libcrypt/Makefile
/freebsd-11-stable/lib/libcxxrt/Makefile
/freebsd-11-stable/lib/libdevdctl/tests/Makefile
/freebsd-11-stable/lib/libdwarf/Makefile
/freebsd-11-stable/lib/libelf/Makefile
/freebsd-11-stable/lib/libevent/Makefile
/freebsd-11-stable/lib/libexecinfo/Makefile
/freebsd-11-stable/lib/libexpat/Makefile
/freebsd-11-stable/lib/libgssapi/Makefile
/freebsd-11-stable/lib/libiconv_modules/Makefile.inc
/freebsd-11-stable/lib/libiconv_modules/mapper_parallel/Makefile
/freebsd-11-stable/lib/libkiconv/Makefile
/freebsd-11-stable/lib/libldns/Makefile
/freebsd-11-stable/lib/liblzma/Makefile
/freebsd-11-stable/lib/libmagic/Makefile
Makefile
/freebsd-11-stable/lib/libmilter/Makefile
/freebsd-11-stable/lib/libmp/Makefile
/freebsd-11-stable/lib/libngatm/Makefile
/freebsd-11-stable/lib/libnv/Makefile
/freebsd-11-stable/lib/libopie/Makefile
/freebsd-11-stable/lib/libpam/libpam/Makefile
/freebsd-11-stable/lib/libpam/modules/Makefile.inc
/freebsd-11-stable/lib/libpam/modules/pam_passwdqc/Makefile
/freebsd-11-stable/lib/libpam/modules/pam_ssh/Makefile
/freebsd-11-stable/lib/libpam/static_libpam/Makefile
/freebsd-11-stable/lib/libpcap/Makefile
/freebsd-11-stable/lib/libpe/Makefile
/freebsd-11-stable/lib/libproc/Makefile
/freebsd-11-stable/lib/libprocstat/zfs/Makefile
/freebsd-11-stable/lib/librpcsec_gss/Makefile
/freebsd-11-stable/lib/librpcsvc/Makefile
/freebsd-11-stable/lib/librt/Makefile
/freebsd-11-stable/lib/libsbuf/Makefile
/freebsd-11-stable/lib/libsm/Makefile
/freebsd-11-stable/lib/libsmb/Makefile
/freebsd-11-stable/lib/libsmdb/Makefile
/freebsd-11-stable/lib/libsmutil/Makefile
/freebsd-11-stable/lib/libsqlite3/Makefile
/freebsd-11-stable/lib/libstdthreads/Makefile
/freebsd-11-stable/lib/libsysdecode/Makefile
/freebsd-11-stable/lib/libtelnet/Makefile
/freebsd-11-stable/lib/libthr/Makefile
/freebsd-11-stable/lib/libthr/support/Makefile.inc
/freebsd-11-stable/lib/libthread_db/Makefile
/freebsd-11-stable/lib/libufs/Makefile
/freebsd-11-stable/lib/libulog/Makefile
/freebsd-11-stable/lib/libunbound/Makefile
/freebsd-11-stable/lib/libutil/Makefile
/freebsd-11-stable/lib/libypclnt/Makefile
/freebsd-11-stable/lib/ncurses/config.mk
/freebsd-11-stable/lib/ncurses/form/Makefile
/freebsd-11-stable/lib/ncurses/formw/Makefile
/freebsd-11-stable/lib/ncurses/menu/Makefile
/freebsd-11-stable/lib/ncurses/menuw/Makefile
/freebsd-11-stable/lib/ncurses/ncurses/Makefile
/freebsd-11-stable/lib/ncurses/ncursesw/Makefile
/freebsd-11-stable/lib/ncurses/panel/Makefile
/freebsd-11-stable/lib/ncurses/panelw/Makefile
310372 21-Dec-2016 emaste

MFC r307521: libmd: introduce functions that operate on fd instead of filename

309023 22-Nov-2016 asomers

MFC r307584

Fix C++ includability of crypto headers with static array sizes

C99 allows array function parameters to use the static keyword for their
sizes. This tells the compiler that the parameter will have at least the
specified size, and calling code will fail to compile if that guarantee is
not met. However, this syntax is not legal in C++.

This commit reverts r300824, which worked around the problem for
sys/sys/md5.h only, and introduces a new macro: min_size(). min_size(x) can
be used in headers as a static array size, but will still compile in C++
mode.

302408 08-Jul-2016 gjb

Copy head@r302406 to stable/11 as part of the 11.0-RELEASE cycle.
Prune svn:mergeinfo from the new branch, as nothing has been merged
here.

Additional commits post-branch will follow.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


/freebsd-11-stable/MAINTAINERS
/freebsd-11-stable/cddl
/freebsd-11-stable/cddl/contrib/opensolaris
/freebsd-11-stable/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print
/freebsd-11-stable/cddl/contrib/opensolaris/cmd/zfs
/freebsd-11-stable/cddl/contrib/opensolaris/lib/libzfs
/freebsd-11-stable/contrib/amd
/freebsd-11-stable/contrib/apr
/freebsd-11-stable/contrib/apr-util
/freebsd-11-stable/contrib/atf
/freebsd-11-stable/contrib/binutils
/freebsd-11-stable/contrib/bmake
/freebsd-11-stable/contrib/byacc
/freebsd-11-stable/contrib/bzip2
/freebsd-11-stable/contrib/com_err
/freebsd-11-stable/contrib/compiler-rt
/freebsd-11-stable/contrib/dialog
/freebsd-11-stable/contrib/dma
/freebsd-11-stable/contrib/dtc
/freebsd-11-stable/contrib/ee
/freebsd-11-stable/contrib/elftoolchain
/freebsd-11-stable/contrib/elftoolchain/ar
/freebsd-11-stable/contrib/elftoolchain/brandelf
/freebsd-11-stable/contrib/elftoolchain/elfdump
/freebsd-11-stable/contrib/expat
/freebsd-11-stable/contrib/file
/freebsd-11-stable/contrib/gcc
/freebsd-11-stable/contrib/gcclibs/libgomp
/freebsd-11-stable/contrib/gdb
/freebsd-11-stable/contrib/gdtoa
/freebsd-11-stable/contrib/groff
/freebsd-11-stable/contrib/ipfilter
/freebsd-11-stable/contrib/ldns
/freebsd-11-stable/contrib/ldns-host
/freebsd-11-stable/contrib/less
/freebsd-11-stable/contrib/libarchive
/freebsd-11-stable/contrib/libarchive/cpio
/freebsd-11-stable/contrib/libarchive/libarchive
/freebsd-11-stable/contrib/libarchive/libarchive_fe
/freebsd-11-stable/contrib/libarchive/tar
/freebsd-11-stable/contrib/libc++
/freebsd-11-stable/contrib/libc-vis
/freebsd-11-stable/contrib/libcxxrt
/freebsd-11-stable/contrib/libexecinfo
/freebsd-11-stable/contrib/libpcap
/freebsd-11-stable/contrib/libstdc++
/freebsd-11-stable/contrib/libucl
/freebsd-11-stable/contrib/libxo
/freebsd-11-stable/contrib/llvm
/freebsd-11-stable/contrib/llvm/projects/libunwind
/freebsd-11-stable/contrib/llvm/tools/clang
/freebsd-11-stable/contrib/llvm/tools/lldb
/freebsd-11-stable/contrib/llvm/tools/llvm-dwarfdump
/freebsd-11-stable/contrib/llvm/tools/llvm-lto
/freebsd-11-stable/contrib/mdocml
/freebsd-11-stable/contrib/mtree
/freebsd-11-stable/contrib/ncurses
/freebsd-11-stable/contrib/netcat
/freebsd-11-stable/contrib/ntp
/freebsd-11-stable/contrib/nvi
/freebsd-11-stable/contrib/one-true-awk
/freebsd-11-stable/contrib/openbsm
/freebsd-11-stable/contrib/openpam
/freebsd-11-stable/contrib/openresolv
/freebsd-11-stable/contrib/pf
/freebsd-11-stable/contrib/sendmail
/freebsd-11-stable/contrib/serf
/freebsd-11-stable/contrib/sqlite3
/freebsd-11-stable/contrib/subversion
/freebsd-11-stable/contrib/tcpdump
/freebsd-11-stable/contrib/tcsh
/freebsd-11-stable/contrib/tnftp
/freebsd-11-stable/contrib/top
/freebsd-11-stable/contrib/top/install-sh
/freebsd-11-stable/contrib/tzcode/stdtime
/freebsd-11-stable/contrib/tzcode/zic
/freebsd-11-stable/contrib/tzdata
/freebsd-11-stable/contrib/unbound
/freebsd-11-stable/contrib/vis
/freebsd-11-stable/contrib/wpa
/freebsd-11-stable/contrib/xz
/freebsd-11-stable/crypto/heimdal
/freebsd-11-stable/crypto/openssh
/freebsd-11-stable/crypto/openssl
/freebsd-11-stable/gnu/lib
/freebsd-11-stable/gnu/usr.bin/binutils
/freebsd-11-stable/gnu/usr.bin/cc/cc_tools
/freebsd-11-stable/gnu/usr.bin/gdb
/freebsd-11-stable/lib/libc/locale/ascii.c
/freebsd-11-stable/sys/cddl/contrib/opensolaris
/freebsd-11-stable/sys/contrib/dev/acpica
/freebsd-11-stable/sys/contrib/ipfilter
/freebsd-11-stable/sys/contrib/libfdt
/freebsd-11-stable/sys/contrib/octeon-sdk
/freebsd-11-stable/sys/contrib/x86emu
/freebsd-11-stable/sys/contrib/xz-embedded
/freebsd-11-stable/usr.sbin/bhyve/atkbdc.h
/freebsd-11-stable/usr.sbin/bhyve/bhyvegc.c
/freebsd-11-stable/usr.sbin/bhyve/bhyvegc.h
/freebsd-11-stable/usr.sbin/bhyve/console.c
/freebsd-11-stable/usr.sbin/bhyve/console.h
/freebsd-11-stable/usr.sbin/bhyve/pci_fbuf.c
/freebsd-11-stable/usr.sbin/bhyve/pci_xhci.c
/freebsd-11-stable/usr.sbin/bhyve/pci_xhci.h
/freebsd-11-stable/usr.sbin/bhyve/ps2kbd.c
/freebsd-11-stable/usr.sbin/bhyve/ps2kbd.h
/freebsd-11-stable/usr.sbin/bhyve/ps2mouse.c
/freebsd-11-stable/usr.sbin/bhyve/ps2mouse.h
/freebsd-11-stable/usr.sbin/bhyve/rfb.c
/freebsd-11-stable/usr.sbin/bhyve/rfb.h
/freebsd-11-stable/usr.sbin/bhyve/sockstream.c
/freebsd-11-stable/usr.sbin/bhyve/sockstream.h
/freebsd-11-stable/usr.sbin/bhyve/usb_emul.c
/freebsd-11-stable/usr.sbin/bhyve/usb_emul.h
/freebsd-11-stable/usr.sbin/bhyve/usb_mouse.c
/freebsd-11-stable/usr.sbin/bhyve/vga.c
/freebsd-11-stable/usr.sbin/bhyve/vga.h
300921 29-May-2016 allanjude

Import the skein hashing algorithm, based on the threefish block cipher

Connect it to userland (libmd, libcrypt, sbin/md5) and kernel (crypto.ko)

Support for skein as a ZFS checksum algorithm was introduced in r289422
but is disconnected because FreeBSD lacked a Skein implementation.

A further commit will enable it in ZFS.

Reviewed by: cem
Sponsored by: ScaleEngine Inc.
Differential Revision: https://reviews.freebsd.org/D6166


300903 28-May-2016 allanjude

Implement SHA-512 truncated (224 and 256 bits)

This implements SHA-512/256, which generates a 256 bit hash by
calculating the SHA-512 then truncating the result. A different initial
value is used, making the result different from the first 256 bits of
the SHA-512 of the same input. SHA-512 is ~50% faster than SHA-256 on
64bit platforms, so the result is a faster 256 bit hash.

The main goal of this implementation is to enable support for this
faster hashing algorithm in ZFS. The feature was introduced into ZFS
in r289422, but is disconnected because SHA-512/256 support was missing.
A further commit will enable it in ZFS.

This is the follow on to r292782

Reviewed by: cem
Sponsored by: ScaleEngine Inc.
Differential Revision: https://reviews.freebsd.org/D6061


300824 27-May-2016 cem

libmd: Work around C++'s inability to understand C

Reported by: antoine@ (x265)


298107 16-Apr-2016 gjb

Merge the projects/release-pkg branch to head.

This allows packaging the base system with pkg(8), including
but not limited to providing the ability to provide upstream
binary update possibilities for non-tier-1 architectures.

This merge is a requirement of the 11.0-RELEASE, and as such,
thank you to everyone that has tested the project branch.

Documentation in build(7) etc. is still somewhat sparse, but
updates to those parts will follow.

Sponsored by: The FreeBSD Foundation


295989 24-Feb-2016 bdrewery

DIRDEPS_BUILD: Regenerate without local dependencies.

These are no longer needed after the recent 'beforebuild: depend' changes
and hooking DIRDEPS_BUILD into a subset of FAST_DEPEND which supports
skipping 'make depend'.

Sponsored by: EMC / Isilon Storage Division


294037 14-Jan-2016 jtl

Improvements to the MDXFileChunk() template function:
- Remove unneeded fstat()/lseek() calls.
- Return NULL and set errno to EINVAL on negative length.
- Fix small style problems and expand variable names.

After this change, it is possible to use this code for some irregular
files. For example, 'md5 /dev/md0' should now succeed.

Differential Revision: https://reviews.freebsd.org/D4748
Suggested by: bde
Reviewed by: bde, allanjude, delphij


293345 07-Jan-2016 bdrewery

DIRDEPS_BUILD: Update dependencies.

Sponsored by: EMC / Isilon Storage Division


292955 30-Dec-2015 jtl

Fix a file descriptor leak in mdXhl.c (which is used by numerous hashing
algorithms.

CID: 1305669,1305611,1305663,1305603,1305584,1305639,1346865,1305601
Differential Revision: https://reviews.freebsd.org/D4732
Reviewed by: allanjude, delphij
MFC after: 2 weeks
Sponsored by: Juniper Networks


292782 27-Dec-2015 allanjude

Replace sys/crypto/sha2/sha2.c with lib/libmd/sha512c.c

cperciva's libmd implementation is 5-30% faster

The same was done for SHA256 previously in r263218

cperciva's implementation was lacking SHA-384 which I implemented, validated against OpenSSL and the NIST documentation

Extend sbin/md5 to create sha384(1)

Chase dependancies on sys/crypto/sha2/sha2.{c,h} and replace them with sha512{c.c,.h}

Reviewed by: cperciva, des, delphij
Approved by: secteam, bapt (mentor)
MFC after: 2 weeks
Sponsored by: ScaleEngine Inc.
Differential Revision: https://reviews.freebsd.org/D3929


291322 25-Nov-2015 bdrewery

META MODE: Remove unneeded libmd.host dependency for xinstall.host.

This is chasing r291026.

Sponsored by: EMC / Isilon Storage Division


291321 25-Nov-2015 bdrewery

META MODE: Fix 'make bootstrap-tools'.

The main problem was bitrot after elftoolchain being swapped in for the
GNU toolchain.

This also reworks how the list of 'host allowed' libraries is determined
to only allow INTERNALLIBs, which is needed for libelftc to come in.

For usr.bin/readelf use the same hack, as libelf and libdward, to bring in
the needed sys/ headers for host builds. This has not yet been a problem due
to readelf not being built as a host tool in buildworld. This is possible
in the meta build though when building the toolchain.

Sponsored by: EMC / Isilon Storage Division


291307 25-Nov-2015 bdrewery

META MODE: Prefer INSTALL=tools/install.sh to lessen the need for xinstall.host.

This both avoids some dependencies on xinstall.host and allows
bootstrapping on older releases to work due to lack of at least 'install -l'
support.

Sponsored by: EMC / Isilon Storage Division


285417 12-Jul-2015 rodrigc

Add new include path for sha256.h

This fixes the bootstrap build on FreeBSD 10.

Submitted by: andrew


285366 11-Jul-2015 jmg

Complete the move that was started w/ r263218.. For some reason I
didn't delete the files, so that means we need to bring the changes in
r282726 to the correct files..

make tinderbox completed with this patch...


285324 09-Jul-2015 jmg

increase buffer size to significantly increase performance...

see:
https://docs.freebsd.org/cgi/mid.cgi?20150513080342.GE37063@funkthat.com

for benchmarks...


284481 16-Jun-2015 sjg

new depends


284421 15-Jun-2015 bapt

Revert r284417 it is not necessary anymore


284417 15-Jun-2015 bapt

Enforce overwritting SHLIBDIR

Since METAMODE has been added, sys.mk loads bsd.mkopt.mk which ends load loading
bsd.own.mk which then defines SHLIBDIR before all the Makefile.inc everywhere.

This makes /lib being populated again.

Reported by: many


284345 13-Jun-2015 sjg

Add META_MODE support.

Off by default, build behaves normally.
WITH_META_MODE we get auto objdir creation, the ability to
start build from anywhere in the tree.

Still need to add real targets under targets/ to build packages.

Differential Revision: D2796
Reviewed by: brooks imp


282774 11-May-2015 thomas

Unbreak MIPS build following rev. 282726

Introduce further adjustments to the renaming of libmd
symbols: make sure that we do not generate dangling weak
aliases, as this causes build failures on MIPS.

Tested by: sbruno


282736 10-May-2015 thomas

Unbreak build following rev. 282726

(Makefile.inc1): add dependency of xinstall on libmd to
avoid failure of parallel bootstrap.

(lib/libmd/*.h): do not redefine symbols if already
defined as macros (libcrypt uses the same sources internally,
redefining symbols with a prefix of its own).

Fixes build failures caused by previous change to libmd.

Reported by: ian
Pointy hat to: thomas


282726 10-May-2015 thomas

Ensure libmd symbols do not clash with libcrypto

Add a prefix to all symbols in libmd to avoid incompatibilites
with same-named, but not binary compatible, symbols from libcrypto.

Also introduce Weak aliases to avoid the need to rebuild dependent
binaries and a major version bump.

PR: 199119
Differential Revision: D2216
Reviewed by: roberto, delphij
MFC after: 2 weeks


281928 24-Apr-2015 ngie

Avoid an infinite loop by ensuring that the amount of bytes read is greater
than 0 in MDXFileChunk when calculating the checksum

This edgecase can be triggered if the file is truncated while the checksum
is being calculated (i.e. the EOF is reached)

Differential Revision: https://reviews.freebsd.org/D2351 (patch by darius)
PR: 196694
Reviewed by: delphij, ngie
Submitted by: Daniel O'Connor <darius@dons.net.au>
Sponsored by: EMC / Isilon Storage Division


275004 25-Nov-2014 emaste

Revert r274772: it is not valid on MIPS

Reported by: sbruno


274772 21-Nov-2014 emaste

Use canonical __PIC__ flag

It is automatically set when -fPIC is passed to the compiler.

Reviewed by: dim, kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D1179


267773 23-Jun-2014 bapt

use .Mt to mark up email addresses consistently (part3)

PR: 191174
Submitted by: Franco Fichtner <franco at lastsummer.de>


263863 28-Mar-2014 gjb

Dereference nonexistent md2(3) manual.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation


263218 16-Mar-2014 jmg

replace the kernel's version w/ cperciva's implementation... In all
my tests, it is faster ~20%, even on an old IXP425 533MHz it is ~45%
faster... This is partly due to loop unrolling, so the code size does
significantly increase... I do plan on committing a version that
rolls up the loops again for smaller code size for embedded systems
where size is more important than absolute performance (it'll save ~6k
code)...

The kernel implementation is now shared w/ userland's libcrypt and
libmd...

We drop support for sha256 from sha2.c, so now sha2.c only contains
sha384 and sha512...

Reviewed by: secteam@


260554 11-Jan-2014 jmg

use a real uint64_t instead of writing code to emulate one..

I verified w/ a:
dd if=/dev/zero bs=1m count=5000 | sha256
a33351fafd00e4c4bcdee2a1c5d019026500f8cdfeaf91a9b8dbbb2619429659

Reviewed by: cperciva
MFC after: 1 week


234746 28-Apr-2012 obrien

Remove the RFC 1319 MD2 Message-Digest Algorithm routines from libmd.

1. The licensing terms for the MD2 routines from RFC is not under a BSD-like
license. Instead it is only granted for non-commercial Internet
Privacy-Enhanced Mail.
2. MD2 is quite deprecated as it is no longer considered a cryptographically
strong algorithm.

Discussed with: so (cperciva), core


223582 27-Jun-2011 cperciva

Rewrite HISTORY: The SHA256 code first appeared in 6.0, and the SHA512
code in 9.0; neither existed in FreeBSD 4.0.


220496 09-Apr-2011 markm

Add SHA512 (Actually, this is Colin Percival's code for SHA256, with
relevant constants changed).

While I'm here clean up the tests and Makefile.

PR: misc/124164
Submitted by: KIMURA Yasuhiro < yasu utahime org >
MFC after: 1 month


218723 15-Feb-2011 dim

Fix some leftover binaries and shared libraries in the system that still
have an executable stack, due to linking in hand-assembled .S or .s
files, that have no .GNU-stack sections:

RWX --- --- /lib/libcrypto.so.6
RWX --- --- /lib/libmd.so.5
RWX --- --- /lib/libz.so.6
RWX --- --- /lib/libzpool.so.2
RWX --- --- /usr/lib/liblzma.so.5

These were found using scanelf, from the sysutils/pax-utils port.

Reviewed by: kib


201381 02-Jan-2010 ed

Build lib/ with WARNS=6 by default.

Similar to libexec/, do the same with lib/. Make WARNS=6 the norm and
lower it when needed.

I'm setting WARNS?=0 for secure/. It seems secure/ includes the
Makefile.inc provided by lib/. I'm not going to touch that directory.
Most of the code there is contributed anyway.


186941 09-Jan-2009 phk

Remove reference to no longer existing document.

Spotted by: Bjoern Voigt <bjoern@cs.tu-berlin.de>


185568 02-Dec-2008 phk

Make the "test" target test the compiled version, instead of the
installed version of the md library.


169547 14-May-2007 cperciva

Use unsigned comparisons. Prior to this commit, SHA1_Update and
RIPEMD160_Update were broken when all of the following conditions
applied:
(1) The platform is i386.
(2) The program calling *_Update is statically linked to libmd.
(3) The buffer provided to *_Update is aligned modulo 4 bytes.
(4) The buffer extends beyond 2GB.

Due to the design of this code, SHA1_Update and RIPEMD160_Update will
still be broken if conditions (1)-(3) apply AND the buffer extends
beyond 4GB (i.e., there is an integer overflow in computing "data + len").
Since this remaining bug simply replaces SIGSEGV with a bogus hash (and
non-broken programs should never provide such operands) I don't consider
it to be a serious problem.

MFC After: 1 week
PR: kern/102795


154479 17-Jan-2006 phk

Fix an 11 year old mistake: Let the hash functions take a void* instead
of unsigned char* argument.


152551 17-Nov-2005 ru

-mdoc sweep.


150125 14-Sep-2005 pjd

Correct type.

OK'ed by: cperciva


147444 16-Jun-2005 ru

Removed redundnt empty line.

Approved by: re (blanket)


147434 16-Jun-2005 ru

Markup fixes.

Approved by: re


143334 09-Mar-2005 cperciva

In light of the recent 2^69 operation collision-finding attack on SHA1,
add support for SHA256.

Tested on: i386, sparc64
Tested using: NIST test vectors, built-in tests
X-MFC-after: 5.4-RELEASE


143326 09-Mar-2005 cperciva

The third parameter to SHA_Update and SHA1_Update is a "size_t", not a
"unsigned int".


141946 15-Feb-2005 ru

Expand contractions.


141846 13-Feb-2005 ru

Expand *n't contractions.


140505 20-Jan-2005 ru

Sort sections.


131539 03-Jul-2004 ru

Eliminate double whitespace.


126267 26-Feb-2004 bde

Backed out rev.1.6 and subsequent copying of it (bogus addition of
-static to CFLAGS). It just turned rev.1.5 into an obfuscated no-op.
As explained in the log for rev.1.5, testing should be done in the
host environment but there is a problem in cross-compilation environments.
As not explained in the log for rev.1.6, there was apparently a practical
problem with cross-compiling (makeworld should have set -static in
LDFLAGS but apparently didn't). Cross-compilation was especially
complicated because the relevant programs are test programs that were
run at beforeinstall time -- dynamic libraries might or might not exist
depending on the build options. The complications became moot in
rev.1.8 when beforeinstall was renamed "test".


120957 09-Oct-2003 hmp

Assorted mdoc(7) fixes:

- fix hard sentence breaks
- sprinkle a few .Vt's where neccessary
- remove incorrect use of `\-'
- proper quoting using .Dq, instead of manual ``...''

Approved by: des@ (mentor)
Reviewed by: ru@


119071 18-Aug-2003 obrien

style.Makefile(5)


119017 17-Aug-2003 gordon

Stage 3 of dynamic root support. Make all the libraries needed to run
binaries in /bin and /sbin installed in /lib. Only the versioned files
reside in /lib, the .so symlink continues to live /usr/lib so the
toolchain doesn't need to be modified.


115872 05-Jun-2003 markm

Rename local variables to not mask global names of same name. This
fixes lots of lint(1) warnings.


112541 24-Mar-2003 charnier

The .Fn function


103436 17-Sep-2002 peter

Initiate deorbit burn for the i386-only a.out related support. Moves are
under way to move the remnants of the a.out toolchain to ports. As the
comment in src/Makefile said, this stuff is deprecated and one should not
expect this to remain beyond 4.0-REL. It has already lasted WAY beyond
that.

Notable exceptions:
gcc - I have not touched the a.out generation stuff there.
ldd/ldconfig - still have some code to interface with a.out rtld.
old as/ld/etc - I have not removed these yet, pending their move to ports.
some includes - necessary for ldd/ldconfig for now.

Tested on: i386 (extensively), alpha


103098 08-Sep-2002 phk

Get this file closer to style(9).


103038 06-Sep-2002 bmah

Fix a bug where calling MD5File(3) with a zero-length file generated an
error, due to an uninitialized variable.

Reviewed by: phk, archie


98753 24-Jun-2002 mux

Add missing const's.


98615 22-Jun-2002 phk

Improve the handling of Encode and Decode operations in MD5.

Use memcpy for all little-endian architectures, sys/kern/md5c.c indicates
this should be safe for all currently supported LE archs.

Change the Encode and Decode functions for other archs to use le32toh()
and htole32() functions instead of explicit byte shuffling.

On sparc64 this gives md5(1) about 8% speed increase.


94367 10-Apr-2002 ru

Don't build manuals at inappropriate time.
Collapse generation of md[245].3 manpages.


93151 25-Mar-2002 phk

Modernize my email address.


93149 25-Mar-2002 phk

Modernize my email address.


92917 21-Mar-2002 obrien

Remove __P() usage.


92913 21-Mar-2002 obrien

Remove 'register' keyword.


84306 01-Oct-2001 ru

mdoc(7) police: Use the new .In macro for #include statements.


84211 30-Sep-2001 dillon

add __FBSDID()s to libmd


81251 07-Aug-2001 ru

mdoc(7) police:

Avoid using parenthesis enclosure macros (.Pq and .Po/.Pc) with plain text.
Not only this slows down the mdoc(7) processing significantly, but it also
has an undesired (in this case) effect of disabling hyphenation within the
entire enclosed block.


79754 15-Jul-2001 dd

Remove whitespace at EOL.


79531 10-Jul-2001 ru

mdoc(7) police: removed HISTORY info from the .Os call.


75161 04-Apr-2001 ru

mdoc(7) police: use proper markup for function arguments.


74870 27-Mar-2001 ru

MAN[1-9] -> MAN.


74385 17-Mar-2001 phk

Add a new entrypoint to the hashes in libmd:
char *
FooFileChunk(const char *filename, char *buf, off_t offset, off_t length)
Which only hashes part of a file.
Implement FooFile() in terms of this function.

Submitted by: roam


70015 14-Dec-2000 ru

mdoc(7) police: removed history info from the .Os FreeBSD call.


59512 22-Apr-2000 phantom

Introduce .Lb macro to libmd manpages


55955 14-Jan-2000 rgrimes

Replace beforeinstall target with new variables used by .mk system.

Reviewed by: marcel, and make world


55206 29-Dec-1999 peter

Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL"
is an application space macro and the applications are supposed to be free
to use it as they please (but cannot). This is consistant with the other
BSD's who made this change quite some time ago. More commits to come.


50476 28-Aug-1999 peter

$Id$ -> $FreeBSD$


44437 02-Mar-1999 ache

add more MLINKS


44356 01-Mar-1999 wollman

Don't even attempt to build the assembly-language versions of RIPEMD160
and SHA-1 when OBJFORMAT is not ELF. Add a warning to the man page
about how SHA-1 uses bswapl, which will trap on 80386es (and the kernel
should, but doesn't currently, emulate).


44332 28-Feb-1999 chuckr

fix for incorrect specification of alignment (it worked for the elf
build, but broke while doing the aout legacy build). Now using
.p2align instead of .align. Fixes broken buildworld.

Submitted by: John Polstra
Reviewed by: John Polstra


44310 27-Feb-1999 mjacob

No, this isn't what I submitted. Seems like the patch I sent
was ignored and an incorrect hand edit was used instead.


44304 26-Feb-1999 wollman

Fixes for Alpha.

Submitted by: mjacob


44302 26-Feb-1999 wollman

Don't build the assembly for shared linkage, PIC isn't implemented.


44301 26-Feb-1999 wollman

Add Eric Young's RIPEMD160 implementation as well, in case SHA-1
should prove weak. Also fix a few problems with the SHA-1 build.


44290 26-Feb-1999 wollman

Fix bug in MDx test suite.
Add Eric Young's SHA-[01] implementations.


43911 11-Feb-1999 wollman

Add a note about the insecurity of MD4 and potential vulnerability of
MD5 to similar attacks.


41106 12-Nov-1998 jdp

Build libmd shared for a.out too. Required for some PAM modules.


39063 11-Sep-1998 imp

$@ -> ${.TARGET}


38632 30-Aug-1998 jb

BINFORMAT -> OBJFORMAT ready for E-day.


34909 27-Mar-1998 phk

Split the padding out into a separate function.
Synchronize the kernel and libmd versions of md5c.c

PR: misc/6127
Reviewed by: phk
Submitted by: Ari Suutari <ari@suutari.iki.fi>


34685 19-Mar-1998 bde

Don't use the beforedepend target. It was a no-op here except for
helping bsd.dep.mk break `make -jN depend'.


34669 19-Mar-1998 charnier

.Sh AUTHOR -> .Sh AUTHORS. Use .An/.Aq


29142 05-Sep-1997 peter

If not building a.out, still build a pic version of libmd. This allows
things like libskey.so to be dynamically self contained.

Things like md5(1) where speed is critical should still link with libmd.a,
but for things like login, where it's a once-off call if skey is used, it's
not worth the hassle.


28688 25-Aug-1997 joerg

Make the MD* header files C++-aware. Also, string arguments are supposed
to be of type `const char *'.

PR: 3291
Submitted by: dima@tejblum.dnttm.rssi.ru (Dmitrij Tejblum)


24008 19-Mar-1997 bde

FIxed arg types (mostly missing consts) in synopsis.


22993 22-Feb-1997 peter

Revert $FreeBSD$ to $Id$


21673 14-Jan-1997 jkh

Make the long-awaited change from $Id$ to $FreeBSD$

This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore. This update would have been
insane otherwise.


20787 22-Dec-1996 phk

Just pick up the real thing from <sys/md5.h>


20785 22-Dec-1996 phk

Make this compile in the kernel too, major cosmetic cleanup.


19168 25-Oct-1996 bde

Moved #include of <sys/types.h> earlier so that this compiles when
<stdio.h> doesn't (bogusly) include <sys/types.h>.

Cleaned up #includes.


19100 22-Oct-1996 phk

Add #include <sys/types>


19099 22-Oct-1996 phk

close bin/1648 libmd not 64bit safe.

if something fails to compile now, you need to add #include <sys/types.h>

Partially Submitted by: Jason Thorpe <thorpej@nas.nasa.gov>


18845 09-Oct-1996 wollman

Use -mdoc macros properly.
Translate from Danglish into English.
Refer to the alogrithms as ``RSA Data Security MDX message digest'' as
required by the license.


17931 30-Aug-1996 peter

cmp -s || install -c ==> install -C, use a .for loop


17798 23-Aug-1996 mpp

Some minor man page cleanup.


17271 24-Jul-1996 phk

Fix a memory leak in MD[245]End()

Submitted by: Ikuo Nakagawa <ikuo@isl.intec.co.jp>
PR: misc/1424


15963 28-May-1996 jdp

Correct two errors in the manual page.


14007 09-Feb-1996 phk

Don't install mdX.3, it's the template used to build the other pages.


14005 09-Feb-1996 phk

Bill was a little to fast here...


14003 09-Feb-1996 mpp

Add some missing MLINKS, correct some cross references, correct some
file locations and some minor formatting/style problems.


13987 09-Feb-1996 mpp

Added some missing MLINKS for section 3 man pages.
Also corrected a few minor formatting errors, file location and cross
references in some of the section 3 man pages.

This shuts up a lot of the output from "manck" for section 3.


12762 11-Dec-1995 peter

Add a structure definition to the MD* Contexts, so that cvs can use
the standard libmd version of MD5 instead of it's own seperate copy..


10591 06-Sep-1995 dg

Back out that last change; we don't build this shared.


10590 06-Sep-1995 dg

Bumped shared lib rev to 2.1.


9970 06-Aug-1995 bde

Change `install' to `${INSTALL}' so that default install flags can be
specified in the top level Makefiles.

Previously I missed dozens of Makefiles that skip the install after
using `cmp -s' to decide that the install isn't necessary.


9488 12-Jul-1995 phk

Change this to do what it should have done from the start.
Add argument for buffer for output.
Fix manuals.


8870 30-May-1995 rgrimes

Remove trailing whitespace.


8103 27-Apr-1995 wollman

No sense in copying the hex[] array in each call to MDXEnd(), it's a
constant. (There probably ought to be a single libc version of it.)


6684 24-Feb-1995 phk

Clean a bunch of -Wall warnings.


6596 21-Feb-1995 phk

Speed md5 up around 30% by shorting out a couple of cumbersome
memcpy equivalent functions.


5820 24-Jan-1995 jkh

Eliminate a bogus tab.


4245 07-Nov-1994 phk

Added "const" to the arguments here and there.


4043 01-Nov-1994 pst

Clean up beforeinstall


2882 19-Sep-1994 phk

Added beforeinstall rule to install .h files. We might need some .mk
support for this kind of thing. Look at src/Makefile target "includes".


2848 18-Sep-1994 phk

libmd no longer built as shared-lib, only static.
Renamed the beforeinstall to test.


2577 08-Sep-1994 bde

Build *.3 and *.ref at build time, not at install time.


2487 04-Sep-1994 jkh

Make mddriver static.
Submitted by: jkh


2368 28-Aug-1994 bde

Use ${LDFLAGS} instead of static for compiling binaries. Neither is
sufficient for cross compiling but it's best to test with the flags
normally used.

Use ${ECHO} instead of `echo' so that `make -s' is fairly quiet.


2274 25-Aug-1994 paul

Added ${.CURDIRb to vuilding of man pages so it works with obj

Submitted by: Paul Richards


1964 08-Aug-1994 jkh

Boy, was *this* ever bollixed!

1. Copyright files looked for in the wrong place

2. cmp was looking in wrong place for test data.

3. Driver for test not linked static, thus dynamic resolution of library
not working.

4. Man page installation not consistent with source.

Reviewed by:
Submitted by: jkh


1846 04-Aug-1994 wollman

Make obj directory work right. md?hl.c should probably be
deleted, but I'll leave that up to PHK.


1803 24-Jul-1994 phk

This commit was generated by cvs2svn to compensate for changes in r1802,
which included commits to RCS files with non-trunk default branches.