Commit Graph

17914 Commits

Author SHA1 Message Date
Nicolas Williams
47432b907b krb5: Fix leak in krb5_set_config()
We were leaking context->configured_default_cc_name.
2022-02-11 16:02:27 -06:00
Nicolas Williams
6923b822b8 krb5: Fix leaks in test_cc.c 2022-02-11 16:02:27 -06:00
Nicolas Williams
c3ea1ac37e kafs: Fix OS X build (warning/error) 2022-02-11 15:17:32 -06:00
Nicolas Williams
6b39972113 krb5: Fix acc_move() crash (CCAPI) 2022-02-11 15:13:13 -06:00
Nicolas Williams
7b3a993236 roken: do not override system network address functions
Roken functions rk_copyhostent(), rk_freeaddrinfo(), rk_freehostent()
rk_getaddrinfo(), rk_getipnodebyaddr(),  rk_getipnodebyname(), and
rk_getnameinfo() should never be built without the "rk_" prefix.  Doing
so overrides the system provided functions of the same name when they
exist.
2022-02-10 12:37:01 -06:00
Nicolas Williams
66e1a8baf2 osx: Disable GCD deprecation warning 2022-02-09 23:49:40 -06:00
Nicolas Williams
584a2d3a2b krb5: Fix error clobbering in test_cc 2022-02-01 15:54:31 -06:00
Nicolas Williams
f06657ff64 krb5: Make more cc configs non-critical
MSLSA can't handle cc configs.
2022-02-01 15:54:31 -06:00
Luke Howard
69973757ce gss: remove gss_get_instance() 2022-01-30 14:20:05 -05:00
Jeffrey Altman
301b7ce711 Revert "asn1: Fix Windows build"
This reverts commit ff4033eb59.
2022-01-29 00:15:59 -05:00
Jeffrey Altman
543b94637f more dealloc functions require HEIM_CALLCONV
Change-Id: I68168a387c088b45e2572d5c982d33dfe0aa38a8
2022-01-29 00:15:59 -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
Luke Howard
917e16049a base: make heim_alloc deallocator use HEIM_CALLCONV 2022-01-28 17:24:57 -06:00
Nicolas Williams
4748f3a19d asn1: Revert heim_object_t support 2022-01-28 17:24:57 -06:00
Luke Howard
327ec7e75c krb5: use void * instead of heim_object for PAC decoration 2022-01-28 17:24:57 -06:00
Nicolas Williams
a835b9053d lib/asn1: generate_type_free heim_release not heim_retain
Do not leak the object when the intent is to free it.

Introduced by 40d1271094
("asn1: Expand decoration w/ C types")

Change-Id: If8cd502f61d6f9b72118630839525933911c6697
2022-01-28 13:54:16 -05:00
Jeffrey Altman
4185e87a6c lib/krb5: domain_X500_Compress not domain_X500_compress
3a7c2c6a7f
("krb5.h: define DOMAIN_X500_COMPRESS macro")
defined DOMAIN_X500_COMPRESS to the wrong name.

Change-Id: I5c60d86b856ce6d3fa94b1fa8d7ffe17b97c8513
2022-01-28 13:49:16 -05:00
Nicolas Williams
2dec179e35 krb5: Add krb5_cccol_get_default_ccname() 2022-01-26 16:40:16 -06:00
Luke Howard
a8037d1916 hdb: define HDB flags using hex instead of decimal constants
Define HDB_F_XXX flags in lib/hdb/hdb.h using hexidecimal constants as they are
easier to read.
2022-01-26 11:17:35 +11:00
Luke Howard
11fa99416d hdb: remove HDB_F_CURRENT_KVNO flag
remove HDB_F_CURRENT_KVNO flag from hdb.h, it is no longer used
2022-01-26 11:10:03 +11:00
Nicolas Williams
5cd49a8032 krb5: Manually expand some macros in fcc_move()
To help in debugging.
2022-01-25 17:22:23 -06:00
Nicolas Williams
a4396ee819 krb5: Fix leak in kcm_gen_new() 2022-01-25 15:38:55 -06:00
Nicolas Williams
4dcfd968d0 krb5: Better default KCM cache logic (moar)
Ah, we can't use context->default_cc_name because that will be taken
from KRB5CCNAME if it's set, and then we'll think whatever that value is
is the default, but we're really looking to special case resolving of
the "%{UID}" KCM cache name.  So do that.
2022-01-25 14:46:32 -06:00
Nicolas Williams
1a719bdc0e krb5: Better default KCM cache logic
Our kcm daemon will resolve default cache names (%{UID}) to the user's
session's default cache name.  SSSD's kcm daemon will not.

Therefore we add a heuristic for "if we're resolving what may be the
local configured default KCM cache, and it doesn't exist as such in the
KCM session, then use the KCM session's default cache".

This allows our kinit and klist to work as intended.
2022-01-25 13:12:06 -06:00
Nicolas Williams
ae181ee52e krb5: Check for KRB5_CC_NOSUPP in krb5_cc_move()
The KCM cache can return KRB5_CC_NOSUPP instead of ENOTSUP.
2022-01-25 13:12:06 -06:00
Jeffrey Altman
468a06e612 lib/krb5: krb5_store_string*() input must be non-NULL
krb5_store_string, krb5_store_stringz, krb5_store_stringnl

If the input string is NULL, fail the call with EINVAL.
Do not pass the NULL pointer to strlen().

