Commit Graph

34 Commits

Author SHA1 Message Date
Luke Howard
fb81598d44 krb5: port MIT Linux keyring credentials cache (#166) 2018-12-24 18:17:32 +11:00
Luke Howard
a8f0905b71 base: expose atomic operations internally (#447) 2018-12-18 23:28:38 -06:00
Jeffrey Altman
85acd57c8a base: fix error_cmp
Fix the numeric error value comparison performed by error_cmp().

Identified by AppChecker and previously fixed by Darwin.

Change-Id: I0a72fd381bef0b34b7e7d155bfff03ab4196d38e
2017-04-29 01:05:58 -04:00
Nicolas Williams
6a0f45c4d7 Use __attribute__ ((__name__)) form
Protect against macros named noreturn and so on.
2017-03-13 18:39:41 -04:00
Nicolas Williams
a7f8732d79 Fix #182, add -lpthread to libheimbase as needed
We should really check whether pthread_once() is in libc so that then we
don't have to add an unnecessary dependency on -lpthread.

Also, we have a proper once implementation that we could use when we
don't have pthread_once(), so we should fallback on that if we detect
that we have neither pthread_once() in libc and --disable-pthread is
given.
2016-12-08 18:44:41 -06:00
Nicolas Williams
f38089257b Misc fixes (coverity) 2016-11-20 17:43:51 -06:00
Nicolas Williams
52a562a3a4 Misc fixes (coverity) 2016-11-18 22:21:45 -06:00
Nicolas Williams
1c81ddf4e2 Round #2 of scan-build warnings cleanup 2016-11-16 17:03:14 -06:00
Nicolas Williams
e2137c63f5 Fix Windows build 2016-04-16 16:58:08 -05:00
Nicolas Williams
2f0c45f784 Add thread-locals for WIN32 2016-04-15 00:16:17 -05:00
Nicolas Williams
490337f4f9 Make OpenSSL an hcrypto backend proper
This adds a new backend for libhcrypto: the OpenSSL backend.

Now libhcrypto has these backends:

 - hcrypto itself (i.e., the algorithms coded in lib/hcrypto)
 - Common Crypto (OS X)
 - PKCS#11 (specifically for Solaris, but not Solaris-specific)
 - Windows CNG (Windows)
 - OpenSSL (generic)

The ./configure --with-openssl=... option no longer disables the use of
hcrypto.  Instead it enables the use of OpenSSL as a (and the default)
backend in libhcrypto.  The libhcrypto framework is now always used.

OpenSSL should no longer be used directly within Heimdal, except in the
OpenSSL hcrypto backend itself, and files where elliptic curve (EC)
crypto is needed.

Because libhcrypto's EC support is incomplete, we can only use OpenSSL
for EC.  Currently that means separating all EC-using code so that it
does not use hcrypto, thus the libhx509/hxtool and PKINIT EC code has
been moved out of the files it used to be in.
2016-04-15 00:16:17 -05:00
Nicolas Williams
9f2642acae Fix lib/base/test_base rwlock test 2016-04-15 00:16:14 -05:00
Jeffrey Altman
1dcfceb090 lib/base: add tests for mutex and rwlock
Add a basic set of tests for the HEIMDAL_MUTEX and HEIMDAL_RWLOCK
abstraction using both static and dynamic initialization.

Change-Id: Iaeb16e5dfcf00d29be7eaa4f2e6970c4f1268fb0
2016-04-10 17:05:07 -05:00
Luke Howard
acad7be65e base: Solaris and AIX atomic increment/exchange
Implement heim_base_atomic_XXX and heim_base_exchange_pointer
for Solaris and AIX. (AIX not tested.)
2015-12-09 11:00:11 +11:00
Nicolas Williams
2cac8ca703 Use pthread_once() when available 2015-11-30 14:15:47 -06:00
Luke Howard
9e359ac98f base: Windows heim_base_once_t cleanup
heim_base_once_t can just be a LONG on Windows, the structure is not needed
2015-11-30 17:34:32 +11:00
Nicolas Williams
cc0e92a3c3 base: correct Windows heim_base_once_f semantics
As implemented by Jeffrey Altman heim_base_once_f() is a variant of the
"double-checked gate lock pattern".   Full memory barriers must be used
when determining whether or not to call SwitchToThread().

Change-Id: I2f8446a56c50a37c921d6e993433c9a3f7488f50
2015-11-30 00:47:54 -05:00
Jeffrey Altman
4735faba59 base: Windows implementation of heim_base_once
Provide a Windows implementation of heim_base_once that relies upon
InterlockedCompareExchange() and SwitchToThread().

Change-Id: I9cdbda796d1a27fe1e17be63f287b10132858d7f
2015-11-29 12:15:10 -05:00
Nicolas Williams
2fbd7331a6 Fix error-case leaks in lib/base/db.c 2015-03-24 11:50:02 -05:00
Jeffrey Altman
902aa4ee02 tests on Windows
Modify the NTMakefile rules for tests so that a failed test does
not prevent subsequent tests from being executed.

Change-Id: I9595ad4a1527feae7c402241bf06ab21a0b76d4a
2015-03-21 15:44:48 -04:00
Love Hörnquist Åstrand
37afa01be3 rename roken base64, fixes #107 2014-08-22 20:57:24 -07:00
Andrew Bartlett
1fad1f8984 lib/base: Rename strbuf to heim_strbuf to avoid conflict with stropts.h on linux 2014-03-24 23:07:52 -05:00
Andrew Bartlett
2622b32468 lib/base: Add define for HEIMDAL_TEXTDOMAIN 2014-03-24 23:07:52 -05:00
Love Hörnquist Åstrand
1503257983 clean files 2014-02-16 11:50:34 -08:00
Nicolas Williams
c6bfad4f68 Don't need, so don't use, stdbool.h 2013-10-04 19:00:56 -04:00
Love Hornquist Astrand
9f979d20d7 prefix json functions 2013-07-16 13:06:57 +02:00
Love Hornquist Astrand
060474df16 quel 64bit warnings, fixup implicit encoding for template, fix spelling 2013-06-03 21:46:20 -07:00
Love Hornquist Astrand
b301e47fb8 rename heim_serialize to heim_copy_serialize to follow create/copy/get semantics 2013-06-03 21:46:20 -07:00
Roland C. Dowdeswell
2fd031fbad lib/base must export heim_array_filter_f, heim_string_create_with_format. 2013-02-13 16:16:32 +08:00
Love Hornquist Astrand
58ff480763 rewrite send to kdc to be more agressive, try kdcs in paralell and easier to configure behavior 2013-02-10 19:02:52 -08:00
Love Hornquist Astrand
029de6cfa4 pass back an heim_error from hx509_cert_init 2012-10-07 06:33:13 -07:00
Roland C. Dowdeswell
16c93c4e87 Not all make implementations define RM by default. So, we can't use it. 2012-06-26 22:25:42 +01:00
Roland C. Dowdeswell
01e7b326b6 Remove unused function from lib/base/string.c as it breaks with -Werror. 2012-06-26 22:14:47 +01:00
Nicolas Williams
98809e86ce Move base into lib
This involves reverting dd267e8fc3,
    but that gets lost in the move.

    This builds on Ubuntu and Windows at this time.
2012-06-20 19:32:08 -05:00