Commit Graph

18 Commits

Author SHA1 Message Date
Jeffrey Altman
93518bfab4 use memset_s
lib roken includes support for memset_s() but it was not applied
to the Heimdal source tree.

Change-Id: I8362ec97a9be50205bb2d398e65b629b88ce1acd
2017-04-29 01:05:59 -04:00
Sean Davis
316387f619 Fix typo in rand-fortuna.c
`__GNUC__` was written as `__GUNC__`, which could have interesting results as it'll never be defined.
2016-09-19 16:06:03 -05:00
Benjamin Kaduk
aa87e08cc7 Use C99 designated initializers in a couple places
Some portions of libhcrypto are reused by other projects in
diverse environments, including within operating system kernel modules.
In some such build environments, hardening measures such as grsecurity
can (randomly) reorder structure elements, so as to make it harder
for an attacker to determine the offset from a known field's address
to a different field that is needed for an attack.

However, doing so requires the use of C99 designated initializers
to make the source code compatible with such structure rearrangement,
as opposed to the "traditional" C aggregate type initializers, which
just list fields in order.  This feature is also available as a
GCC extension since early versions of GCC.  However, it is not
provided by many common versions of visual studio (and presumably
also not by the vendor compiler for various commercial Unixes),
so the traditional initializers must remain, behind a conditional.
__GNUC__ or __STDC_VERSION__ >= 199901 should be enough to get
most cases with support for designated initializers, at least
for now.

Signed-off-by: Nicolas Williams <nico@twosigma.com>
2016-09-01 17:38:47 -05:00
Jeffrey Altman
0f97855826 hcrypto: config/roken cleanup
All source files in lib/hcrypto should be built the same way.
Since this source directory is dependent on libroken then all source
files must be built using the roken.h declarations and included headers.

Also, there is no config.h in the local directory so angle brackets
include of quotes should be used.

Finally, because roken.h includes stdio.h, stdlib.h, stdarg.h, limits.h,
strings.h, sys/types.h, etc., do not include them separately.

Start all source files with

  #include <config.h>
  #include <roken.h>

Change-Id: I09ab47f8a5472018efe6c8b59a0e51fde8f24724
2016-04-10 17:05:07 -05:00
hasufell
427a60057c Completely remove RAND_egd support
The EGD daemon is completely unmaintained and has not seen a release
since 13 years which is not an acceptable timeframe for cryptographic
software. It is not packaged in any linux distribution I know of
and definitely not in *BSD.

LibreSSL has already dropped support for RAND_egd.
2015-10-06 15:44:47 +02:00
Bernard Spil
858480145b Refactor EGD conditional support
As per Jeremy's request in #124
Windows does not define HAVE_RAND_EGD resulting in the same conditional
support for EGD.
2015-04-21 10:04:08 +02:00
Bernard
828f4f4fb1 Fix build when OpenSSL has no EGD support 2015-04-10 22:47:03 +02:00
Simon Wilkinson
887993e8b3 Add mutex protection for the fortuna PRNG
The fortuna PRNG has an statically held internal state. Prevent
concurrent access to this internal state by adding mutexes around
all of the access classes.

Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
2010-04-19 14:26:53 +02:00
Asanka Herath
c4b95f7330 Make build on windows
Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
2009-11-25 02:22:31 +01:00
Love Hornquist Astrand
3a031244bc Drop RCSID and HAVE_CONFIG_H 2009-08-05 13:37:37 +02:00
Love Hörnquist Åstrand
6937d41a02 remove trailing whitespace
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23815 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-09-13 09:21:03 +00:00
Love Hörnquist Åstrand
5bf46d38c5 close-on-exec
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23463 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-07-27 12:15:06 +00:00
Love Hörnquist Åstrand
9f52c260e1 Make compile again.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23197 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-05-29 02:11:19 +00:00
Love Hörnquist Åstrand
de2bd2f00b If we forked, force a reseed again. Add the pid as part of the reseed().
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23171 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-05-22 02:52:44 +00:00
Love Hörnquist Åstrand
124f90e3dc Reseed the random generator now and then from external sources.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21196 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-06-20 05:08:58 +00:00
Love Hörnquist Åstrand
5e25789281 Use /etc/shadow, not /dev/shadow, pointed out by Andrew Bartlett
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21104 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-06-18 05:19:45 +00:00
Love Hörnquist Åstrand
58055ddfc9 Fall back to gattering data from timer and secret files, this is
really the last resort.


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21100 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-06-18 03:51:21 +00:00
Love Hörnquist Åstrand
7ba2b2006c rename des to hcrypto
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@20466 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-04-20 08:29:05 +00:00