summaryrefslogtreecommitdiffstats
path: root/lib/libmd
Commit message (Collapse)AuthorAgeFilesLines
* MFC r314709,r314790,r314794:bdrewery2017-03-221-0/+7
| | | | | | | | | | | 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
* MFC r312452-r312512:ngie2017-02-101-4/+4
| | | | | | | | | | 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
* MFC r307521: libmd: introduce functions that operate on fd instead of filenameemaste2016-12-215-10/+64
|
* MFC r307584asomers2016-11-221-8/+0
| | | | | | | | | | | | | | 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.
* Import the skein hashing algorithm, based on the threefish block cipherallanjude2016-05-298-15/+409
| | | | | | | | | | | | | 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
* Implement SHA-512 truncated (224 and 256 bits)allanjude2016-05-283-10/+76
| | | | | | | | | | | | | | | | | | | 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
* libmd: Work around C++'s inability to understand Ccem2016-05-271-0/+8
| | | | Reported by: antoine@ (x265)
* MFHgjb2016-03-021-24/+0
|\ | | | | | | Sponsored by: The FreeBSD Foundation
| * DIRDEPS_BUILD: Regenerate without local dependencies.bdrewery2016-02-241-24/+0
| | | | | | | | | | | | | | | | 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
* | First pass through library packaging.gjb2016-02-041-0/+1
|/ | | | Sponsored by: The FreeBSD Foundation
* Improvements to the MDXFileChunk() template function:jtl2016-01-141-29/+31
| | | | | | | | | | | | | - 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
* DIRDEPS_BUILD: Update dependencies.bdrewery2016-01-071-0/+3
| | | | Sponsored by: EMC / Isilon Storage Division
* Fix a file descriptor leak in mdXhl.c (which is used by numerous hashingjtl2015-12-301-4/+9
| | | | | | | | | | 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
* Replace sys/crypto/sha2/sha2.c with lib/libmd/sha512c.callanjude2015-12-275-423/+77
| | | | | | | | | | | | | | | | | | 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
* META MODE: Remove unneeded libmd.host dependency for xinstall.host.bdrewery2015-11-251-32/+0
| | | | | | This is chasing r291026. Sponsored by: EMC / Isilon Storage Division
* META MODE: Fix 'make bootstrap-tools'.bdrewery2015-11-251-3/+0
| | | | | | | | | | | | | | | 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
* META MODE: Prefer INSTALL=tools/install.sh to lessen the need for xinstall.host.bdrewery2015-11-251-1/+0
| | | | | | | | 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
* Add new include path for sha256.hrodrigc2015-07-121-1/+2
| | | | | | This fixes the bootstrap build on FreeBSD 10. Submitted by: andrew
* Complete the move that was started w/ r263218.. For some reason Ijmg2015-07-112-394/+0
| | | | | | | 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...
* increase buffer size to significantly increase performance...jmg2015-07-091-1/+1
| | | | | | | see: https://docs.freebsd.org/cgi/mid.cgi?20150513080342.GE37063@funkthat.com for benchmarks...
* new dependssjg2015-06-162-0/+4
|
* Revert r284417 it is not necessary anymorebapt2015-06-151-1/+1
|
* Enforce overwritting SHLIBDIRbapt2015-06-151-1/+1
| | | | | | | | | 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
* Add META_MODE support.sjg2015-06-132-0/+71
|\ | | | | | | | | | | | | | | | | | | | | 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
| * dirdeps.mk now sets DEP_RELDIRsjg2015-06-082-4/+0
| |
| * Merge sync of headsjg2015-05-2716-3/+406
| |\ | |/ |/|
| * Merge head from 7/28sjg2014-08-192-1/+2
| |\
| * | Updated dependenciessjg2014-05-161-1/+1
| | |
| * | Updated dependenciessjg2014-05-101-0/+2
| | |
| * | Merge headsjg2014-04-287-20/+13
| |\ \
| * | | Updated dependenciessjg2013-03-111-0/+1
| | | |
| * | | Updated dependenciessjg2013-02-161-2/+0
| | | |
| * | | Updated/new Makefile.dependsjg2012-11-081-0/+3
| | | |
| * | | Sync FreeBSD's bmake branch with Juniper's internal bmake branch.marcel2012-08-221-0/+37
| | | | | | | | | | | | | | | | Requested by: Simon Gerraty <sjg@juniper.net>
* | | | Unbreak MIPS build following rev. 282726thomas2015-05-118-6/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Unbreak build following rev. 282726thomas2015-05-106-0/+130
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (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
* | | | Ensure libmd symbols do not clash with libcryptothomas2015-05-1014-1/+195
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Avoid an infinite loop by ensuring that the amount of bytes read is greaterngie2015-04-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Revert r274772: it is not valid on MIPSemaste2014-11-252-2/+2
| | | | | | | | | | | | | | | | Reported by: sbruno
* | | | Use canonical __PIC__ flagemaste2014-11-212-2/+2
| |_|/ |/| | | | | | | | | | | | | | | | | | | | 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
* | | use .Mt to mark up email addresses consistently (part3)bapt2014-06-231-1/+1
| |/ |/| | | | | | | PR: 191174 Submitted by: Franco Fichtner <franco at lastsummer.de>
* | Dereference nonexistent md2(3) manual.gjb2014-03-284-8/+4
| | | | | | | | | | MFC after: 3 days Sponsored by: The FreeBSD Foundation
* | replace the kernel's version w/ cperciva's implementation... In alljmg2014-03-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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@
* | use a real uint64_t instead of writing code to emulate one..jmg2014-01-112-11/+8
|/ | | | | | | | | I verified w/ a: dd if=/dev/zero bs=1m count=5000 | sha256 a33351fafd00e4c4bcdee2a1c5d019026500f8cdfeaf91a9b8dbbb2619429659 Reviewed by: cperciva MFC after: 1 week
* Remove the RFC 1319 MD2 Message-Digest Algorithm routines from libmd.obrien2012-04-285-309/+6
| | | | | | | | | | 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
* Rewrite HISTORY: The SHA256 code first appeared in 6.0, and the SHA512cperciva2011-06-272-2/+2
| | | | code in 9.0; neither existed in FreeBSD 4.0.
* Add SHA512 (Actually, this is Colin Percival's code for SHA256, withmarkm2011-04-097-165/+707
| | | | | | | | | | 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
* Fix some leftover binaries and shared libraries in the system that stilldim2011-02-151-2/+5
| | | | | | | | | | | | | | | 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
* Build lib/ with WARNS=6 by default.ed2010-01-021-0/+2
| | | | | | | | | 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.
* Remove reference to no longer existing document.phk2009-01-091-5/+0
| | | | Spotted by: Bjoern Voigt <bjoern@cs.tu-berlin.de>
OpenPOWER on IntegriCloud