summaryrefslogtreecommitdiff
path: root/random/random-fips.c
AgeCommit message (Collapse)AuthorFilesLines
2014-01-16Replace ath based mutexes by gpgrt based locks.Werner Koch1-14/+9
* configure.ac (NEED_GPG_ERROR_VERSION): Require 1.13. (gl_LOCK): Remove. * src/ath.c, src/ath.h: Remove. Remove from all files. Replace all mutexes by gpgrt based statically initialized locks. * src/global.c (global_init): Remove ath_init. (_gcry_vcontrol): Make ath install a dummy function. (print_config): Remove threads info line. * doc/gcrypt.texi: Simplify the multi-thread related documentation. -- The current code does only work on ELF systems with weak symbol support. In particular no locks were used under Windows. With the new gpgrt_lock functions from the soon to be released libgpg-error 1.13 we have a better portable scheme which also allows for static initialized mutexes. Signed-off-by: Werner Koch <wk@gnupg.org>
2013-12-12Remove macro hacks for internal vs. external functions. Part 2 and last.Werner Koch1-14/+14
* src/visibility.h: Remove remaining define/undef hacks for symbol visibility. Add macros to detect the use of the public functions. Change all affected functions by replacing them by the x-macros. * src/g10lib.h: Add internal prototypes. (xtrymalloc, xtrycalloc, xtrymalloc_secure, xtrycalloc_secure) (xtryrealloc, xtrystrdup, xmalloc, xcalloc, xmalloc_secure) (xcalloc_secure, xrealloc, xstrdup, xfree): New macros. -- The use of xmalloc/xtrymalloc/xfree is a more common pattern than the gcry_free etc. functions. Those functions behave like those defined by C and thus for better readability we use these macros and not the underscore prefixed functions. Signed-off-by: Werner Koch <wk@gnupg.org>
2013-12-11random: Add a feature to close device file descriptors.Werner Koch1-0/+13
* src/gcrypt.h.in (GCRYCTL_CLOSE_RANDOM_DEVICE): New. * src/global.c (_gcry_vcontrol): Call _gcry_random_close_fds. * random/random.c (_gcry_random_close_fds): New. * random/random-csprng.c (_gcry_rngcsprng_close_fds): New. * random/random-fips.c (_gcry_rngfips_close_fds): New. * random/random-system.c (_gcry_rngsystem_close_fds): New. * random/rndlinux.c (open_device): Add arg retry. (_gcry_rndlinux_gather_random): Add mode to close open fds. * tests/random.c (check_close_random_device): New. (main): Call new test. Signed-off-by: Werner Koch <wk@gnupg.org>
2013-12-05Remove macro hacks for internal vs. external functions. Part 1.Werner Koch1-28/+28
* src/visibility.h: Remove almost all define/undef hacks for symbol visibility. Add macros to detect the use of the public functions. Change all affected functions by prefixing them explicitly with an underscore and change all internal callers to call the underscore prefixed versions. Provide convenience macros from sexp and mpi functions. * src/visibility.c: Change all functions to use only gpg_err_code_t and translate to gpg_error_t only in visibility.c. -- The use of the macro magic made if hard to follow the function calls in the source. It was not easy to see if an internal or external function (as defined by visibility.c) was called. The change is quite large but hopefully makes Libgcrypt easier to maintain. Some function have not yet been fixed; this will be done soon. Because Libgcrypt does no make use of any other libgpg-error using libraries it is useless to always translate between gpg_error_t and gpg_err_code_t (i.e with and w/o error source identifier). This translation has no mostly be moved to the function wrappers in visibility.c. An additional advantage of using gpg_err_code_t is that comparison can be done without using gpg_err_code(). I am sorry for that large patch, but a series of patches would actually be more work to audit. Signed-off-by: Werner Koch <wk@gnupg.org>
2012-12-03Make random-fips.c work multi-threaded.Werner Koch1-1/+1
* random/random-fips.c (basic_initialization): Fix reversed logic. -- The module never initialized the mutex at all. Probably this was never an issue before commit 38fcd59 which removed static lock init.
2011-12-01Completed switch to a simpler thread model.Werner Koch1-1/+1
This is only a first step. We will need to either implement pthread_atfork or - better - make use use POSIX RT semaphores.
2011-02-04Nuked almost all trailing whitespace.Werner Koch1-36/+34
Check and install the standard git pre-commit hook.
2010-04-12Applied spelling fixes and more verbose test diagnositcs by Brad Hards.Werner Koch1-2/+2
2008-09-16Another tweak for the RNG test code.Werner Koch1-16/+34
2008-09-16Make fipsrngdriv more pretty.Werner Koch1-4/+4
Fix a problem in the RNG test code. Minor doc update.
2008-09-16Finish FIPS random test driver.Werner Koch1-2/+3
Disable re-seeding if in test mode.
2008-09-15Use syslog to log important messages.Werner Koch1-8/+116
Add an external RNG test hook.
2008-09-05Let the test suite run the selftests even in non-fips mode.Werner Koch1-0/+3
2008-09-01Prepare a release candidateWerner Koch1-15/+28
2008-08-29Changed the way the FIPS RNG is seeded.Werner Koch1-73/+157
FIPS cleanups. Documentation upodates.
2008-08-25Implement a KAT for the fips random module.Werner Koch1-22/+202
2008-08-22Completed the RNG implementaion switching.Werner Koch1-2/+20
Added framework for running RNG tests. Added an experimental option --enable-hmac-binary-check to configure. --This line, and those below, will be ignored-- M src/fips.c M src/cipher-proto.h M src/global.c M src/hmac256.c M src/ChangeLog M src/hmac256.h M src/Makefile.am M tests/Makefile.am M configure.ac M doc/gcrypt.texi M random/random-fips.c M random/random.c M random/rand-internal.h M random/random.h M random/ChangeLog M ChangeLog M README
2008-08-21Finished the X9.31 RNG implementations.Werner Koch1-8/+599
2008-08-19A whole bunch of changes to eventually support Werner Koch1-0/+102
FIPS restricted mode. Also some documentation improvements and other minor enhancements. See the ChangeLogs. Stay tuned.