Commit Graph

14 Commits

Author SHA1 Message Date
Nicolas Williams
f064f2d14b Add seed operation for unix RAND method 2016-04-15 00:16:18 -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
Love Hörnquist Åstrand
8a4cf0dd12 don't see anything since /dev/random doesn't really need more seeding
redhat have Linux SE rules that slows down openssh when heimdal tries
to write, so lets not write.

https://bugzilla.redhat.com/show_bug.cgi?id=1076979
2014-03-20 22:35:51 +01:00
Jeffrey Hutzelman
db8f03740a hcrypto/rand-unix.c: Ignore write(2) result harder
unix_seed(), called by the add-seed-data op unix_add(), attempts to
write seed data to the random data device.  If this fails, the failure
is ignored, as it must be, since there is no way to inform the caller.

This change modifies the way in which the return value from write(2)
is ignored, to avoid compiler warnings when building on Ubuntu 12.10,
with gcc 4.7.2 and eglibc 2.15-0ubuntu20.1.
2013-06-18 22:40:49 -04:00
Love Hornquist Astrand
efa5a314a8 fix warnings 2010-06-03 16:16:48 -07:00
Love Hornquist Astrand
c491b59007 pull out unix /dev/random if we cant get users home directory 2010-03-21 11:01:24 -07:00
Love Hornquist Astrand
26e5159572 Remove fd caching since we don't have unload (deconstructor) support
basiclly this is reverting 164c99a4b4

the problem is when an application is using PAM loaded and unloaded
and over again, the file descriptior never get closed on unload of the
pam module. If main app already uses Heimdal, Heimdal doesn't get
unloaded, but in some scenarios this happen more often.

Since we now use fortuna for our internal random generator, this is
not that bad.

Bug found by Victor Guerra.
2009-11-26 10:06:22 -08:00
Love Hornquist Astrand
ec263fc5a4 reading negative size is wrong, zero is ok 2009-09-25 14:53:31 -07:00
Love Hornquist Astrand
3a031244bc Drop RCSID and HAVE_CONFIG_H 2009-08-05 13:37:37 +02:00
Love Hörnquist Åstrand
164c99a4b4 Do locking around file descriptor, this allows caching of the file
descriptor in the module.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24901 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-03-22 17:20:18 +00: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
e172367898 switch to utf8 encoding of all files
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23814 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-09-13 08:53:55 +00:00
Love Hörnquist Åstrand
9b7124911d close-on-exec
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23462 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-07-27 12:14:42 +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