Commit Graph

11 Commits

Author SHA1 Message Date
Alan Somers
8254c3c5d3 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.

Reviewed by:	cem, ed
MFC after:	4 weeks
Sponsored by:	Spectra Logic Corp
Differential Revision:	https://reviews.freebsd.org/D8277
2016-10-18 23:20:49 +00:00
Ed Maste
de13c2427d libmd: introduce functions that operate on an fd instead of filename
Reviewed by:	allanjude, cem
MFC after:	2 months
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D8264
2016-10-17 13:47:22 +00:00
Conrad Meyer
c6b03be14b libmd: Work around C++'s inability to understand C
Reported by:	antoine@ (x265)
2016-05-27 05:31:14 +00:00
Thomas Quinot
55b130956d 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
2015-05-10 21:21:52 +00:00
Thomas Quinot
9d8b66868a 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
2015-05-10 13:21:36 +00:00
Poul-Henning Kamp
76516938fa Just pick up the real thing from <sys/md5.h> 1996-12-22 10:32:17 +00:00
Poul-Henning Kamp
40060a90b9 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>
1996-10-22 16:27:47 +00:00
Peter Wemm
c60e216884 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..
1995-12-11 02:18:22 +00:00
Poul-Henning Kamp
05f65b296e Change this to do what it should have done from the start.
Add argument for buffer for output.
Fix manuals.
1995-07-12 09:13:49 +00:00
Poul-Henning Kamp
4385de1699 Added "const" to the arguments here and there. 1994-11-07 20:48:35 +00:00
Poul-Henning Kamp
c9502b535e Reviewed by: phk
Imported libmd.  This library contains MD2, MD4 and MD5.
These three boggers pop up all over the place all of the time, so I 
decided we needed a library with them.  In general they are used for
security checks, so if you use them you want to link them static.
1994-07-24 03:29:56 +00:00