25 Commits

Author SHA1 Message Date
Michael Tokarev
c80c04b235 spelling fixes (underun prefered relase encyption confunder)
[abartlet@samba.org: From Samba debian package at
 https://salsa.debian.org/samba-team/samba/-/blob/master/debian/patches/heimdal-spelling.patch?ref_type=heads]

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2024-06-16 23:28:43 -04:00
Taylor R Campbell
72606cb95e libheimbase: Allow static const heim types. 2023-06-20 12:19:48 -05:00
Nicolas Williams
efdd6c589d base: Fix fallback atomics 2023-01-11 12:59:12 -06:00
Luke Howard
8c25c0d46a base: support for 64-bit atomic increment/decrement 2023-01-07 21:45:01 +11:00
Luke Howard
4e449baa29 base: add back libheimbase HEIMDAL_xxx_ATTRIBUTEs
Fix regression introduced in 62f83ad0 by adding HEIMDAL_NORETURN_ATTRIBUTE and
HEIMDAL_PRINTF_ATTRIBUTE to function definitions, so they will be included in
heimbase-protos.h.
2023-01-07 20:11:13 +11:00
Luke Howard
2a594a3bd1 base: Fix CID 1518898 Resource leak
Don't leak new_node if invalid node type in heim_path_vcreate()
2023-01-04 01:36:03 -06:00
Nicolas Williams
9fc2e943ca base: Fix use-after-free in heim_path_vcreate() 2023-01-04 00:43:35 -06:00
Nicolas Williams
aaff3aa5c5 Do not include config.h in heimbase.h (fix )
We can't include config.h in public headers, as config.h is not public.

This reverts part of commit a8f0905b71.
2022-12-08 14:06:03 -06:00
Nicolas Williams
476d216f89 base: Fix UB 2022-11-01 16:10:57 -05:00
Luke Howard
6340602ddc base: ensure HEIM_CALLCONV used for all dealloc functions
Fixes regression introduced in 917e1604.
2022-01-29 14:29:37 +11:00
Joseph Sutton
ef059b8831 heimdal:base: Don't perform arithmetic on a NULL pointer
Doing so is undefined behaviour.

Change-Id: Ic57baac0fc5fb06945c0dfbd5d4eb913a12fc13d
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
2022-01-18 00:31:45 -05:00
Nicolas Williams
b9a915c163 base: Fix various coverity warnings 2022-01-17 16:23:36 -06:00
Luke Howard
2520c30b28 base: harmonize implementation/headers
heim_retain() should both accept and return a heim_object_t; harmonize this
across header and implementation
2022-01-08 17:40:22 +11:00
Luke Howard
97cca6f921 base: use uintptr_t for hash type
Use uintptr_t for hash type; this is consistent with CoreFoundation, which uses
32-bit integers on 32-bit platforms for the hash code, and 64-bit integers on
64-bit platforms. (libheimbase is modelled on CoreFoundation.)

Previously we used unsigned long, which would have the same behavior on
LP32/LP64 systems, but not on Windows (where unsigned long is 32-bits on 64-bit
platforms).
2022-01-06 17:21:06 +11:00
Luke Howard
bb7b4f7a94 base: use atomic load/store in reference counting
Use the new atomic load and store macros for testing and setting reference
count overflow.
2020-07-14 09:35:14 +10:00
Luke Howard
4986ebcb67 base: rename heim_base_atomic_{max,type} to ...integer_{max,type}
Rename heim_base_atomic_max to heim_base_atomic_integer_max (ditto with _type)
in order to better reflect their usage, now we have a separate
heim_base_atomic() macro for making an atomic version of any type.
2020-07-14 09:35:14 +10:00
Nicolas Williams
f38089257b Misc fixes (coverity) 2016-11-20 17:43:51 -06:00
Nicolas Williams
1c81ddf4e2 Round of scan-build warnings cleanup 2016-11-16 17:03:14 -06:00
Nicolas Williams
2f0c45f784 Add thread-locals for WIN32 2016-04-15 00:16:17 -05: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
Love Hornquist Astrand
029de6cfa4 pass back an heim_error from hx509_cert_init 2012-10-07 06:33:13 -07: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