Change-Id: Id87d72e263dde798f300353ec4c1656b310d17a4
2022-01-25 12:42:09 -05:00
Nicolas Williams
727682ec41 krb5: Fix KCM/API ccache type name confusion
Wrap all KCM cc ops that need to call kcm_alloc() so that they pass in
the cc ops pointer that they're associated with so that kcm_alloc() can
use the correct ccache type name if needed.
2022-01-25 01:16:08 -06:00
Nicolas Williams
c44f94fa7e krb5: Use krb5_enomem() in KCM 2022-01-24 22:11:49 -06:00
Nicolas Williams
2a7095971a krb5: Fix cccol support in KCM 2022-01-24 22:11:35 -06:00
Nicolas Williams
2137f0c28e kcm: Do not clobber error from server 2022-01-24 18:27:35 -06:00
Nicolas Williams
f3517c0d01 ipc: Handle POLLIN/OUT even when ERR 2022-01-24 18:26:55 -06:00
Nicolas Williams
5bb5033f10 krb5: "KEYRING:" should work 2022-01-24 15:38:47 -06:00
Nicolas Williams
c4236f23bd krb5: Fix segfault in KCM ccache type 2022-01-24 13:52:36 -06:00
Jeffrey Altman
31d5c38976 lib/hcrypto: mpz2BN return NULL if mp_ubin_size(s) returns zero
If mp_ubin_size(s) returns zero then mp_to_ubin() will fail and
not return MP_OKAY.  If MP_OKAY is not returned, NULL is returned
to the caller of mpz2BN().

This change avoids the unnecessary memory allocation and function
calls.  It also removes a dereference after null warning from
coverity.

Change-Id: I52ff2c166964e41cb4eef1dac637904bf2bf13bf
2022-01-24 10:14:17 -05:00
Jeffrey Altman
ee56cb33b2 lib/asn1: prevent wrong size argument warnings
190263bb7a
("assert non-NULL ptrs before calling mem funcs") introduced
two wrong size argument warnings.  These locations are not
errors since the allocation is simply to ensure that the
data pointer is non-NULL; length is zero.

Change-Id: I7b3b58247799a48da3653008c7b6d7fbbbf83e25
2022-01-24 00:31:27 -05:00
Jeffrey Altman
190263bb7a assert non-NULL ptrs before calling mem funcs
The definitions of memcpy(), memmove(), and memset() state that
the behaviour is undefined if any of the pointer arguments are
NULL, and some compilers are known to make use of this to
optimise away existing NULL checks in the source.

Change-Id: I489bc256e3eac7ff41d91becb0b43aba73dbb3f9
Link: https://www.imperialviolet.org/2016/06/26/nonnull.html
2022-01-24 00:07:51 -05:00
Jeffrey Altman
d35c9b2d67 lib/gssapi/ntlm: _gss_ntlm_inquire_cred dead code removal
do not check 'cred_handle' for GSS-C_NO_CREDENTIAL twice.

Change-Id: I3629aa49b2d20d3444c6ede46715d65b6072484f
2022-01-23 23:11:46 -05:00
Jeffrey Altman
ca4ff365f8 lib/gssapi/mech: gss_mech_switch do not leak 'm'
If there is a memory allocation failure after 'm'
is allocated, 'm' will be leaked; free it.

Change-Id: I625273634af207fac7c489df166cebde4d467cbc
2022-01-23 23:07:36 -05:00
Jeffrey Altman
693191b23d lib/kadm5: kadm5_c_randkey_principal check store_int return
do not ignore failures to krb5_store_int() ks_salttype.

Change-Id: I4144376f24ac00f45073daec4fa5835706b1ad09
2022-01-23 22:49:57 -05:00
Jeffrey Altman
0a17a0b3b7 lib/asn1: der_put_length test 'size' is non-NULL
Change-Id: I1ffbf1998485fdca7cf151c24c440fb0b35e77e4
2022-01-23 21:47:58 -05:00
Jeffrey Altman
e0e61d2b91 lib/hdb: hdb_create consistently check cb_ctx.h
instead of testing both cb_ctx.h and cb_ctx.h->prefix
for non-NULL, ensure that cb_ctx.h is NULL after each
failed for() loop.  This also ensures that cb_ctx.h
is never left pointing to an invalid non-NULL value.

Change-Id: I3264577b0fbf1d620b00f87d251e8c43b81e0f29
2022-01-23 21:27:56 -05:00
Jeffrey Altman
38536d7313 lib/asn1: set *size output to zero at start of der funcs
Assign zero to the output size parameter at the start so that
callers that use the value when an error occurs do not see
garbage that might be misinterpreted.

Change-Id: Iccfcf4f6944b1bf72789c83919901d9b9d6f9153
2022-01-23 00:10:14 -05:00
Roland C. Dowdeswell
8dcd05ed4d _gss_ntlm_init_sec_context() mem leaks 2022-01-22 21:54:20 -05:00
Roland C. Dowdeswell
e87fca8091 _gss_ntlm_delete_sec_context() mem leaks 2022-01-22 21:54:20 -05:00
Roland C. Dowdeswell
8526b4c627 fix memory leak near NTLM type2 response 2022-01-22 21:54:20 -05:00
Nicolas Williams
d64076dfd9 asn1: Update commentary on grammar 2022-01-22 03:48:27 -06:00
Nicolas Williams
dfc26ae8c1 asn1: Fix last remaining shift/reduce conflict 2022-01-22 03:48:27 -06:00
Nicolas Williams
563964ce96 hx509: Use %left for ! instead of %precedence 2022-01-21 23:34:40 -06:00
Nicolas Williams
88e31d2da8 sl: Add missing sel-gram.h target 2022-01-21 23:15:21 -06:00
Nicolas Williams
cb9b1842ea sl: Fix bison/byacc invocation 2022-01-21 23:01:44 -06:00